Mercurial > sdl-ios-xcode
comparison src/video/xbios/SDL_xbios.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 |
---|---|
34 #include <mint/osbind.h> | 34 #include <mint/osbind.h> |
35 #include <mint/falcon.h> | 35 #include <mint/falcon.h> |
36 | 36 |
37 #include "SDL_video.h" | 37 #include "SDL_video.h" |
38 #include "SDL_mouse.h" | 38 #include "SDL_mouse.h" |
39 #include "SDL_sysvideo.h" | 39 #include "../SDL_sysvideo.h" |
40 #include "SDL_pixels_c.h" | 40 #include "../SDL_pixels_c.h" |
41 #include "SDL_events_c.h" | 41 #include "../../events/SDL_events_c.h" |
42 | 42 |
43 #include "SDL_ataric2p_s.h" | 43 #include "SDL_ataric2p_s.h" |
44 #include "SDL_atarievents_c.h" | 44 #include "SDL_atarievents_c.h" |
45 #include "SDL_atarimxalloc_c.h" | 45 #include "SDL_atarimxalloc_c.h" |
46 #include "SDL_atarigl_c.h" | 46 #include "SDL_atarigl_c.h" |
76 static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface); | 76 static int XBIOS_FlipHWSurface(_THIS, SDL_Surface *surface); |
77 static void XBIOS_UnlockHWSurface(_THIS, SDL_Surface *surface); | 77 static void XBIOS_UnlockHWSurface(_THIS, SDL_Surface *surface); |
78 static void XBIOS_FreeHWSurface(_THIS, SDL_Surface *surface); | 78 static void XBIOS_FreeHWSurface(_THIS, SDL_Surface *surface); |
79 static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects); | 79 static void XBIOS_UpdateRects(_THIS, int numrects, SDL_Rect *rects); |
80 | 80 |
81 #ifdef HAVE_OPENGL | 81 #if SDL_VIDEO_OPENGL |
82 /* OpenGL functions */ | 82 /* OpenGL functions */ |
83 static void XBIOS_GL_SwapBuffers(_THIS); | 83 static void XBIOS_GL_SwapBuffers(_THIS); |
84 #endif | 84 #endif |
85 | 85 |
86 /* To setup palette */ | 86 /* To setup palette */ |
172 device->LockHWSurface = XBIOS_LockHWSurface; | 172 device->LockHWSurface = XBIOS_LockHWSurface; |
173 device->UnlockHWSurface = XBIOS_UnlockHWSurface; | 173 device->UnlockHWSurface = XBIOS_UnlockHWSurface; |
174 device->FlipHWSurface = XBIOS_FlipHWSurface; | 174 device->FlipHWSurface = XBIOS_FlipHWSurface; |
175 device->FreeHWSurface = XBIOS_FreeHWSurface; | 175 device->FreeHWSurface = XBIOS_FreeHWSurface; |
176 | 176 |
177 #ifdef HAVE_OPENGL | 177 #if SDL_VIDEO_OPENGL |
178 /* OpenGL functions */ | 178 /* OpenGL functions */ |
179 device->GL_LoadLibrary = SDL_AtariGL_LoadLibrary; | 179 device->GL_LoadLibrary = SDL_AtariGL_LoadLibrary; |
180 device->GL_GetProcAddress = SDL_AtariGL_GetProcAddress; | 180 device->GL_GetProcAddress = SDL_AtariGL_GetProcAddress; |
181 device->GL_GetAttribute = SDL_AtariGL_GetAttribute; | 181 device->GL_GetAttribute = SDL_AtariGL_GetAttribute; |
182 device->GL_MakeCurrent = SDL_AtariGL_MakeCurrent; | 182 device->GL_MakeCurrent = SDL_AtariGL_MakeCurrent; |
450 this->info.video_mem = (Uint32) Atari_SysMalloc(-1L, MX_STRAM); | 450 this->info.video_mem = (Uint32) Atari_SysMalloc(-1L, MX_STRAM); |
451 | 451 |
452 /* Init chunky to planar routine */ | 452 /* Init chunky to planar routine */ |
453 SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8; | 453 SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8; |
454 | 454 |
455 #ifdef HAVE_OPENGL | 455 #if SDL_VIDEO_OPENGL |
456 SDL_AtariGL_InitPointers(this); | 456 SDL_AtariGL_InitPointers(this); |
457 #endif | 457 #endif |
458 | 458 |
459 /* We're done! */ | 459 /* We're done! */ |
460 return(0); | 460 return(0); |
564 } | 564 } |
565 SDL_memset(XBIOS_screensmem[0], 0, new_screen_size); | 565 SDL_memset(XBIOS_screensmem[0], 0, new_screen_size); |
566 | 566 |
567 XBIOS_screens[0]=(void *) (( (long) XBIOS_screensmem[0]+256) & 0xFFFFFF00UL); | 567 XBIOS_screens[0]=(void *) (( (long) XBIOS_screensmem[0]+256) & 0xFFFFFF00UL); |
568 | 568 |
569 #ifdef HAVE_OPENGL | 569 #if SDL_VIDEO_OPENGL |
570 if (flags & SDL_OPENGL) { | 570 if (flags & SDL_OPENGL) { |
571 if (this->gl_config.double_buffer) { | 571 if (this->gl_config.double_buffer) { |
572 flags |= SDL_DOUBLEBUF; | 572 flags |= SDL_DOUBLEBUF; |
573 } | 573 } |
574 } | 574 } |
608 else | 608 else |
609 current->pixels = XBIOS_screens[0]; | 609 current->pixels = XBIOS_screens[0]; |
610 | 610 |
611 XBIOS_fbnum = 0; | 611 XBIOS_fbnum = 0; |
612 | 612 |
613 #ifdef HAVE_OPENGL | 613 #if SDL_VIDEO_OPENGL |
614 if (flags & SDL_OPENGL) { | 614 if (flags & SDL_OPENGL) { |
615 if (!SDL_AtariGL_Init(this, current)) { | 615 if (!SDL_AtariGL_Init(this, current)) { |
616 XBIOS_FreeBuffers(this); | 616 XBIOS_FreeBuffers(this); |
617 SDL_SetError("Can not create OpenGL context"); | 617 SDL_SetError("Can not create OpenGL context"); |
618 return NULL; | 618 return NULL; |
889 } | 889 } |
890 Vsync(); | 890 Vsync(); |
891 #endif | 891 #endif |
892 | 892 |
893 | 893 |
894 #ifdef HAVE_OPENGL | 894 #if SDL_VIDEO_OPENGL |
895 if (gl_active) { | 895 if (gl_active) { |
896 SDL_AtariGL_Quit(this, SDL_TRUE); | 896 SDL_AtariGL_Quit(this, SDL_TRUE); |
897 } | 897 } |
898 #endif | 898 #endif |
899 | 899 |
920 } | 920 } |
921 | 921 |
922 this->screen->pixels = NULL; | 922 this->screen->pixels = NULL; |
923 } | 923 } |
924 | 924 |
925 #ifdef HAVE_OPENGL | 925 #if SDL_VIDEO_OPENGL |
926 | 926 |
927 static void XBIOS_GL_SwapBuffers(_THIS) | 927 static void XBIOS_GL_SwapBuffers(_THIS) |
928 { | 928 { |
929 SDL_AtariGL_SwapBuffers(this); | 929 SDL_AtariGL_SwapBuffers(this); |
930 XBIOS_FlipHWSurface(this, this->screen); | 930 XBIOS_FlipHWSurface(this, this->screen); |