Call gladLoadGLES2
in mobile to properly detect supported extensions.
This commit is contained in:
parent
d9778546b5
commit
e4b918b384
|
@ -103,6 +103,10 @@ proc init_graphics*(engine: MyouEngine, width, height: int32, title: string,
|
|||
let rev = opengl_version mod 10
|
||||
assert major >= 3
|
||||
|
||||
if not gladLoadGLES2(nil):
|
||||
echo "Could not initialize OpenGL"
|
||||
quit -1
|
||||
|
||||
engine.renderer.enqueue proc()=
|
||||
when not defined(release) and not defined(emscripten):
|
||||
proc f(source: GLenum, etype: GLenum, id: GLuint, severity: GLenum, length: GLsizei, message: cstring, userParam: pointer) {.stdcall.} =
|
||||
|
|
|
@ -227,11 +227,15 @@ proc init_graphics*(engine: MyouEngine, width, height: int32, title: string,
|
|||
window.glfmSetSurfaceCreatedFunc proc(window: Window, w,h: cint) {.cdecl.} =
|
||||
# force resize
|
||||
window.screen = window.screen
|
||||
if not gladLoadGLES2(nil):
|
||||
echo "Could not initialize OpenGL"
|
||||
quit -1
|
||||
window.screen.engine.renderer.initialize()
|
||||
|
||||
window.glfmSetSurfaceDestroyedFunc proc(window: Window) {.cdecl.} =
|
||||
window.screen.engine.renderer.uninitialize()
|
||||
|
||||
|
||||
when not defined(release) and not defined(emscripten):
|
||||
proc f(source: GLenum, etype: GLenum, id: GLuint, severity: GLenum, length: GLsizei, message: cstring, userParam: pointer) {.stdcall.} =
|
||||
if id == 131185:
|
||||
|
|
Loading…
Reference in a new issue