@@ -451,7 +451,7 @@ pub fn surfaceInit(surface: *apprt.Surface) !void {
451
451
const self : OpenGL = undefined ;
452
452
453
453
switch (apprt .runtime ) {
454
- else = > @compileError ( "unsupported app runtime for OpenGL" ),
454
+ else = > try self . threadEnter ( surface ),
455
455
456
456
apprt .gtk = > {
457
457
// GTK uses global OpenGL context so we load from null.
@@ -491,12 +491,13 @@ pub fn surfaceInit(surface: *apprt.Surface) !void {
491
491
/// final main thread setup requirements.
492
492
pub fn finalizeSurfaceInit (self : * const OpenGL , surface : * apprt.Surface ) ! void {
493
493
_ = self ;
494
- _ = surface ;
495
494
496
495
// For GLFW, we grabbed the OpenGL context in surfaceInit and we
497
496
// need to release it before we start the renderer thread.
498
497
if (apprt .runtime == apprt .glfw ) {
499
498
glfw .makeContextCurrent (null );
499
+ } else {
500
+ try surface .finalizeSurfaceInit ();
500
501
}
501
502
}
502
503
@@ -555,7 +556,7 @@ pub fn threadEnter(self: *const OpenGL, surface: *apprt.Surface) !void {
555
556
_ = self ;
556
557
557
558
switch (apprt .runtime ) {
558
- else = > @compileError ( "unsupported app runtime for OpenGL" ),
559
+ else = > try surface . threadEnter ( ),
559
560
560
561
apprt .gtk = > {
561
562
// GTK doesn't support threaded OpenGL operations as far as I can
@@ -597,7 +598,9 @@ pub fn threadExit(self: *const OpenGL) void {
597
598
_ = self ;
598
599
599
600
switch (apprt .runtime ) {
600
- else = > @compileError ("unsupported app runtime for OpenGL" ),
601
+ else = > {
602
+ // TODO: send to apprt
603
+ },
601
604
602
605
apprt .gtk = > {
603
606
// We don't need to do any unloading for GTK because we may
@@ -2332,7 +2335,7 @@ pub fn drawFrame(self: *OpenGL, surface: *apprt.Surface) !void {
2332
2335
apprt .glfw = > surface .window .swapBuffers (),
2333
2336
apprt .gtk = > {},
2334
2337
apprt .embedded = > {},
2335
- else = > @compileError ( "unsupported runtime" ),
2338
+ else = > try surface . swapBuffers ( ),
2336
2339
}
2337
2340
}
2338
2341
0 commit comments