2 #ifndef GRAMODS_GRAPHICS_SDLWINDOW
3 #define GRAMODS_GRAPHICS_SDLWINDOW
5 #include <gmCore/SdlContext.hh>
7 #ifdef gramods_ENABLE_SDL2
9 #include <gmGraphics/Window.hh>
11 BEGIN_NAMESPACE_GMGRAPHICS;
24 void initialize()
override;
30 void makeGLContextCurrent()
override;
41 void close()
override;
82 void setContext(std::shared_ptr<gmCore::SdlContext> ctx) { context = ctx; }
88 void processEvents()
override;
94 bool isOpen()
override;
100 void swap()
override;
107 void traverse(Visitor *visitor)
override;
113 bool processEvent(SDL_Event& event);
117 SDL_GLContext gl_context;
118 static std::map<unsigned int, std::weak_ptr<SdlWindow>> sdl_windows;
120 bool gl_use_quad_buffers =
false;
123 std::string gl_profile;
125 std::shared_ptr<gmCore::SdlContext> context;
128 END_NAMESPACE_GMGRAPHICS;
An SDL window implementation.
Definition: SdlWindow.hh:17
void setUseQuadBuffers(bool on)
Sets if quad buffers should be requested for the GL context.
Definition: SdlWindow.hh:48
void setContext(std::shared_ptr< gmCore::SdlContext > ctx)
The SDL context.
Definition: SdlWindow.hh:82
void setGLMajor(int v)
Sets the major version to be requested for the GL context in this Window.
Definition: SdlWindow.hh:56
void setGLMinor(int v)
Sets the minor version to be requested for the GL context in this Window.
Definition: SdlWindow.hh:64
void setGLProfile(std::string s)
Sets the profile to be requested for the GL context in this Window.
Definition: SdlWindow.hh:72
The base of graphics Window implementations.
Definition: Window.hh:21
std::array< size_t, 2 > size2
Array of 2 size_t.
Definition: io_size.hh:9