-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsdl2windowbackend.hpp
More file actions
39 lines (36 loc) · 1.57 KB
/
sdl2windowbackend.hpp
File metadata and controls
39 lines (36 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include <fea/config.hpp>
//#define NO_SDL_GLEXT
#include <fea/ui/windowbackend.hpp>
#include <SDL2/SDL.h>
//#include <SDL2/SDL_opengl.hpp>
#include <memory>
namespace fea
{
class FEA_API SDL2WindowBackend : public WindowBackend
{
public:
SDL2WindowBackend();
void open(VideoMode mode, const std::string& title, uint32_t style = Style::Default, const ContextSettings& settings = ContextSettings()) override; //style and settings not supported
void close() override;
bool isOpen() const override;
const ContextSettings getSettings() const override; //not supported
Vec2I getPosition() const override;
void setPosition(int32_t x, int32_t y) override;
Vec2I getSize() const override;
void setSize(int32_t w, int32_t h) override;
void setTitle(const std::string& title) override;
void setIcon(uint32_t width, uint32_t height, const uint8_t* pixels) override;
void setVisible(bool visible) override; //not supported
void setVSyncEnabled(bool enabled) override;
void setMouseCursorVisible(bool visible) override; //not supported
void setFramerateLimit(uint32_t limit) override; //not supported
bool setRenderingActive(bool active = true) const override; //not supported
void swapBuffers() override;
void lockCursor(bool lock) override;
~SDL2WindowBackend();
private:
SDL_Window* mWindow;
SDL_GLContext mGlContext;
};
}