src/video/pandora/SDL_pandora.c
changeset 7191 75360622e65f
parent 7037 3fedf1f25b94
child 7468 e92571f09ce9
equal deleted inserted replaced
7190:11612d544fcd 7191:75360622e65f
    36 #include "SDL_pandora_events.h"
    36 #include "SDL_pandora_events.h"
    37 
    37 
    38 /* WIZ declarations */
    38 /* WIZ declarations */
    39 #include "GLES/gl.h"
    39 #include "GLES/gl.h"
    40 #ifdef WIZ_GLES_LITE
    40 #ifdef WIZ_GLES_LITE
    41 static NativeWindowType hNativeWnd = 0; // A handle to the window we will create.
    41 static NativeWindowType hNativeWnd = 0; /* A handle to the window we will create. */
    42 #endif
    42 #endif
    43 
    43 
    44 static SDL_bool PND_initialized = SDL_FALSE;
    44 static SDL_bool PND_initialized = SDL_FALSE;
    45 
    45 
    46 static int
    46 static int
   341     /* Check if default library loading requested */
   341     /* Check if default library loading requested */
   342     if (path == NULL) {
   342     if (path == NULL) {
   343         /* Already linked with GF library which provides egl* subset of  */
   343         /* Already linked with GF library which provides egl* subset of  */
   344         /* functions, use Common profile of OpenGL ES library by default */
   344         /* functions, use Common profile of OpenGL ES library by default */
   345 #ifdef WIZ_GLES_LITE
   345 #ifdef WIZ_GLES_LITE
   346 	path = "/lib/libopengles_lite.so";
   346     path = "/lib/libopengles_lite.so";
   347 #else
   347 #else
   348         path = "/usr/lib/libGLES_CM.so";
   348         path = "/usr/lib/libGLES_CM.so";
   349 #endif
   349 #endif
   350     }
   350     }
   351 
   351 
   626         return NULL;
   626         return NULL;
   627     }
   627     }
   628 
   628 
   629 #ifdef WIZ_GLES_LITE
   629 #ifdef WIZ_GLES_LITE
   630     if( !hNativeWnd ) {
   630     if( !hNativeWnd ) {
   631 	hNativeWnd = (NativeWindowType)malloc(16*1024);
   631     hNativeWnd = (NativeWindowType)malloc(16*1024);
   632 
   632 
   633 	if(!hNativeWnd)
   633     if(!hNativeWnd)
   634 	    printf( "Error : Wiz framebuffer allocatation failed\n" ); 
   634         printf( "Error : Wiz framebuffer allocatation failed\n" );
   635 	else
   635     else
   636 	    printf( "SDL13: Wiz framebuffer allocated: %X\n", hNativeWnd );
   636         printf( "SDL13: Wiz framebuffer allocated: %X\n", hNativeWnd );
   637     }
   637     }
   638     else {
   638     else {
   639 	printf( "SDL13: Wiz framebuffer already allocated: %X\n", hNativeWnd );
   639     printf( "SDL13: Wiz framebuffer already allocated: %X\n", hNativeWnd );
   640     }
   640     }
   641 
   641 
   642     wdata->gles_surface =
   642     wdata->gles_surface =
   643 	eglCreateWindowSurface(phdata->egl_display, 
   643     eglCreateWindowSurface(phdata->egl_display,
   644 			       wdata->gles_configs[wdata->gles_config],
   644                    wdata->gles_configs[wdata->gles_config],
   645 			       hNativeWnd, NULL );
   645                    hNativeWnd, NULL );
   646 #else
   646 #else
   647     wdata->gles_surface =
   647     wdata->gles_surface =
   648         eglCreateWindowSurface(phdata->egl_display,
   648         eglCreateWindowSurface(phdata->egl_display,
   649                                wdata->gles_configs[wdata->gles_config],
   649                                wdata->gles_configs[wdata->gles_config],
   650                                (NativeWindowType) 0, NULL);
   650                                (NativeWindowType) 0, NULL);
   836     }
   836     }
   837 
   837 
   838 #ifdef WIZ_GLES_LITE
   838 #ifdef WIZ_GLES_LITE
   839     if( hNativeWnd != 0 )
   839     if( hNativeWnd != 0 )
   840     {
   840     {
   841 	  free(hNativeWnd);
   841       free(hNativeWnd);
   842 	  hNativeWnd = 0;
   842       hNativeWnd = 0;
   843 	  printf( "SDL13: Wiz framebuffer released\n" );
   843       printf( "SDL13: Wiz framebuffer released\n" );
   844     }
   844     }
   845 #endif
   845 #endif
   846 
   846 
   847     return;
   847     return;
   848 }
   848 }