comparison src/video/bwindow/SDL_sysvideo.cc @ 1361:19418e4422cb

New configure-based build system. Still work in progress, but much improved
author Sam Lantinga <slouken@libsdl.org>
date Thu, 16 Feb 2006 10:11:48 +0000
parents c71e05b4dc2e
children e440d5c488c1
comparison
equal deleted inserted replaced
1360:70a9cfb4cf1b 1361:19418e4422cb
25 #include <unistd.h> 25 #include <unistd.h>
26 26
27 #include "SDL_BeApp.h" 27 #include "SDL_BeApp.h"
28 #include "SDL_BWin.h" 28 #include "SDL_BWin.h"
29 #include "SDL_timer.h" 29 #include "SDL_timer.h"
30 #include "blank_cursor.h"
31 30
32 extern "C" { 31 extern "C" {
33 32
34 #include "SDL_sysvideo.h" 33 #include "../SDL_sysvideo.h"
34 #include "../../events/SDL_sysevents_c.h"
35 #include "../../events/SDL_events_c.h"
35 #include "SDL_sysmouse_c.h" 36 #include "SDL_sysmouse_c.h"
36 #include "SDL_sysevents_c.h"
37 #include "SDL_events_c.h"
38 #include "SDL_syswm_c.h" 37 #include "SDL_syswm_c.h"
39 #include "SDL_lowvideo.h" 38 #include "SDL_lowvideo.h"
40 #include "SDL_yuvfuncs.h" 39 #include "../SDL_yuvfuncs.h"
41 #include "SDL_sysyuv.h" 40 #include "SDL_sysyuv.h"
41 #include "../blank_cursor.h"
42 42
43 #define BEOS_HIDDEN_SIZE 32 /* starting hidden window size */ 43 #define BEOS_HIDDEN_SIZE 32 /* starting hidden window size */
44 44
45 /* Initialization/Query functions */ 45 /* Initialization/Query functions */
46 static int BE_VideoInit(_THIS, SDL_PixelFormat *vformat); 46 static int BE_VideoInit(_THIS, SDL_PixelFormat *vformat);
58 58
59 static int BE_ToggleFullScreen(_THIS, int fullscreen); 59 static int BE_ToggleFullScreen(_THIS, int fullscreen);
60 static SDL_Overlay *BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display); 60 static SDL_Overlay *BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display);
61 61
62 /* OpenGL functions */ 62 /* OpenGL functions */
63 #ifdef HAVE_OPENGL 63 #if SDL_VIDEO_OPENGL
64 static int BE_GL_LoadLibrary(_THIS, const char *path); 64 static int BE_GL_LoadLibrary(_THIS, const char *path);
65 static void* BE_GL_GetProcAddress(_THIS, const char *proc); 65 static void* BE_GL_GetProcAddress(_THIS, const char *proc);
66 static int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value); 66 static int BE_GL_GetAttribute(_THIS, SDL_GLattr attrib, int* value);
67 static int BE_GL_MakeCurrent(_THIS); 67 static int BE_GL_MakeCurrent(_THIS);
68 static void BE_GL_SwapBuffers(_THIS); 68 static void BE_GL_SwapBuffers(_THIS);
121 device->LockHWSurface = BE_LockHWSurface; 121 device->LockHWSurface = BE_LockHWSurface;
122 device->UnlockHWSurface = BE_UnlockHWSurface; 122 device->UnlockHWSurface = BE_UnlockHWSurface;
123 device->FlipHWSurface = NULL; 123 device->FlipHWSurface = NULL;
124 device->FreeHWSurface = BE_FreeHWSurface; 124 device->FreeHWSurface = BE_FreeHWSurface;
125 /* Gamma support */ 125 /* Gamma support */
126 #ifdef HAVE_OPENGL 126 #if SDL_VIDEO_OPENGL
127 /* OpenGL support */ 127 /* OpenGL support */
128 device->GL_LoadLibrary = BE_GL_LoadLibrary; 128 device->GL_LoadLibrary = BE_GL_LoadLibrary;
129 device->GL_GetProcAddress = BE_GL_GetProcAddress; 129 device->GL_GetProcAddress = BE_GL_GetProcAddress;
130 device->GL_GetAttribute = BE_GL_GetAttribute; 130 device->GL_GetAttribute = BE_GL_GetAttribute;
131 device->GL_MakeCurrent = BE_GL_MakeCurrent; 131 device->GL_MakeCurrent = BE_GL_MakeCurrent;
301 bounds.top = 0; bounds.left = 0; 301 bounds.top = 0; bounds.left = 0;
302 bounds.right = BEOS_HIDDEN_SIZE; 302 bounds.right = BEOS_HIDDEN_SIZE;
303 bounds.bottom = BEOS_HIDDEN_SIZE; 303 bounds.bottom = BEOS_HIDDEN_SIZE;
304 SDL_Win = new SDL_BWin(bounds); 304 SDL_Win = new SDL_BWin(bounds);
305 305
306 #ifdef HAVE_OPENGL 306 #if SDL_VIDEO_OPENGL
307 /* testgl application doesn't load library, just tries to load symbols */ 307 /* testgl application doesn't load library, just tries to load symbols */
308 /* is it correct? if so we have to load library here */ 308 /* is it correct? if so we have to load library here */
309 BE_GL_LoadLibrary(_this, NULL); 309 BE_GL_LoadLibrary(_this, NULL);
310 #endif 310 #endif
311 311
622 } 622 }
623 SDL_Win->EndDraw(); 623 SDL_Win->EndDraw();
624 } 624 }
625 } 625 }
626 626
627 #ifdef HAVE_OPENGL 627 #if SDL_VIDEO_OPENGL
628 /* Passing a NULL path means load pointers from the application */ 628 /* Passing a NULL path means load pointers from the application */
629 int BE_GL_LoadLibrary(_THIS, const char *path) 629 int BE_GL_LoadLibrary(_THIS, const char *path)
630 { 630 {
631 if (path == NULL) { 631 if (path == NULL) {
632 if (_this->gl_config.dll_handle == NULL) { 632 if (_this->gl_config.dll_handle == NULL) {
813 bscreen.SetMode(&saved_mode); 813 bscreen.SetMode(&saved_mode);
814 } 814 }
815 _this->screen->pixels = NULL; 815 _this->screen->pixels = NULL;
816 } 816 }
817 817
818 #ifdef HAVE_OPENGL 818 #if SDL_VIDEO_OPENGL
819 if (_this->gl_config.dll_handle != NULL) 819 if (_this->gl_config.dll_handle != NULL)
820 unload_add_on((image_id)_this->gl_config.dll_handle); 820 unload_add_on((image_id)_this->gl_config.dll_handle);
821 #endif 821 #endif
822 822
823 SDL_QuitBeApp(); 823 SDL_QuitBeApp();