Basic sdl3 support.
This commit is contained in:
2
src/gl.c
2
src/gl.c
@@ -32,7 +32,7 @@ Copy a block of pixels from one framebuffer object to another.
|
||||
Use nil RenderTexture for window framebuffer
|
||||
*/
|
||||
int lglBlitFramebuffer( lua_State* L ) {
|
||||
#if defined( PLATFORM_DESKTOP ) || defined( PLATFORM_DESKTOP_SDL )
|
||||
#if defined( PLATFORM_DESKTOP ) || defined( PLATFORM_DESKTOP_SDL2 ) || defined( PLATFORM_DESKTOP_SDL3 )
|
||||
if ( !( lua_isuserdata( L, 1 ) || lua_isnil( L, 1 ) ) || !( lua_isuserdata( L, 2 ) || lua_isnil( L, 2 ) ) ) {
|
||||
TraceLog( state->logLevelInvalid, "%s", "Argument needs to be RenderTexture or nil" );
|
||||
lua_pushnil( L );
|
||||
|
||||
@@ -17,8 +17,10 @@
|
||||
|
||||
#ifdef PLATFORM_DESKTOP
|
||||
#include "platforms/core_desktop_glfw.c"
|
||||
#elif PLATFORM_DESKTOP_SDL
|
||||
#include "platforms/core_desktop_sdl.c"
|
||||
#elif PLATFORM_DESKTOP_SDL2
|
||||
#include "platforms/core_desktop_sdl2.c"
|
||||
#elif PLATFORM_DESKTOP_SDL3
|
||||
#include "platforms/core_desktop_sdl3.c"
|
||||
#elif PLATFORM_WEB
|
||||
#include "platforms/core_web.c"
|
||||
#endif
|
||||
@@ -1451,7 +1453,7 @@ void luaCallInit() {
|
||||
|
||||
|
||||
void luaCallUpdate() {
|
||||
#if defined PLATFORM_DESKTOP_SDL && defined LUA_EVENTS
|
||||
#if defined PLATFORM_DESKTOP_SDL2 && defined LUA_EVENTS
|
||||
platformSendEvents();
|
||||
#endif
|
||||
lua_State* L = state->luaState;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "main.h"
|
||||
#include "lua_core.h"
|
||||
#include "core.h"
|
||||
#include "platforms/core_desktop_sdl.h"
|
||||
#include "platforms/core_desktop_sdl2.h"
|
||||
|
||||
void platformDefineGlobals() {
|
||||
lua_State* L = state->luaState;
|
||||
23
src/platforms/core_desktop_sdl3.c
Normal file
23
src/platforms/core_desktop_sdl3.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "main.h"
|
||||
#include "lua_core.h"
|
||||
#include "core.h"
|
||||
#include "platforms/core_desktop_sdl3.h"
|
||||
|
||||
void platformDefineGlobals() {
|
||||
lua_State* L = state->luaState;
|
||||
|
||||
lua_getglobal( L, "RL" );
|
||||
/*DOC_DEFINES_START*/
|
||||
/*DOC_DEFINES_END*/
|
||||
lua_pop( L, -1 );
|
||||
}
|
||||
|
||||
void luaPlatformRegister() {
|
||||
// lua_State* L = state->luaState;
|
||||
// lua_getglobal( L, "RL" );
|
||||
|
||||
// lua_pop( L, -1 );
|
||||
#ifdef LUA_EVENTS
|
||||
// platformRegisterEvents();
|
||||
#endif
|
||||
}
|
||||
@@ -29,7 +29,7 @@ void stateContextInit() {
|
||||
state->defaultTexture = (Texture){ 1, 1, 1, 1, 7 };
|
||||
state->shapesTexture = (Texture){ 1, 1, 1, 1, 7 };
|
||||
state->RLGLcurrentShaderLocs = malloc( RL_MAX_SHADER_LOCATIONS * sizeof( int ) );
|
||||
#ifdef PLATFORM_DESKTOP_SDL
|
||||
#ifdef PLATFORM_DESKTOP_SDL2
|
||||
state->SDL_eventQueue = malloc( PLATFORM_SDL_EVENT_QUEUE_LEN * sizeof( SDL_Event ) );
|
||||
state->SDL_eventQueueLen = 0;
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user