annotate src/video/android/SDL_androidgl.c @ 4959:16fec41375a6

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