Mercurial > sdl-ios-xcode
comparison src/video/photon/SDL_ph_image.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 |
---|---|
23 #include <Ph.h> | 23 #include <Ph.h> |
24 #include <photon/Pg.h> | 24 #include <photon/Pg.h> |
25 | 25 |
26 #include "SDL_endian.h" | 26 #include "SDL_endian.h" |
27 #include "SDL_video.h" | 27 #include "SDL_video.h" |
28 #include "SDL_pixels_c.h" | 28 #include "../SDL_pixels_c.h" |
29 #include "SDL_ph_video.h" | 29 #include "SDL_ph_video.h" |
30 #include "SDL_ph_image_c.h" | 30 #include "SDL_ph_image_c.h" |
31 #include "SDL_ph_modes_c.h" | 31 #include "SDL_ph_modes_c.h" |
32 #include "SDL_ph_gl.h" | 32 #include "SDL_ph_gl.h" |
33 | 33 |
291 PgWaitHWIdle(); | 291 PgWaitHWIdle(); |
292 | 292 |
293 return 0; | 293 return 0; |
294 } | 294 } |
295 | 295 |
296 #ifdef HAVE_OPENGL | 296 #if SDL_VIDEO_OPENGL |
297 | 297 |
298 int ph_SetupOpenGLImage(_THIS, SDL_Surface* screen) | 298 int ph_SetupOpenGLImage(_THIS, SDL_Surface* screen) |
299 { | 299 { |
300 this->UpdateRects = ph_OpenGLUpdate; | 300 this->UpdateRects = ph_OpenGLUpdate; |
301 screen->pixels=NULL; | 301 screen->pixels=NULL; |
319 } | 319 } |
320 | 320 |
321 return 0; | 321 return 0; |
322 } | 322 } |
323 | 323 |
324 #endif /* HAVE_OPENGL */ | 324 #endif /* SDL_VIDEO_OPENGL */ |
325 | 325 |
326 void ph_DestroyImage(_THIS, SDL_Surface* screen) | 326 void ph_DestroyImage(_THIS, SDL_Surface* screen) |
327 { | 327 { |
328 | 328 |
329 #ifdef HAVE_OPENGL | 329 #if SDL_VIDEO_OPENGL |
330 if ((screen->flags & SDL_OPENGL)==SDL_OPENGL) | 330 if ((screen->flags & SDL_OPENGL)==SDL_OPENGL) |
331 { | 331 { |
332 if (oglctx) | 332 if (oglctx) |
333 { | 333 { |
334 #if (_NTO_VERSION < 630) | 334 #if (_NTO_VERSION < 630) |
352 } | 352 } |
353 #endif /* 6.3.0 */ | 353 #endif /* 6.3.0 */ |
354 | 354 |
355 return; | 355 return; |
356 } | 356 } |
357 #endif /* HAVE_OPENGL */ | 357 #endif /* SDL_VIDEO_OPENGL */ |
358 | 358 |
359 if (currently_fullscreen) | 359 if (currently_fullscreen) |
360 { | 360 { |
361 /* if we right now in 8bpp fullscreen we must release palette */ | 361 /* if we right now in 8bpp fullscreen we must release palette */ |
362 if ((screen->format->BitsPerPixel==8) && (desktopbpp!=8)) | 362 if ((screen->format->BitsPerPixel==8) && (desktopbpp!=8)) |
482 { | 482 { |
483 int setupresult=-1; | 483 int setupresult=-1; |
484 | 484 |
485 ph_DestroyImage(this, screen); | 485 ph_DestroyImage(this, screen); |
486 | 486 |
487 #ifdef HAVE_OPENGL | 487 #if SDL_VIDEO_OPENGL |
488 if ((flags & SDL_OPENGL)==SDL_OPENGL) | 488 if ((flags & SDL_OPENGL)==SDL_OPENGL) |
489 { | 489 { |
490 setupresult=ph_SetupOpenGLImage(this, screen); | 490 setupresult=ph_SetupOpenGLImage(this, screen); |
491 } | 491 } |
492 else | 492 else |
493 { | 493 { |
494 #endif /* HAVE_OPENGL */ | 494 #endif |
495 if ((flags & SDL_FULLSCREEN)==SDL_FULLSCREEN) | 495 if ((flags & SDL_FULLSCREEN)==SDL_FULLSCREEN) |
496 { | 496 { |
497 setupresult=ph_SetupFullScreenImage(this, screen); | 497 setupresult=ph_SetupFullScreenImage(this, screen); |
498 } | 498 } |
499 else | 499 else |
505 else | 505 else |
506 { | 506 { |
507 setupresult=ph_SetupImage(this, screen); | 507 setupresult=ph_SetupImage(this, screen); |
508 } | 508 } |
509 } | 509 } |
510 #ifdef HAVE_OPENGL | 510 #if SDL_VIDEO_OPENGL |
511 } | 511 } |
512 #endif /* HAVE_OPENGL */ | 512 #endif |
513 if (setupresult!=-1) | 513 if (setupresult!=-1) |
514 { | 514 { |
515 ph_UpdateHWInfo(this); | 515 ph_UpdateHWInfo(this); |
516 } | 516 } |
517 | 517 |
952 PgSetAlphaBlend(NULL, alpha); | 952 PgSetAlphaBlend(NULL, alpha); |
953 | 953 |
954 return 0; | 954 return 0; |
955 } | 955 } |
956 | 956 |
957 #ifdef HAVE_OPENGL | 957 #if SDL_VIDEO_OPENGL |
958 void ph_OpenGLUpdate(_THIS, int numrects, SDL_Rect* rects) | 958 void ph_OpenGLUpdate(_THIS, int numrects, SDL_Rect* rects) |
959 { | 959 { |
960 this->GL_SwapBuffers(this); | 960 this->GL_SwapBuffers(this); |
961 | 961 |
962 return; | 962 return; |
963 } | 963 } |
964 #endif /* HAVE_OPENGL */ | 964 #endif /* SDL_VIDEO_OPENGL */ |
965 | 965 |
966 void ph_NormalUpdate(_THIS, int numrects, SDL_Rect *rects) | 966 void ph_NormalUpdate(_THIS, int numrects, SDL_Rect *rects) |
967 { | 967 { |
968 PhPoint_t ph_pos; | 968 PhPoint_t ph_pos; |
969 PhRect_t ph_rect; | 969 PhRect_t ph_rect; |