From 0385dd4b014baa36d830e469976a83c51d030798 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Tue, 19 Dec 2017 14:46:40 +0100 Subject: [PATCH] added (disabled) SDL renderer information code --- src/common/FrameBufferSDL2.cxx | 40 ++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/common/FrameBufferSDL2.cxx b/src/common/FrameBufferSDL2.cxx index 64f93945d..be1cd5563 100644 --- a/src/common/FrameBufferSDL2.cxx +++ b/src/common/FrameBufferSDL2.cxx @@ -84,6 +84,46 @@ void FrameBufferSDL2::queryHardware(vector& displays, displays.emplace_back(display.w, display.h); } +#if 0 + struct RenderName + { + string sdlName; + string stellaName; + }; + // create name map for all currently known SDL renderers + const int NUM_RENDERES = 5; + static const RenderName RENDERER_NAMES[NUM_RENDERES] = + { + {"direct3d", "Direct3D"}, + {"opengl", "OpenGL"}, + {"opengles", "OpenGLES"}, + {"opengles2", "OpenGLES2"}, + {"software", "Software"} + }; + + int numDrivers = SDL_GetNumRenderDrivers(); + for(int i = 0; i < numDrivers; ++i) + { + SDL_RendererInfo info; + if(SDL_GetRenderDriverInfo(i, &info) == 0) + { + // map SDL names into nicer Stella names + bool found = false; + for(int j = 0; j < NUM_RENDERES; ++j) + { + if(RENDERER_NAMES[j].sdlName == info.name) + { + VarList::push_back(renderers, RENDERER_NAMES[j].stellaName, info.name); + found = true; + break; + } + } + if (!found) + VarList::push_back(renderers, info.name, info.name); + } + } +#endif + // For now, supported render types are hardcoded; eventually, SDL may // provide a method to query this #if defined(BSPF_WINDOWS)