diff options
author | Joursoir <chat@joursoir.net> | 2021-04-06 08:18:16 +0000 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2021-04-06 08:18:16 +0000 |
commit | e72ef2c3a6f46e5ddc7324b1fe55fb15fec5c5f7 (patch) | |
tree | 2ec7231d96959c2cc8e22a355f12f2879bf79ffc /src/application | |
parent | f111b7f74024ba6d47c0d802185406aa9eacfa50 (diff) | |
download | space-simulator-e72ef2c3a6f46e5ddc7324b1fe55fb15fec5c5f7.tar.gz space-simulator-e72ef2c3a6f46e5ddc7324b1fe55fb15fec5c5f7.tar.bz2 space-simulator-e72ef2c3a6f46e5ddc7324b1fe55fb15fec5c5f7.zip |
add wrapper for window library
Diffstat (limited to 'src/application')
-rw-r--r-- | src/application/Application.cpp | 23 | ||||
-rw-r--r-- | src/application/Application.hpp | 13 |
2 files changed, 36 insertions, 0 deletions
diff --git a/src/application/Application.cpp b/src/application/Application.cpp new file mode 100644 index 0000000..ce7c9d8 --- /dev/null +++ b/src/application/Application.cpp @@ -0,0 +1,23 @@ +#include <GLFW/glfw3.h> + +#include "Application.hpp" + +int Application::Init() +{ + return glfwInit() == GLFW_TRUE ? 0 : 1; +} + +void Application::Terminate() +{ + glfwTerminate(); +} + +void Application::SwapInterval(int interval) +{ + glfwSwapInterval(interval); +} + +GLfloat Application::GetTime() +{ + return glfwGetTime(); +} diff --git a/src/application/Application.hpp b/src/application/Application.hpp new file mode 100644 index 0000000..0c0c539 --- /dev/null +++ b/src/application/Application.hpp @@ -0,0 +1,13 @@ +#ifndef ENGINE_APPLICATION_H +#define ENGINE_APPLICATION_H + +class Application { + Application() { } +public: + static int Init(); + static void Terminate(); + static void SwapInterval(int interval); + static float GetTime(); +}; + +#endif /* ENGINE_APPLICATION_H */ |