comparison src/video/photon/SDL_ph_video.c @ 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 d910939febfa
comparison
equal deleted inserted replaced
1360:70a9cfb4cf1b 1361:19418e4422cb
26 #include "SDL_endian.h" 26 #include "SDL_endian.h"
27 #include "SDL_timer.h" 27 #include "SDL_timer.h"
28 #include "SDL_thread.h" 28 #include "SDL_thread.h"
29 #include "SDL_video.h" 29 #include "SDL_video.h"
30 #include "SDL_mouse.h" 30 #include "SDL_mouse.h"
31 #include "SDL_sysvideo.h" 31 #include "../SDL_sysvideo.h"
32 #include "SDL_pixels_c.h" 32 #include "../SDL_pixels_c.h"
33 #include "SDL_events_c.h" 33 #include "../../events/SDL_events_c.h"
34 #include "SDL_ph_video.h" 34 #include "SDL_ph_video.h"
35 #include "SDL_ph_modes_c.h" 35 #include "SDL_ph_modes_c.h"
36 #include "SDL_ph_image_c.h" 36 #include "SDL_ph_image_c.h"
37 #include "SDL_ph_events_c.h" 37 #include "SDL_ph_events_c.h"
38 #include "SDL_ph_mouse_c.h" 38 #include "SDL_ph_mouse_c.h"
39 #include "SDL_ph_wm_c.h" 39 #include "SDL_ph_wm_c.h"
40 #include "SDL_ph_gl.h" 40 #include "SDL_ph_gl.h"
41 #include "SDL_phyuv_c.h" 41 #include "SDL_phyuv_c.h"
42 #include "blank_cursor.h" 42 #include "../blank_cursor.h"
43 43
44 static int ph_VideoInit(_THIS, SDL_PixelFormat *vformat); 44 static int ph_VideoInit(_THIS, SDL_PixelFormat *vformat);
45 static SDL_Surface *ph_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags); 45 static SDL_Surface *ph_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
46 static int ph_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors); 46 static int ph_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors);
47 static void ph_VideoQuit(_THIS); 47 static void ph_VideoQuit(_THIS);
121 device->CheckMouseMode = ph_CheckMouseMode; 121 device->CheckMouseMode = ph_CheckMouseMode;
122 device->InitOSKeymap = ph_InitOSKeymap; 122 device->InitOSKeymap = ph_InitOSKeymap;
123 device->PumpEvents = ph_PumpEvents; 123 device->PumpEvents = ph_PumpEvents;
124 124
125 /* OpenGL support. */ 125 /* OpenGL support. */
126 #ifdef HAVE_OPENGL 126 #if SDL_VIDEO_OPENGL
127 device->GL_MakeCurrent = ph_GL_MakeCurrent; 127 device->GL_MakeCurrent = ph_GL_MakeCurrent;
128 device->GL_SwapBuffers = ph_GL_SwapBuffers; 128 device->GL_SwapBuffers = ph_GL_SwapBuffers;
129 device->GL_GetAttribute = ph_GL_GetAttribute; 129 device->GL_GetAttribute = ph_GL_GetAttribute;
130 device->GL_LoadLibrary = ph_GL_LoadLibrary; 130 device->GL_LoadLibrary = ph_GL_LoadLibrary;
131 device->GL_GetProcAddress = ph_GL_GetProcAddress; 131 device->GL_GetProcAddress = ph_GL_GetProcAddress;
132 #else 132 #endif /* SDL_VIDEO_OPENGL */
133 device->GL_MakeCurrent = NULL;
134 device->GL_SwapBuffers = NULL;
135 device->GL_GetAttribute = NULL;
136 device->GL_LoadLibrary = NULL;
137 device->GL_GetProcAddress = NULL;
138 #endif /* HAVE_OPENGL */
139 133
140 device->free = ph_DeleteDevice; 134 device->free = ph_DeleteDevice;
141 135
142 return device; 136 return device;
143 } 137 }
355 int i; 349 int i;
356 350
357 window=NULL; 351 window=NULL;
358 desktoppal=SDLPH_PAL_NONE; 352 desktoppal=SDLPH_PAL_NONE;
359 353
360 #ifdef HAVE_OPENGL 354 #if SDL_VIDEO_OPENGL
361 oglctx=NULL; 355 oglctx=NULL;
362 oglbuffers=NULL; 356 oglbuffers=NULL;
363 oglflags=0; 357 oglflags=0;
364 oglbpp=0; 358 oglbpp=0;
365 #endif /* HAVE_OPENGL */ 359 #endif
366 360
367 old_video_mode=-1; 361 old_video_mode=-1;
368 old_refresh_rate=-1; 362 old_refresh_rate=-1;
369 363
370 if (NULL == (event = SDL_malloc(EVENT_SIZE))) 364 if (NULL == (event = SDL_malloc(EVENT_SIZE)))
476 return NULL; 470 return NULL;
477 } 471 }
478 472
479 if ((current->flags & SDL_OPENGL)==SDL_OPENGL) 473 if ((current->flags & SDL_OPENGL)==SDL_OPENGL)
480 { 474 {
481 #if !defined(HAVE_OPENGL) 475 #if !SDL_VIDEO_OPENGL
482 /* if no built-in OpenGL support */ 476 /* if no built-in OpenGL support */
483 SDL_SetError("ph_SetVideoMode(): no OpenGL support, you need to recompile SDL.\n"); 477 SDL_SetError("ph_SetVideoMode(): no OpenGL support, you need to recompile SDL.\n");
484 current->flags &= ~SDL_OPENGL; 478 current->flags &= ~SDL_OPENGL;
485 return NULL; 479 return NULL;
486 #endif /* HAVE_OPENGL */ 480 #endif /* SDL_VIDEO_OPENGL */
487 } 481 }
488 else 482 else
489 { 483 {
490 /* Initialize internal variables */ 484 /* Initialize internal variables */
491 if ((current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) 485 if ((current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN)