GL ES 3.2 static: restore ability to load extension procs, and load them.

This commit is contained in:
Alberto Torres 2025-02-06 14:49:48 +01:00
parent f898f0b7d8
commit 1e36ce6791
2 changed files with 1185 additions and 946 deletions

File diff suppressed because it is too large Load diff

View file

@ -219,6 +219,9 @@ proc make_window*(width, height: int32, title: string): Window =
proc set_vsync*(window: Window, vsync: bool) =
discard
type ProcAddress* = proc() {.cdecl.}
proc eglGetProcAddress*(procName: cstring): ProcAddress {.importc, discardable.}
var max_messages = 0
proc init_graphics*(engine: MyouEngine, width, height: int32, title: string,
@ -257,7 +260,7 @@ 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):
if not gladLoadGLES2(eglGetProcAddress):
echo "Could not initialize OpenGL"
quit -1
window.screen.engine.renderer.initialize()