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