Pre-init GLES context
This commit is contained in:
1 parent
2c3fb496b8
commit
ec6614f7d6
3 files changed
+7
-12
No files matched your search
+4
-10
@@ -31,18 +31,12 @@
|
||||
|
||||
self.window.backgroundColor = [UIColor whiteColor];
|
||||
[self.window makeKeyAndVisible];
|
||||
view.enableSetNeedsDisplay = YES;
|
||||
[view setNeedsDisplay];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark - GLKViewDelegate
|
||||
|
||||
- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect {
|
||||
[EAGLContext setCurrentContext:context];
|
||||
|
||||
int width_c = (int) roundf([[UIScreen mainScreen] bounds].size.width);
|
||||
int height_c = (int) roundf([[UIScreen mainScreen] bounds].size.height);
|
||||
callback_AppDelegate_didFinishLaunching(width_c, height_c);
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -60,8 +60,7 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglInit(JNIEnv* env, j
|
||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglMakeCurrent(JNIEnv* env, jclass clazz, jlong window) {
|
||||
debug("ES2Bridge: making current\n");
|
||||
|
||||
jboolean ret = makeCurrentContext(CURR_GL_CONTEXT);
|
||||
debug("ES2Bridge: makeCurrent() returns %d\n", ret);
|
||||
jboolean ret = 1; // makeCurrentContext(CURR_GL_CONTEXT);
|
||||
|
||||
void *libGL = dlopen("libGL.dylib", RTLD_GLOBAL);
|
||||
debug("libGL = %p", libGL);
|
||||
|
||||
@@ -53,9 +53,11 @@ void *getCurrentContext() {
|
||||
jboolean makeCurrentContext(void *context) {
|
||||
// fprintf(stderr, "IOSWindowSystemInterface : makeCurrentContext %x\n", context);
|
||||
if ([EAGLContext setCurrentContext:(__bridge EAGLContext *)jlong_to_ptr(context)] == YES) {
|
||||
/*
|
||||
glClearColor(0.4f, 0.4f, 0.4f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
flushBuffer();
|
||||
*/
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user