src/video/android/SDL_androidgl.c
author Paul Hunkin <paul@bieh.net>
Tue, 27 Jul 2010 21:21:24 +0200
changeset 4722 faa228f7ce5b
parent 4711 ed040b480a9f
child 4959 16fec41375a6
permissions -rw-r--r--
- Cleaned up a bunch of code
- Added 'feature' enable/disable so we're not running accel/sound/whatever in Java when we don't need to be
- More work on the sound system. But it still crashes pretty horribly, not sure why yet.
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2010 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 #include "SDL_config.h"
    23 
    24 /* Android SDL video driver implementation
    25 */
    26 
    27 #include "SDL_video.h"
    28 #include "SDL_mouse.h"
    29 #include "../SDL_sysvideo.h"
    30 #include "../SDL_pixels_c.h"
    31 #include "../../events/SDL_events_c.h"
    32 
    33 #include "SDL_androidvideo.h"
    34 #include "SDL_androidevents.h"
    35 #include "SDL_androidrender.h"
    36 
    37 #include <android/log.h>
    38 
    39 #include <pthread.h>
    40 
    41 /*
    42 These things are in the JNI android support
    43 */
    44 extern void Android_CreateContext();
    45 extern void Android_Render();
    46 
    47 /* GL functions */
    48 int Android_GL_LoadLibrary(_THIS, const char *path){
    49 	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_LoadLibrary\n");
    50 	return 0;
    51 }
    52 
    53 void *Android_GL_GetProcAddress(_THIS, const char *proc){
    54 	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetProcAddress\n");
    55 	return 0;
    56 }
    57 
    58 void Android_GL_UnloadLibrary(_THIS){
    59 	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_UnloadLibrary\n");
    60 }
    61 
    62 /*
    63 int *Android_GL_GetVisual(_THIS, Display * display, int screen){
    64 	__android_log_print(ANDROID_LOG_INFO, "SDL","[STUB] GL_GetVisual\n");
    65 	return 0;
    66 }
    67 */
    68 
    69 SDL_GLContext Android_GL_CreateContext(_THIS, SDL_Window * window){
    70 	Android_CreateContext();
    71 	return 1;
    72 }
    73 
    74 int Android_GL_MakeCurrent(_THIS, SDL_Window * window,
    75                               SDL_GLContext context){
    76 	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_MakeCurrent\n");
    77 	return 0;
    78 }
    79 
    80 int Android_GL_SetSwapInterval(_THIS, int interval){
    81 	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_SetSwapInterval\n");
    82 	return 0;
    83 }
    84 
    85 int Android_GL_GetSwapInterval(_THIS){
    86 	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_GetSwapInterval\n");
    87 	return 0;
    88 }
    89 
    90 void Android_GL_SwapWindow(_THIS, SDL_Window * window){
    91 	Android_Render();
    92 }
    93 
    94 void Android_GL_DeleteContext(_THIS, SDL_GLContext context){
    95 	__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_DeleteContext\n");
    96 }