Index

zydeco / 3c60e1a

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
505 Aug 2023 23:143c60e1aUse GL3WJosh Stockin125G

Blob @ zydeco / include / sdl2 / WindowSDL2.hpp

text/plain792 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 // Window object info
26 SDL_Window *m_pSdlWindow;
27 SDL_Renderer *m_pSdlRenderer;
28 SDL_GLContext m_glContext;
29
30 std::string m_windowTitle;
31};
32
33
34#endif /* WINDOW_SDL2_HPP_ */
35