comparison src/video/photon/SDL_ph_video.c @ 19:8cc4dbfab9ab

Date: Thu, 19 Apr 2001 08:36:54 +0300 From: "Mike Gorchak" <mike@malva.com.ua> Subject: Patches for QNX RtP Here my patch for QNX RtP/Photon for SDL-1.2. Detailed description of my changes: SDL/configure.in: If Photon detected declare define ENABLE_PHOTON. SDL/src/video/SDL_sysvideo.h: Added extern to ph_bootstrap. SDL/src/video/SDL_video.c: Added ph_bootstrap to bootstrap array. SDL/src/video/photon/SDL_ph_events.c: Declare DISABLE_X11 if compiled for Photon. SDL/src/video/photon/SDL_ph_image.c: Fixed segment violation on exit. Please update BUGS file. SDL/src/video/photon/SDL_ph_video.c: 1. Enabling window manager. 2. Added to device capabilities Photon Window Manager functions: SetCaption and IconifyWindow. 3. Renamed X11_bootstrap to ph_bootstrap. 4. Removed SEGFAULT termination of programs if Photon not available. SDL/src/video/photon/SDL_ph_wm.c: 1. Declare DISABLE_X11 if compiled for Photon. 2. Added ph_SetCaption and ph_IconifyWindow code. (Thanks to 'phearbear' for iconify window source). 3. Some stubers for other wm functions. Thanks ! ---------------------------- Mike Gorchak CJSC Malva System Programmer
author Sam Lantinga <slouken@lokigames.com>
date Thu, 10 May 2001 18:42:17 +0000
parents 74212992fb08
children 62bad9a82022
comparison
equal deleted inserted replaced
18:d9e3595b63d5 19:8cc4dbfab9ab
44 #include "SDL_ph_video.h" 44 #include "SDL_ph_video.h"
45 #include "SDL_ph_modes_c.h" 45 #include "SDL_ph_modes_c.h"
46 #include "SDL_ph_image_c.h" 46 #include "SDL_ph_image_c.h"
47 #include "SDL_ph_events_c.h" 47 #include "SDL_ph_events_c.h"
48 #include "SDL_ph_mouse_c.h" 48 #include "SDL_ph_mouse_c.h"
49 #include "SDL_ph_wm_c.h"
49 #include "SDL_phyuv_c.h" 50 #include "SDL_phyuv_c.h"
50 #include "blank_cursor.h" 51 #include "blank_cursor.h"
51 52
52 static int ph_VideoInit(_THIS, SDL_PixelFormat *vformat); 53 static int ph_VideoInit(_THIS, SDL_PixelFormat *vformat);
53 static SDL_Surface *ph_SetVideoMode(_THIS, SDL_Surface *current, 54 static SDL_Surface *ph_SetVideoMode(_THIS, SDL_Surface *current,
101 device->SetHWAlpha = NULL; 102 device->SetHWAlpha = NULL;
102 device->LockHWSurface = ph_LockHWSurface; 103 device->LockHWSurface = ph_LockHWSurface;
103 device->UnlockHWSurface = ph_UnlockHWSurface; 104 device->UnlockHWSurface = ph_UnlockHWSurface;
104 device->FlipHWSurface = ph_FlipHWSurface; 105 device->FlipHWSurface = ph_FlipHWSurface;
105 device->FreeHWSurface = ph_FreeHWSurface; 106 device->FreeHWSurface = ph_FreeHWSurface;
106 device->SetCaption = NULL; 107 device->SetCaption = ph_SetCaption;
107 device->SetIcon = NULL; 108 device->SetIcon = NULL;
108 device->IconifyWindow = NULL; 109 device->IconifyWindow = ph_IconifyWindow;
109 device->GrabInput = NULL; 110 device->GrabInput = NULL;
110 device->GetWMInfo = NULL; 111 device->GetWMInfo = NULL;
111 device->FreeWMCursor = ph_FreeWMCursor; 112 device->FreeWMCursor = ph_FreeWMCursor;
112 device->CreateWMCursor = ph_CreateWMCursor; 113 device->CreateWMCursor = ph_CreateWMCursor;
113 device->ShowWMCursor = ph_ShowWMCursor; 114 device->ShowWMCursor = ph_ShowWMCursor;
119 device->free = ph_DeleteDevice; 120 device->free = ph_DeleteDevice;
120 121
121 return device; 122 return device;
122 } 123 }
123 124
124 VideoBootStrap X11_bootstrap = { 125 VideoBootStrap ph_bootstrap = {
125 "photon", "QNX Photon video output", 126 "photon", "QNX Photon video output",
126 ph_Available, ph_CreateDevice 127 ph_Available, ph_CreateDevice
127 }; 128 };
128 129
129 static void ph_DeleteDevice(SDL_VideoDevice *device) 130 static void ph_DeleteDevice(SDL_VideoDevice *device)
181 182
182 window=PtAppInit(NULL, NULL, NULL, 1, arg); 183 window=PtAppInit(NULL, NULL, NULL, 1, arg);
183 184
184 if(window == NULL) 185 if(window == NULL)
185 { 186 {
186 printf("PtAppInit failed\n"); 187 printf("Photon application init failed, probably Photon is not running.\n");
187 PtExit(EXIT_FAILURE); 188 exit( EXIT_FAILURE );
189 // PtExit(EXIT_FAILURE); // Got SEGFAULT.
188 } 190 }
189 191
190 //PgSetDrawBufferSize(16 *1024); 192 //PgSetDrawBufferSize(16 *1024);
191 PgSetRegion(PtWidgetRid(window)); 193 PgSetRegion(PtWidgetRid(window));
192 PgSetClipping(0,NULL); 194 PgSetClipping(0,NULL);
242 } 244 }
243 245
244 } 246 }
245 247
246 248
247 currently_fullscreen = 0; 249 currently_fullscreen = 0;
250
251 this->info.wm_available = 1;
252
248 return 0; 253 return 0;
249 } 254 }
250 255
251 static SDL_Surface *ph_SetVideoMode(_THIS, SDL_Surface *current, 256 static SDL_Surface *ph_SetVideoMode(_THIS, SDL_Surface *current,
252 int width, int height, int bpp, Uint32 flags) 257 int width, int height, int bpp, Uint32 flags)