sdl phase 1
This commit is contained in:
41
examples/modules/sdl3.sx
Normal file
41
examples/modules/sdl3.sx
Normal file
@@ -0,0 +1,41 @@
|
||||
#library "SDL3";
|
||||
|
||||
// SDL_InitFlags
|
||||
SDL_INIT_VIDEO :u32: 0x20;
|
||||
|
||||
// SDL_WindowFlags
|
||||
SDL_WINDOW_OPENGL :u64: 0x2;
|
||||
|
||||
// SDL_GLAttr (enum starting at 0)
|
||||
SDL_GL_DOUBLEBUFFER :s32: 5;
|
||||
SDL_GL_DEPTH_SIZE :s32: 6;
|
||||
SDL_GL_CONTEXT_MAJOR_VERSION :s32: 17;
|
||||
SDL_GL_CONTEXT_MINOR_VERSION :s32: 18;
|
||||
SDL_GL_CONTEXT_FLAGS :s32: 19;
|
||||
SDL_GL_CONTEXT_PROFILE_MASK :s32: 20;
|
||||
|
||||
// SDL_GLProfile
|
||||
SDL_GL_CONTEXT_PROFILE_CORE :s32: 0x1;
|
||||
|
||||
// SDL_GLContextFlag
|
||||
SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG :s32: 0x2;
|
||||
|
||||
// SDL_EventType
|
||||
SDL_EVENT_QUIT :u32: 0x100;
|
||||
SDL_EVENT_KEY_DOWN :u32: 0x300;
|
||||
|
||||
// Functions
|
||||
SDL_Init :: (flags: u32) -> bool #foreign;
|
||||
SDL_Quit :: () -> void #foreign;
|
||||
SDL_CreateWindow :: (title: [:0]u8, w: s32, h: s32, flags: u64) -> *void #foreign;
|
||||
SDL_DestroyWindow :: (window: *void) -> void #foreign;
|
||||
SDL_GL_SetAttribute :: (attr: s32, value: s32) -> bool #foreign;
|
||||
SDL_GL_CreateContext :: (window: *void) -> *void #foreign;
|
||||
SDL_GL_DestroyContext :: (context: *void) -> bool #foreign;
|
||||
SDL_GL_MakeCurrent :: (window: *void, context: *void) -> bool #foreign;
|
||||
SDL_GL_SwapWindow :: (window: *void) -> bool #foreign;
|
||||
SDL_GL_SetSwapInterval :: (interval: s32) -> bool #foreign;
|
||||
SDL_GL_GetProcAddress :: (proc: [:0]u8) -> *void #foreign;
|
||||
SDL_PollEvent :: (event: *void) -> bool #foreign;
|
||||
SDL_GetTicks :: () -> u64 #foreign;
|
||||
SDL_Delay :: (ms: u32) -> void #foreign;
|
||||
Reference in New Issue
Block a user