diff --git a/CMakeLists.txt b/CMakeLists.txt index adfafa3..a8625f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -234,7 +234,16 @@ set(SOKOL_SRC if(APPLE) add_definitions(-DSOKOL_METAL) +elseif(WIN32) + add_definitions(-DSOKOL_D3D11) +elseif(LINUX) + add_definitions(-DSOKOL_GLCORE33) +endif() + +if(APPLE) set(SOKOL_SRC ${SOKOL_SRC} ${EXAMPLE_DIR}/sokol/sokol.m) +else() + set(SOKOL_SRC ${SOKOL_SRC} ${EXAMPLE_DIR}/sokol/sokol.c) endif() add_executable(sokol ${SOKOL_SRC}) @@ -250,6 +259,8 @@ if(APPLE) "-framework MetalKit" "-framework AudioToolbox" ) +elseif(LINUX) + target_link_libraries(sokol X11 GL m dl asound) endif() target_include_directories(sokol PRIVATE include) @@ -501,4 +512,4 @@ foreach(TIC80_OUTPUT ${TIC80_OUTPUTS}) target_link_libraries(${TIC80_OUTPUT} ${GTK_LIBRARIES}) endif() -endforeach() \ No newline at end of file +endforeach() diff --git a/examples/sokol/sokol.c b/examples/sokol/sokol.c new file mode 100644 index 0000000..8530ff0 --- /dev/null +++ b/examples/sokol/sokol.c @@ -0,0 +1,6 @@ +#define SOKOL_IMPL + +#include "sokol_app.h" +#include "sokol_gfx.h" +#include "sokol_time.h" +#include "sokol_audio.h"