mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 08:42:45 +03:00
* chore(build): add vendored SDL 3.0.0 library * chore(build): add vendored glew-cmake-2.2.0 library * feat(console): in the presence of -opengl launch flag, change GxApi to OpenGl * feat(gx): add uncompleted CGxDeviceGLSDL targeting Windows and Linux * chore(build): change SDL3 linkage from shared (bad) to to static (good)
45 lines
932 B
C++
45 lines
932 B
C++
#ifndef GX_GL_SDL_GL_SDL_WINDOW_HPP
|
|
#define GX_GL_SDL_GL_SDL_WINDOW_HPP
|
|
|
|
#include <cstdint>
|
|
#include <SDL3/SDL.h>
|
|
|
|
#include "gx/glsdl/GLTypes.hpp"
|
|
|
|
class GLSDLWindowRect {
|
|
public:
|
|
struct Point {
|
|
int32_t x = 0;
|
|
int32_t y = 0;
|
|
};
|
|
|
|
struct Size {
|
|
int32_t width = 0;
|
|
int32_t height = 0;
|
|
};
|
|
|
|
Point origin;
|
|
Size size;
|
|
};
|
|
|
|
class GLSDLWindow {
|
|
public:
|
|
SDL_Window* m_sdlWindow = nullptr;
|
|
|
|
// Create an SDL window with the requested OpenGL attributes
|
|
void Create(const char* title, const GLSDLWindowRect& rect, GLTextureFormat depthFormat, uint32_t sampleCount);
|
|
void Destroy();
|
|
void Swap();
|
|
void Resize(const GLSDLWindowRect& rect);
|
|
|
|
GLSDLWindowRect GetRect();
|
|
GLSDLWindowRect GetBackingRect();
|
|
|
|
int32_t GetWidth();
|
|
int32_t GetHeight();
|
|
|
|
|
|
};
|
|
|
|
#endif
|