Introduce Math.hpp and use typedef to make replacing glm with something else in the future simpler

This commit is contained in:
2020-10-27 23:25:26 +01:00
parent c219fc3778
commit 78d24fbe41
16 changed files with 268 additions and 181 deletions

View File

@@ -25,68 +25,8 @@ namespace openVulkanoCpp
return windowConfig;
}
void GetSize(int* width, int* height) override = 0;
void GetSize(uint32_t* width, uint32_t* height) override
{
int w, h;
GetSize(&w, &h);
*width = w;
*height = h;
}
uint32_t GetWidth() override
{
uint32_t width, height;
GetSize(&width, &height);
return width;
}
uint32_t GetHeight() override
{
uint32_t width, height;
GetSize(&width, &height);
return height;
}
glm::ivec2 GetSize() override
{
glm::ivec2 size;
this->GetSize(&size.x, &size.y);
return size;
}
void SetSize(uint32_t width, uint32_t height) override = 0;
void SetSize(glm::ivec2 size) override
{
SetSize(size.x, size.y);
}
void GetPosition(int* x, int* y) override = 0;
int GetPositionX() override
{
int x, y;
GetPosition(&x, &y);
return x;
}
int GetPositionY() override
{
int x, y;
GetPosition(&x, &y);
return y;
}
glm::ivec2 GetPosition() override
{
glm::ivec2 position;
GetPosition(&position.x, &position.y);
return position;
}
bool HasTitle() override
{
return WindowMode::WINDOWED == GetWindowMode();
@@ -104,8 +44,6 @@ namespace openVulkanoCpp
void SetPosition(int posX, int posY) override = 0;
void SetPosition(glm::ivec2 pos) override { SetPosition(pos.x, pos.y); }
void Show() override = 0;
void Hide() override = 0;