mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-12 05:41:10 +01:00
Fixed creating a renderer on the dummy driver on Mac OS X
This commit is contained in:
parent
cb5a0b0f6a
commit
6211668e9f
@ -288,6 +288,7 @@ struct SDL_VideoDevice
|
|||||||
|
|
||||||
/* * * */
|
/* * * */
|
||||||
/* Data common to all drivers */
|
/* Data common to all drivers */
|
||||||
|
SDL_bool is_dummy;
|
||||||
SDL_bool suspend_screensaver;
|
SDL_bool suspend_screensaver;
|
||||||
int num_displays;
|
int num_displays;
|
||||||
SDL_VideoDisplay *displays;
|
SDL_VideoDisplay *displays;
|
||||||
|
@ -172,6 +172,11 @@ ShouldUseTextureFramebuffer()
|
|||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If this is the dummy driver there is no texture support */
|
||||||
|
if (_this->is_dummy) {
|
||||||
|
return SDL_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* If the user has specified a software renderer we can't use a
|
/* If the user has specified a software renderer we can't use a
|
||||||
texture framebuffer, or renderer creation will go recursive.
|
texture framebuffer, or renderer creation will go recursive.
|
||||||
*/
|
*/
|
||||||
@ -1175,7 +1180,7 @@ SDL_UpdateFullscreenMode(SDL_Window * window, SDL_bool fullscreen)
|
|||||||
if (window->is_destroying && (window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP)
|
if (window->is_destroying && (window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (SDL_strcmp(_this->name, "dummy") != 0) {
|
if (!_this->is_dummy) {
|
||||||
/* If we're switching between a fullscreen Space and "normal" fullscreen, we need to get back to normal first. */
|
/* If we're switching between a fullscreen Space and "normal" fullscreen, we need to get back to normal first. */
|
||||||
if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN)) {
|
if (fullscreen && ((window->last_fullscreen_flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN_DESKTOP) && ((window->flags & FULLSCREEN_MASK) == SDL_WINDOW_FULLSCREEN)) {
|
||||||
if (!Cocoa_SetWindowFullscreenSpace(window, SDL_FALSE)) {
|
if (!Cocoa_SetWindowFullscreenSpace(window, SDL_FALSE)) {
|
||||||
@ -1369,7 +1374,7 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
|
|||||||
|
|
||||||
/* Some platforms have OpenGL enabled by default */
|
/* Some platforms have OpenGL enabled by default */
|
||||||
#if (SDL_VIDEO_OPENGL && __MACOSX__) || __IPHONEOS__ || __ANDROID__ || __NACL__
|
#if (SDL_VIDEO_OPENGL && __MACOSX__) || __IPHONEOS__ || __ANDROID__ || __NACL__
|
||||||
if (SDL_strcmp(_this->name, "dummy") != 0) {
|
if (!_this->is_dummy) {
|
||||||
flags |= SDL_WINDOW_OPENGL;
|
flags |= SDL_WINDOW_OPENGL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -84,6 +84,7 @@ DUMMY_CreateDevice(int devindex)
|
|||||||
SDL_OutOfMemory();
|
SDL_OutOfMemory();
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
device->is_dummy = SDL_TRUE;
|
||||||
|
|
||||||
/* Set the function pointers */
|
/* Set the function pointers */
|
||||||
device->VideoInit = DUMMY_VideoInit;
|
device->VideoInit = DUMMY_VideoInit;
|
||||||
|
Loading…
Reference in New Issue
Block a user