#include "sdl_main_window.hpp" #include namespace bookmouse { SdlMainWindow::SdlMainWindow(const SdlContext& sdlContext) { sdlContext.setAttribute(SDL_GL_DOUBLEBUFFER, 1); sdlContext.setAttribute(SDL_GL_DEPTH_SIZE, 24); sdlContext.setAttribute(SDL_GL_STENCIL_SIZE, 8); SDL_WindowFlags window_flags = (SDL_WindowFlags)(SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); m_window = SDL_CreateWindow( "Dear ImGui SDL2+OpenGL3 example", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280, 720, window_flags); if (m_window == nullptr) { const auto* lastError = SDL_GetError(); throw std::runtime_error{lastError}; } } SdlMainWindow::~SdlMainWindow() { SDL_DestroyWindow(m_window); } } // namespace bookmouse