move test guis to GUImodules and separate utils from modules
This commit is contained in:
3
utils/Renderer/Renderer.h
Normal file
3
utils/Renderer/Renderer.h
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
class Renderer {};
|
||||
0
utils/Renderer/RendererOpenGL/RendererOpenGL.cpp
Normal file
0
utils/Renderer/RendererOpenGL/RendererOpenGL.cpp
Normal file
0
utils/Renderer/RendererOpenGL/RendererOpenGL.h
Normal file
0
utils/Renderer/RendererOpenGL/RendererOpenGL.h
Normal file
36
utils/Window/GLFW/windowGLFW.cpp
Normal file
36
utils/Window/GLFW/windowGLFW.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "Archimedes.h"
|
||||
#include "windowGLFW.h"
|
||||
|
||||
|
||||
Window::Window() {
|
||||
|
||||
glfwSetErrorCallback([](int e, const char* m){
|
||||
std::cout << "GLFW Error: " << m << std::endl;
|
||||
});
|
||||
if(!glfwInit()) {
|
||||
std::cout << "glfwInit failed!\n";
|
||||
std::abort();
|
||||
}
|
||||
w = glfwCreateWindow(640, 480, "Archimedes", NULL, NULL);
|
||||
|
||||
if(!w) {
|
||||
glfwTerminate();
|
||||
std::abort();
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(w);
|
||||
}
|
||||
|
||||
bool Window::shouldClose() {
|
||||
return glfwWindowShouldClose(w);
|
||||
}
|
||||
|
||||
void Window::doFrame() {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glfwSwapBuffers(w);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
Window::~Window() {
|
||||
glfwTerminate();
|
||||
}
|
||||
20
utils/Window/GLFW/windowGLFW.h
Normal file
20
utils/Window/GLFW/windowGLFW.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "Window/Window.h"
|
||||
|
||||
#define GLEW_STATIC
|
||||
#include <GL/glew.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
class WindowGLFW : public Window {
|
||||
|
||||
public:
|
||||
|
||||
Window();
|
||||
~Window();
|
||||
|
||||
bool shouldClose();
|
||||
|
||||
void doFrame();
|
||||
|
||||
private:
|
||||
GLFWwindow* w;
|
||||
};
|
||||
13
utils/Window/Window.h
Normal file
13
utils/Window/Window.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "Archimedes.h"
|
||||
|
||||
class Window {
|
||||
|
||||
public:
|
||||
|
||||
virtual ~Window() {};
|
||||
|
||||
virtual bool shouldClose() = 0;
|
||||
|
||||
virtual void doFrame() = 0;
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user