this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added GPU_Get/SetInitWindow() to help preserve the initializing window when a renderer fails to init and passes on to the next in the renderer order.

+26 -3
+6
SDL_gpu/GL_common/SDL_gpu_GL_common.inl
··· 752 752 753 753 SDL_Window* window = NULL; 754 754 755 + // Is there a window already set up that we are supposed to use? 755 756 if(renderer->current_context_target != NULL) 756 757 { 757 758 window = SDL_GetWindowFromID(renderer->current_context_target->context->windowID); 759 + } 760 + else 761 + { 762 + window = SDL_GetWindowFromID(GPU_GetInitWindow()); 758 763 } 759 764 760 765 if(window == NULL) ··· 770 775 return NULL; 771 776 } 772 777 778 + GPU_SetInitWindow(SDL_GetWindowID(window)); 773 779 } 774 780 775 781 #else
+14 -3
SDL_gpu/SDL_gpu.c
··· 94 94 return 1; 95 95 } 96 96 97 + static Uint32 init_windowID = 0; 98 + 99 + void GPU_SetInitWindow(Uint32 windowID) 100 + { 101 + init_windowID = windowID; 102 + } 103 + 104 + Uint32 GPU_GetInitWindow(void) 105 + { 106 + return init_windowID; 107 + } 108 + 97 109 GPU_Target* GPU_Init(Uint16 w, Uint16 h, Uint32 flags) 98 110 { 99 111 GPU_InitRendererRegister(); ··· 141 153 // Init failed, destroy the renderer... 142 154 GPU_CloseCurrentRenderer(); 143 155 } 156 + else 157 + GPU_SetInitWindow(0); 144 158 return screen; 145 159 } 146 160 ··· 202 216 current_renderer->Quit(current_renderer); 203 217 GPU_RemoveRenderer(current_renderer->id); 204 218 current_renderer = NULL; 205 - 206 - if(GPU_GetNumActiveRenderers() == 0) 207 - SDL_Quit(); 208 219 } 209 220 210 221 void GPU_Quit(void)
+6
SDL_gpu/SDL_gpu.h
··· 529 529 530 530 531 531 // Setup calls 532 + /*! The window corresponding to 'windowID' will be used to create the rendering context. */ 533 + void GPU_SetInitWindow(Uint32 windowID); 534 + 535 + /*! Returns the window ID that has been set via GPU_SetInitWindow(). */ 536 + Uint32 GPU_GetInitWindow(void); 537 + 532 538 /*! Initializes SDL and SDL_gpu. Creates a window and goes through the renderer order to create a renderer context. 533 539 * \see GPU_SetRendererOrder() 534 540 */