Index

zydeco / 1467546

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
803 Sep 2023 23:177457fbaImGui bringupJosh Stockin112G

Blob @ zydeco / include / sdl2 / WindowSDL2.hpp

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