Closed pjako closed 7 years ago
Sokol is written in C, so I don't see why you can't. Specially if there is already a wrapper around OpenGL ES2.
Just copy sokol source in Ctoy/src or so and use #define SOKOL_GLES2
Tried that already, getting a error in that case:
In file included from src/main.c:21:
In file included from src/hello_sokol.c:8:
In file included from src/sokol_gfx.h:859:
In file included from src/_sokol_gfx.impl.h:237:
src/_sokol_gfx_gl.impl.h:275: error: 'GL_HALF_FLOAT' undeclared
hello_sokol.c -> https://gist.github.com/pjako/0c89587d13b60d83ba8f441b3c6eece4
GL_HALF_FLOAT is not part of OpenGL ES2 (OpenGL ES3 I think). _sokol_gfx_gl.impl.h should not call it if SOKOL_GLES2 is defined
Its an extension for OpenGL ES2. To have sokol to cover this case it needs some kind of no extensions macro
Yes.
Of course as a workaround you can always declare:
(see https://github.com/anael-seghezzi/CToy/blob/master/3rdparty/glad/include/glad/glad.h)
or even:
unfortunate this is a rabbit hole. After adding all the simple #define stuff
In file included from src/main.c:21:
In file included from src/hello_sokol.c:3768:
In file included from src/sokol_gfx.h:859:
In file included from src/_sokol_gfx.impl.h:237:
src/_sokol_gfx_gl.impl.h:1748: warning: implicit declaration of function 'glVertexAttribDivisor'
In file included from src/main.c:21:
In file included from src/hello_sokol.c:3768:
In file included from src/sokol_gfx.h:859:
In file included from src/_sokol_gfx.impl.h:237:
src/_sokol_gfx_gl.impl.h:1828: warning: implicit declaration of function 'glDrawElementsInstanced'
In file included from src/main.c:21:
In file included from src/hello_sokol.c:3768:
In file included from src/sokol_gfx.h:859:
In file included from src/_sokol_gfx.impl.h:237:
src/_sokol_gfx_gl.impl.h:1839: warning: implicit declaration of function 'glDrawArraysInstanced'
I see, also not part of OpenGLES2.
It would be nice to be able to use sokol with Ctoy beside OpenGL ES2 directly.