src/video/android/SDL_androidgl.c
changeset 4707 8b109f0dcd2f
parent 4703 c93b44ddc63e
child 4709 6dc26b9d8368
     1.1 --- a/src/video/android/SDL_androidgl.c	Fri Jun 18 00:02:13 2010 +1200
     1.2 +++ b/src/video/android/SDL_androidgl.c	Fri Jun 18 00:03:09 2010 +1200
     1.3 @@ -34,125 +34,62 @@
     1.4  #include "SDL_androidevents.h"
     1.5  #include "SDL_androidrender.h"
     1.6  
     1.7 -/* Android header */
     1.8 -#include "egl.h"
     1.9 +#include <android/log.h>
    1.10  
    1.11  
    1.12 -//EGL globals
    1.13 -static EGLDisplay iEglDisplay; 	
    1.14 -static EGLConfig  iEglConfig;   	
    1.15 -static EGLContext iEglContext; 	
    1.16 -static EGLSurface iEglSurface;	
    1.17 -
    1.18 -EGLint attribList [] = 
    1.19 -{ 
    1.20 -	EGL_BUFFER_SIZE, 16, //16 bit color
    1.21 -	EGL_DEPTH_SIZE, 15,
    1.22 -	EGL_NONE 
    1.23 -};	
    1.24 -
    1.25 -
    1.26 +/*
    1.27 +These things are in the JNI android support
    1.28 +*/
    1.29 + 
    1.30  
    1.31  
    1.32  /* GL functions */
    1.33  int Android_GL_LoadLibrary(_THIS, const char *path){
    1.34 -	printf("[STUB] GL_LoadLibrary\n");
    1.35 +	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_LoadLibrary\n");
    1.36  	return 0;
    1.37  }
    1.38  
    1.39  void *Android_GL_GetProcAddress(_THIS, const char *proc){
    1.40 -	printf("[STUB] GL_GetProcAddress\n");
    1.41 +	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetProcAddress\n");
    1.42  	return 0;
    1.43  }
    1.44  
    1.45  void Android_GL_UnloadLibrary(_THIS){
    1.46 -	printf("[STUB] GL_UnloadLibrary\n");
    1.47 +	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_UnloadLibrary\n");
    1.48  }
    1.49  
    1.50  /*
    1.51  int *Android_GL_GetVisual(_THIS, Display * display, int screen){
    1.52 -	printf("[STUB] GL_GetVisual\n");
    1.53 +	__android_log_print(ANDROID_LOG_INFO, "SDL","[STUB] GL_GetVisual\n");
    1.54  	return 0;
    1.55  }
    1.56  */
    1.57  
    1.58  SDL_GLContext Android_GL_CreateContext(_THIS, SDL_Window * window){
    1.59 -	printf("[STUB] GL_CreateContext\n");
    1.60 -
    1.61 -	//Start up the display
    1.62 -	iEglDisplay = eglGetDisplay (EGL_DEFAULT_DISPLAY);
    1.63 -	if(iEglDisplay == EGL_NO_DISPLAY){
    1.64 -		printf("Unable to find a  suitable EGLDisplay\n");
    1.65 -		return NULL;
    1.66 -	}
    1.67 -
    1.68 -	printf("1\n");
    1.69 -		
    1.70 -	if(!eglInitialize(iEglDisplay, 0, 0)){
    1.71 -		printf("Couldn't init display\n");
    1.72 -		return NULL;
    1.73 -	}
    1.74 -
    1.75 -	printf("2\n");
    1.76 -	
    1.77 -	EGLint numConfigs;
    1.78 -	
    1.79 -	if(!eglChooseConfig(iEglDisplay, attribList, &iEglConfig, 1, &numConfigs)){
    1.80 -		printf("Couldn't choose config\n");
    1.81 -		return NULL;
    1.82 -	}
    1.83 -
    1.84 -	printf("3\n");
    1.85 -	 
    1.86 -	iEglContext = eglCreateContext(iEglDisplay, iEglConfig, EGL_NO_CONTEXT, 0);
    1.87 -		
    1.88 -	if(iEglContext == 0){
    1.89 -		printf("Couldn't create context\n");
    1.90 -		return NULL;
    1.91 -	}
    1.92 -
    1.93 -	printf("4\n");
    1.94 -		
    1.95 -	NativeWindowType iWindow = 1; //android_createDisplaySurface();
    1.96 -	
    1.97 -	iEglSurface = eglCreateWindowSurface(iEglDisplay, iEglConfig, iWindow, 0);	
    1.98 -
    1.99 -	printf("5\n");
   1.100 -	
   1.101 -	if(iEglSurface == NULL){
   1.102 -		printf("Couldn't create surface\n");
   1.103 -		return NULL;
   1.104 -	}
   1.105 -
   1.106 -	printf("6\n");
   1.107 -	
   1.108 -	eglMakeCurrent(iEglDisplay, iEglSurface, iEglSurface, iEglContext);
   1.109 -
   1.110 -	printf("fininshed making context\n");
   1.111 -	
   1.112 -	return iEglSurface;
   1.113 +	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_CreateContext\n");
   1.114 +	return NULL; 
   1.115  }
   1.116  
   1.117  int Android_GL_MakeCurrent(_THIS, SDL_Window * window,
   1.118                                SDL_GLContext context){
   1.119 -	printf("[STUB] GL_MakeCurrent\n");
   1.120 +	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_MakeCurrent\n");
   1.121  	return 0;
   1.122  }
   1.123  
   1.124  int Android_GL_SetSwapInterval(_THIS, int interval){
   1.125 -	printf("[STUB] GL_SetSwapInterval\n");
   1.126 +	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SetSwapInterval\n");
   1.127  	return 0;
   1.128  }
   1.129  
   1.130  int Android_GL_GetSwapInterval(_THIS){
   1.131 -	printf("[STUB] GL_GetSwapInterval\n");
   1.132 +	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetSwapInterval\n");
   1.133  	return 0;
   1.134  }
   1.135  
   1.136  void Android_GL_SwapWindow(_THIS, SDL_Window * window){
   1.137 -	printf("[STUB] GL_SwapWindow\n");
   1.138 +	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SwapWindow\n");
   1.139  }
   1.140  
   1.141  void Android_GL_DeleteContext(_THIS, SDL_GLContext context){
   1.142 -	printf("[STUB] GL_DeleteContext\n");
   1.143 +	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_DeleteContext\n");
   1.144  }