mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
84 lines
3 KiB
Diff
84 lines
3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: "jake.westrip" <jake.westrip@lonsec.com.au>
|
|
Date: Tue, 27 Apr 2021 18:34:53 +1000
|
|
Subject: [PATCH] Remove OpenGL
|
|
|
|
---
|
|
src/ppui/sdl/DisplayDevice_SDL.cpp | 42 ++----------------------------
|
|
1 file changed, 2 insertions(+), 40 deletions(-)
|
|
|
|
diff --git a/src/ppui/sdl/DisplayDevice_SDL.cpp b/src/ppui/sdl/DisplayDevice_SDL.cpp
|
|
index a4b966c..7ecedc7 100644
|
|
--- a/src/ppui/sdl/DisplayDevice_SDL.cpp
|
|
+++ b/src/ppui/sdl/DisplayDevice_SDL.cpp
|
|
@@ -26,30 +26,8 @@
|
|
SDL_Window* PPDisplayDevice::CreateWindow(pp_int32& w, pp_int32& h, pp_int32& bpp, Uint32 flags)
|
|
{
|
|
size_t namelen = 0;
|
|
- char rendername[256] = { 0 };
|
|
- PFNGLGETSTRINGPROC glGetStringAPI = NULL;
|
|
-
|
|
- for (int it = 0; it < SDL_GetNumRenderDrivers(); it++)
|
|
- {
|
|
- SDL_RendererInfo info;
|
|
- SDL_GetRenderDriverInfo(it, &info);
|
|
-
|
|
- namelen += strlen(info.name) + 1;
|
|
- strncat(rendername, info.name, sizeof(rendername) - namelen);
|
|
- strncat(rendername, " ", sizeof(rendername) - namelen);
|
|
-
|
|
- if (strncmp("opengles2", info.name, 9) == 0)
|
|
- {
|
|
- drv_index = it;
|
|
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
|
|
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
|
|
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
|
|
- SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1);
|
|
- }
|
|
- }
|
|
-
|
|
// Create SDL window
|
|
- SDL_Window* theWindow = SDL_CreateWindow("MilkyTracker", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, SDL_WINDOW_OPENGL | flags);
|
|
+ SDL_Window* theWindow = SDL_CreateWindow("MilkyTracker", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, flags);
|
|
|
|
if (theWindow == NULL)
|
|
{
|
|
@@ -59,7 +37,7 @@ SDL_Window* PPDisplayDevice::CreateWindow(pp_int32& w, pp_int32& h, pp_int32& bp
|
|
w = getDefaultWidth();
|
|
h = getDefaultHeight();
|
|
|
|
- theWindow = SDL_CreateWindow("MilkyTracker", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, SDL_WINDOW_OPENGL | flags);
|
|
+ theWindow = SDL_CreateWindow("MilkyTracker", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, flags);
|
|
|
|
if (theWindow == NULL)
|
|
{
|
|
@@ -69,21 +47,6 @@ SDL_Window* PPDisplayDevice::CreateWindow(pp_int32& w, pp_int32& h, pp_int32& bp
|
|
}
|
|
}
|
|
|
|
- SDL_GLContext ctx = SDL_GL_CreateContext(theWindow);
|
|
- SDL_GL_MakeCurrent(theWindow, ctx);
|
|
-
|
|
- glGetStringAPI = (PFNGLGETSTRINGPROC)SDL_GL_GetProcAddress("glGetString");
|
|
-
|
|
- fprintf(stdout, "Available Renderers: %s\n", rendername);
|
|
- if (glGetStringAPI)
|
|
- {
|
|
- fprintf(stdout, "Vendor : %s\n", glGetStringAPI(GL_VENDOR));
|
|
- fprintf(stdout, "Renderer : %s\n", glGetStringAPI(GL_RENDERER));
|
|
- fprintf(stdout, "Version : %s\n", glGetStringAPI(GL_VERSION));
|
|
-#ifdef DEBUG
|
|
- fprintf(stdout, "Extensions : %s\n", glGetStringAPI(GL_EXTENSIONS));
|
|
-#endif
|
|
- }
|
|
// Prevent window from being resized below minimum
|
|
SDL_SetWindowMinimumSize(theWindow, w, h);
|
|
fprintf(stderr, "SDL: Minimum window size set to %dx%d.\n", w, h);
|
|
@@ -105,7 +68,6 @@ PPDisplayDevice::PPDisplayDevice(pp_int32 width,
|
|
|
|
bFullScreen = fullScreen;
|
|
|
|
- drv_index = -1;
|
|
|
|
initMousePointers();
|
|
}
|