Search
lxdream.org :: lxdream/src/drivers/video_egl.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/video_egl.c
changeset 1275:83b15705cdde
prev1258:f8a9c0fd2abb
next1287:dac8f363f1fe
author nkeynes
date Tue Mar 20 08:29:38 2012 +1000 (9 years ago)
permissions -rw-r--r--
last change More android WIP
- Implement onPause/onResume (although resume is not actually working yet)
- Implement BGRA => RGBA texture conversion (BGRA doesn't seem to work on the TFP)

Boot swirl is now displayed, albeit depth buffering seems to be broken.
file annotate diff log raw
1.1 --- a/src/drivers/video_egl.c Mon Mar 05 11:41:03 2012 +1000
1.2 +++ b/src/drivers/video_egl.c Tue Mar 20 08:29:38 2012 +1000
1.3 @@ -76,7 +76,7 @@
1.4 EGL_CONTEXT_CLIENT_VERSION, 2,
1.5 EGL_NONE, EGL_NONE };
1.6
1.7 -static EGLDisplay display;
1.8 +static EGLDisplay display = EGL_NO_DISPLAY;
1.9 static EGLContext context = EGL_NO_CONTEXT;
1.10 static EGLSurface surface = EGL_NO_SURFACE;
1.11 static gboolean fbo_created = FALSE;
1.12 @@ -117,6 +117,7 @@
1.13 }
1.14
1.15 if( eglMakeCurrent( display, surface, surface, context ) == EGL_FALSE ) {
1.16 + logEGLError( "Unable to make EGL context current" );
1.17 video_egl_clear_window();
1.18 return FALSE;
1.19 }
1.20 @@ -129,13 +130,14 @@
1.21 fbo_created = TRUE;
1.22 gl_set_video_size(width, height, 0);
1.23 pvr2_setup_gl_context();
1.24 - INFO( "Initialised EGL %d.%d\n", major, minor );
1.25 + INFO( "Initialised EGL %d.%d", major, minor );
1.26 return TRUE;
1.27 }
1.28
1.29 void video_egl_clear_window()
1.30 {
1.31 if( fbo_created ) {
1.32 + pvr2_shutdown_gl_context();
1.33 gl_fbo_shutdown();
1.34 fbo_created = FALSE;
1.35 }
1.36 @@ -148,7 +150,11 @@
1.37 eglDestroyContext(display, context);
1.38 context = EGL_NO_CONTEXT;
1.39 }
1.40 - eglTerminate(display);
1.41 + if( display != EGL_NO_DISPLAY ) {
1.42 + eglTerminate(display);
1.43 + display = EGL_NO_DISPLAY;
1.44 + }
1.45 + INFO( "Terminated EGL" );
1.46 }
1.47
1.48 static void video_egl_swap_buffers()
.