Mercurial > sdl-ios-xcode
comparison src/video/SDL_video.c @ 58:bd6b0a910a65
* Removed fullscreen menu option from the "Window" menu
* Updated the BUGS file
* Fixed command line parameters when launched from Finder
* Implemented setting the icon window caption
* Implemented frameless style windows
* Added note about SDL_RESIZABLE implementation to SDL_QuartzVideo.m
* Window close requests now go through the event filtering system
author | Sam Lantinga <slouken@lokigames.com> |
---|---|
date | Mon, 11 Jun 2001 06:44:43 +0000 |
parents | 45b1c4303f87 |
children | b0ae59d0f3ee |
comparison
equal
deleted
inserted
replaced
57:ec550054db3b | 58:bd6b0a910a65 |
---|---|
97 &ph_bootstrap, | 97 &ph_bootstrap, |
98 #endif | 98 #endif |
99 NULL | 99 NULL |
100 }; | 100 }; |
101 SDL_VideoDevice *current_video = NULL; | 101 SDL_VideoDevice *current_video = NULL; |
102 | |
103 /* Places to store title and icon text for the app */ | |
104 static char *wm_title = NULL; | |
105 static char *wm_icon = NULL; | |
106 | 102 |
107 /* Various local functions */ | 103 /* Various local functions */ |
108 int SDL_VideoInit(const char *driver_name, Uint32 flags); | 104 int SDL_VideoInit(const char *driver_name, Uint32 flags); |
109 void SDL_VideoQuit(void); | 105 void SDL_VideoQuit(void); |
110 void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect* rects); | 106 void SDL_GL_UpdateRectsLock(SDL_VideoDevice* this, int numrects, SDL_Rect* rects); |
1252 } | 1248 } |
1253 if ( video->gamma ) { | 1249 if ( video->gamma ) { |
1254 free(video->gamma); | 1250 free(video->gamma); |
1255 video->gamma = NULL; | 1251 video->gamma = NULL; |
1256 } | 1252 } |
1257 if ( wm_title != NULL ) { | 1253 if ( video->wm_title != NULL ) { |
1258 free(wm_title); | 1254 free(video->wm_title); |
1259 wm_title = NULL; | 1255 video->wm_title = NULL; |
1260 } | 1256 } |
1261 if ( wm_icon != NULL ) { | 1257 if ( video->wm_icon != NULL ) { |
1262 free(wm_icon); | 1258 free(video->wm_icon); |
1263 wm_icon = NULL; | 1259 video->wm_icon = NULL; |
1264 } | 1260 } |
1265 | 1261 |
1266 /* Finish cleaning up video subsystem */ | 1262 /* Finish cleaning up video subsystem */ |
1267 video->free(this); | 1263 video->free(this); |
1268 current_video = NULL; | 1264 current_video = NULL; |
1537 void SDL_WM_SetCaption (const char *title, const char *icon) | 1533 void SDL_WM_SetCaption (const char *title, const char *icon) |
1538 { | 1534 { |
1539 SDL_VideoDevice *video = current_video; | 1535 SDL_VideoDevice *video = current_video; |
1540 SDL_VideoDevice *this = current_video; | 1536 SDL_VideoDevice *this = current_video; |
1541 | 1537 |
1542 if ( title ) { | 1538 if ( video ) { |
1543 if ( wm_title ) { | 1539 if ( title ) { |
1544 free(wm_title); | 1540 if ( video->wm_title ) { |
1545 } | 1541 free(video->wm_title); |
1546 wm_title = (char *)malloc(strlen(title)+1); | 1542 } |
1547 if ( wm_title != NULL ) { | 1543 video->wm_title = (char *)malloc(strlen(title)+1); |
1548 strcpy(wm_title, title); | 1544 if ( video->wm_title != NULL ) { |
1549 } | 1545 strcpy(video->wm_title, title); |
1550 } | 1546 } |
1551 if ( icon ) { | 1547 } |
1552 if ( wm_icon ) { | 1548 if ( icon ) { |
1553 free(wm_icon); | 1549 if ( video->wm_icon ) { |
1554 } | 1550 free(video->wm_icon); |
1555 wm_icon = (char *)malloc(strlen(icon)+1); | 1551 } |
1556 if ( wm_icon != NULL ) { | 1552 video->wm_icon = (char *)malloc(strlen(icon)+1); |
1557 strcpy(wm_icon, icon); | 1553 if ( video->wm_icon != NULL ) { |
1558 } | 1554 strcpy(video->wm_icon, icon); |
1559 } | 1555 } |
1560 if ( (title || icon) && video && (video->SetCaption != NULL) ) { | 1556 } |
1561 video->SetCaption(this, wm_title, wm_icon); | 1557 if ( (title || icon) && (video->SetCaption != NULL) ) { |
1558 video->SetCaption(this, video->wm_title,video->wm_icon); | |
1559 } | |
1562 } | 1560 } |
1563 } | 1561 } |
1564 void SDL_WM_GetCaption (char **title, char **icon) | 1562 void SDL_WM_GetCaption (char **title, char **icon) |
1565 { | 1563 { |
1566 if ( title ) { | 1564 SDL_VideoDevice *video = current_video; |
1567 *title = wm_title; | 1565 |
1568 } | 1566 if ( video ) { |
1569 if ( icon ) { | 1567 if ( title ) { |
1570 *icon = wm_icon; | 1568 *title = video->wm_title; |
1569 } | |
1570 if ( icon ) { | |
1571 *icon = video->wm_icon; | |
1572 } | |
1571 } | 1573 } |
1572 } | 1574 } |
1573 | 1575 |
1574 /* Utility function used by SDL_WM_SetIcon() */ | 1576 /* Utility function used by SDL_WM_SetIcon() */ |
1575 static void CreateMaskFromColorKey(SDL_Surface *icon, Uint8 *mask) | 1577 static void CreateMaskFromColorKey(SDL_Surface *icon, Uint8 *mask) |