Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Removed old video subsystem, along with (now-unncessary) egl files.
  • Loading branch information
bieh committed Jun 17, 2010
1 parent 7fcfcf0 commit b5a450c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 691 deletions.
95 changes: 16 additions & 79 deletions src/video/android/SDL_androidgl.c
Expand Up @@ -34,125 +34,62 @@
#include "SDL_androidevents.h"
#include "SDL_androidrender.h"

/* Android header */
#include "egl.h"


//EGL globals
static EGLDisplay iEglDisplay;
static EGLConfig iEglConfig;
static EGLContext iEglContext;
static EGLSurface iEglSurface;

EGLint attribList [] =
{
EGL_BUFFER_SIZE, 16, //16 bit color
EGL_DEPTH_SIZE, 15,
EGL_NONE
};
#include <android/log.h>


/*
These things are in the JNI android support
*/



/* GL functions */
int Android_GL_LoadLibrary(_THIS, const char *path){
printf("[STUB] GL_LoadLibrary\n");
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_LoadLibrary\n");
return 0;
}

void *Android_GL_GetProcAddress(_THIS, const char *proc){
printf("[STUB] GL_GetProcAddress\n");
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetProcAddress\n");
return 0;
}

void Android_GL_UnloadLibrary(_THIS){
printf("[STUB] GL_UnloadLibrary\n");
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_UnloadLibrary\n");
}

/*
int *Android_GL_GetVisual(_THIS, Display * display, int screen){
printf("[STUB] GL_GetVisual\n");
__android_log_print(ANDROID_LOG_INFO, "SDL","[STUB] GL_GetVisual\n");
return 0;
}
*/

SDL_GLContext Android_GL_CreateContext(_THIS, SDL_Window * window){
printf("[STUB] GL_CreateContext\n");

//Start up the display
iEglDisplay = eglGetDisplay (EGL_DEFAULT_DISPLAY);
if(iEglDisplay == EGL_NO_DISPLAY){
printf("Unable to find a suitable EGLDisplay\n");
return NULL;
}

printf("1\n");

if(!eglInitialize(iEglDisplay, 0, 0)){
printf("Couldn't init display\n");
return NULL;
}

printf("2\n");

EGLint numConfigs;

if(!eglChooseConfig(iEglDisplay, attribList, &iEglConfig, 1, &numConfigs)){
printf("Couldn't choose config\n");
return NULL;
}

printf("3\n");

iEglContext = eglCreateContext(iEglDisplay, iEglConfig, EGL_NO_CONTEXT, 0);

if(iEglContext == 0){
printf("Couldn't create context\n");
return NULL;
}

printf("4\n");

NativeWindowType iWindow = 1; //android_createDisplaySurface();

iEglSurface = eglCreateWindowSurface(iEglDisplay, iEglConfig, iWindow, 0);

printf("5\n");

if(iEglSurface == NULL){
printf("Couldn't create surface\n");
return NULL;
}

printf("6\n");

eglMakeCurrent(iEglDisplay, iEglSurface, iEglSurface, iEglContext);

printf("fininshed making context\n");

return iEglSurface;
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_CreateContext\n");
return NULL;
}

int Android_GL_MakeCurrent(_THIS, SDL_Window * window,
SDL_GLContext context){
printf("[STUB] GL_MakeCurrent\n");
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_MakeCurrent\n");
return 0;
}

int Android_GL_SetSwapInterval(_THIS, int interval){
printf("[STUB] GL_SetSwapInterval\n");
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SetSwapInterval\n");
return 0;
}

int Android_GL_GetSwapInterval(_THIS){
printf("[STUB] GL_GetSwapInterval\n");
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetSwapInterval\n");
return 0;
}

void Android_GL_SwapWindow(_THIS, SDL_Window * window){
printf("[STUB] GL_SwapWindow\n");
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SwapWindow\n");
}

void Android_GL_DeleteContext(_THIS, SDL_GLContext context){
printf("[STUB] GL_DeleteContext\n");
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_DeleteContext\n");
}
4 changes: 2 additions & 2 deletions src/video/android/SDL_androidvideo.c
Expand Up @@ -120,8 +120,8 @@ Android_VideoInit(_THIS)

/* Use a fake 32-bpp desktop mode */
mode.format = SDL_PIXELFORMAT_RGB888;
mode.w = 1024;
mode.h = 768;
mode.w = 320;
mode.h = 480;
mode.refresh_rate = 0;
mode.driverdata = NULL;
if (SDL_AddBasicVideoDisplay(&mode) < 0) {
Expand Down

0 comments on commit b5a450c

Please sign in to comment.