cimgui-sokol-starterkit icon indicating copy to clipboard operation
cimgui-sokol-starterkit copied to clipboard

Defaulting to D3D on windows + gcc

Open JettMonstersGoBoom opened this issue 5 years ago • 2 comments

Line 5 of sokol.c #define SOKOL_D3D11 doesn't build with GCC.

#define SOKOL_GLCORE33 worked fine for me.

JettMonstersGoBoom avatar Oct 30 '20 17:10 JettMonstersGoBoom

Had the same problem, im compilling it on mingw64. Maybe adding the following to sokol/sokol.c could work:

#if defined(__MINGW32__)
#define SOKOL_GLCORE33

saucesaft avatar Nov 02 '20 00:11 saucesaft

Had the same problem, im compilling it on mingw64. Maybe adding the following to sokol/sokol.c could work:

#if defined(__MINGW32__)
#define SOKOL_GLCORE33

thank you for the answer, I adjust by the hint and modify sokol/sokol.c as:

// sokol implementation library on non-Apple platforms
#define SOKOL_IMPL
#if defined(__MINGW32__)
#define SOKOL_GLCORE33
#elif defined(_WIN32)
#define SOKOL_D3D11
#elif defined(__EMSCRIPTEN__)
#define SOKOL_GLES2
#elif defined(__APPLE__)
// NOTE: on macOS, sokol.c is compiled explicitely as ObjC
#define SOKOL_METAL
#else
#define SOKOL_GLCORE33
#endif
#include "sokol_app.h"
#include "sokol_gfx.h"
#include "sokol_glue.h"
#define CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#include "cimgui.h"
#define SOKOL_IMGUI_IMPL
#include "sokol_imgui.h"

complie and link success. hope helps.

beetaa avatar Oct 22 '22 23:10 beetaa