m3g/m3gcore11/src/m3g_rendercontext.c
branchRCL_3
changeset 163 bbf46f59e123
parent 26 15986eb6c500
child 164 25ffed67c7ef
equal deleted inserted replaced
150:57c618273d5c 163:bbf46f59e123
   422         m3gRaiseError(M3G_INTERFACE(ctx), M3G_INVALID_OPERATION);
   422         m3gRaiseError(M3G_INTERFACE(ctx), M3G_INVALID_OPERATION);
   423     }
   423     }
   424 
   424 
   425     /* EGL might not be initialized yet, so do it here just in case. */ 
   425     /* EGL might not be initialized yet, so do it here just in case. */ 
   426     eglInitialize(eglGetDisplay(EGL_DEFAULT_DISPLAY), NULL, NULL);
   426     eglInitialize(eglGetDisplay(EGL_DEFAULT_DISPLAY), NULL, NULL);
       
   427     eglBindAPI(EGL_OPENGL_ES_API);
   427     eglMakeCurrent(eglGetDisplay(EGL_DEFAULT_DISPLAY), NULL, NULL, NULL);
   428     eglMakeCurrent(eglGetDisplay(EGL_DEFAULT_DISPLAY), NULL, NULL, NULL);
   428 
   429 
   429     /* Delete EGL surfaces */
   430     /* Delete EGL surfaces */
   430     for (i = 0; i < M3G_MAX_GL_SURFACES; ++i) {
   431     for (i = 0; i < M3G_MAX_GL_SURFACES; ++i) {
   431         GLSurfaceRecord *surf = &ctx->glSurface[i];
   432         GLSurfaceRecord *surf = &ctx->glSurface[i];
  1385     /* Swap in case we rendered onto a double-buffered surface,
  1386     /* Swap in case we rendered onto a double-buffered surface,
  1386      * release any GL resources that might have been release since the
  1387      * release any GL resources that might have been release since the
  1387      * last time we rendered, then release the GL context so we don't
  1388      * last time we rendered, then release the GL context so we don't
  1388      * hog resources */
  1389      * hog resources */
  1389 #   if !defined(M3G_NGL_CONTEXT_API)
  1390 #   if !defined(M3G_NGL_CONTEXT_API)
  1390     if (ctx->target.type != SURFACE_EGL) {
  1391     if (ctx->target.type == SURFACE_WINDOW) {
  1391 //    m3gSwapBuffers(ctx->target.surface);
  1392         m3gSwapBuffers(ctx->target.surface);
  1392     }
  1393     }
  1393 #   endif
  1394 #   endif
  1394     m3gCollectGLObjects(M3G_INTERFACE(ctx));
  1395     m3gCollectGLObjects(M3G_INTERFACE(ctx));
  1395 #   if !defined(M3G_NGL_CONTEXT_API)
  1396 #   if !defined(M3G_NGL_CONTEXT_API)
  1396     m3gMakeGLCurrent(NULL);
  1397     m3gMakeGLCurrent(NULL);