rev: 21c5e6d2f665d0e8b4ff917a51b664c895dab2ed tukan/tukan/sdl.sc -rw-r--r-- 1.0 KiB View raw Log this file
21c5e6d2f665 — Leonard Ritter * renamed project from Liminal to Tukan 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import .core

define lib
    if (operating-system == 'windows)
        load-library "SDL2.dll"
    else
        load-library
            module-dir .. "/../bin/libSDL2-2.0.so.0"
    import-c "import_sdl.c"
        """"
            #include <stdbool.h>
            #include "SDL2/SDL.h"
            #include "SDL2/SDL_syswm.h"
            #include "SDL2/SDL_vulkan.h"
            #include "tukan/imgui_impl_sdl_gl3.h"

            void SDL__VERSION (SDL_version *val) {
                SDL_VERSION(val);
            }

            int SDL__WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED;
            int SDL__WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED;
        list
            \ "-I" (module-dir .. "/../cdefs")
            \ "-I" (module-dir .. "/../include")

using lib filter "^(SDL(.+)|ImGui_ImplSdlGL3_(.+))$"

define SDL_WINDOWPOS_CENTERED (load (@ SDL__WINDOWPOS_CENTERED))
define SDL_WINDOWPOS_UNDEFINED (load (@ SDL__WINDOWPOS_UNDEFINED))

fn sdl-ok (result)
    if (none? result)
        compiler-error! "int expected"
    assert (SDL_TRUE == result)

locals;