remove test window which causes a bug in the vita sdl port to show up

This commit is contained in:
olebeck 2025-06-22 14:45:19 +02:00
parent 0e59b3847c
commit 40a34ef48e
3 changed files with 2 additions and 13 deletions

View File

@ -313,7 +313,7 @@ SDL_AppResult SDL_AppInit(void** appstate, int argc, char** argv)
PVRSRVCreateVirtualAppHint(&hint); PVRSRVCreateVirtualAppHint(&hint);
#endif #endif
if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK)) { if (!SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK | SDL_INIT_GAMEPAD)) {
char buffer[256]; char buffer[256];
SDL_snprintf( SDL_snprintf(
buffer, buffer,

View File

@ -9,6 +9,7 @@ FetchContent_Declare(
GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git" GIT_REPOSITORY "https://github.com/libsdl-org/SDL.git"
GIT_TAG "main" GIT_TAG "main"
EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL
UPDATE_DISCONNECTED TRUE
PATCH_COMMAND git apply "${SDL3_PATCH_FILE}" PATCH_COMMAND git apply "${SDL3_PATCH_FILE}"
) )

View File

@ -35,17 +35,9 @@ Direct3DRMRenderer* OpenGLES2Renderer::Create(DWORD width, DWORD height)
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
SDL_Window* window = DDWindow; SDL_Window* window = DDWindow;
bool testWindow = false;
if (!window) {
window = SDL_CreateWindow("OpenGL ES 2.0 test", width, height, SDL_WINDOW_HIDDEN | SDL_WINDOW_OPENGL);
testWindow = true;
}
SDL_GLContext context = SDL_GL_CreateContext(window); SDL_GLContext context = SDL_GL_CreateContext(window);
if (!context) { if (!context) {
if (testWindow) {
SDL_DestroyWindow(window);
}
return nullptr; return nullptr;
} }
@ -202,10 +194,6 @@ Direct3DRMRenderer* OpenGLES2Renderer::Create(DWORD width, DWORD height)
glDeleteShader(vs); glDeleteShader(vs);
glDeleteShader(fs); glDeleteShader(fs);
if (testWindow) {
SDL_DestroyWindow(window);
}
return new OpenGLES2Renderer(width, height, context, fbo, colorTex, depthRb, shaderProgram); return new OpenGLES2Renderer(width, height, context, fbo, colorTex, depthRb, shaderProgram);
} }