Index

zydeco / 0dd781a

Experiment in graphics programming, C++, OpenGL, simulation techniques.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
405 Aug 2023 20:500dd781aCreate event handling and threads structureJosh Stockin1370G

Blob @ zydeco / include / sdl2 / WindowSDL2.hpp

text/plain888 bytesdownload raw
1#ifndef WINDOW_SDL2_HPP_
2#define WINDOW_SDL2_HPP_
3
4
5#include "IWindow.hpp"
6#include <cstdint>
7#include <string>
8#include <SDL2/SDL.h>
9
10class WindowSDL2 : public IWindow
11{
12public:
13 WindowSDL2(std::string title, uint64_t window_config_flags);
14 ~WindowSDL2();
15
16 bool Update(uint64_t time_since_last_update_us) override;
17
18 // Basic public interface
19 void SetTitle(std::string new_title) override;
20 void SetFullscreen(bool is_fullscreen) override;
21 void SetSize(uint64_t new_width, uint64_t new_height) override;
22 void SetPosition(uint64_t new_x, uint64_t new_y) override;
23
24protected:
25 // One-time SDL_Init()
26 static bool s_sdlInitialized;
27 static void _SdlInitialize();
28
29 // Window object info
30 SDL_Window *m_pSdlWindow;
31 SDL_Renderer *m_pSdlRenderer;
32 SDL_GLContext m_pGlContext;
33 std::string m_windowTitle;
34};
35
36
37#endif /* WINDOW_SDL2_HPP_ */
38