the gui problem^TM
This commit is contained in:
@@ -1 +1,13 @@
|
||||
#include "Window.h"
|
||||
|
||||
namespace Archimedes {
|
||||
|
||||
void Window::doFrame() {
|
||||
window.getSize(renderer.w, renderer.h);
|
||||
|
||||
renderer.render();
|
||||
|
||||
window.doFrame();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "Archimedes.h"
|
||||
#include "Renderer/Renderer.h"
|
||||
#include "GLFW/WindowGLFW.h"
|
||||
#include "WindowGLFW/WindowGLFW.h"
|
||||
|
||||
namespace Archimedes {
|
||||
|
||||
@@ -10,13 +10,16 @@ namespace Archimedes {
|
||||
|
||||
~Window() {};
|
||||
|
||||
bool shouldClose();
|
||||
bool shouldClose() { return window.shouldClose(); }
|
||||
|
||||
void doFrame();
|
||||
|
||||
Renderer& getRenderer() { return renderer; }
|
||||
WindowImpl& getWindowImpl() { return window; }
|
||||
|
||||
private:
|
||||
Renderer renderer;
|
||||
|
||||
WindowImpl w;
|
||||
WindowImpl window;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace Archimedes {
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(w);
|
||||
glfwSwapInterval(1);
|
||||
}
|
||||
|
||||
bool WindowGLFW::shouldClose() {
|
||||
@@ -26,9 +27,8 @@ namespace Archimedes {
|
||||
}
|
||||
|
||||
void WindowGLFW::doFrame() {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glfwSwapBuffers(w);
|
||||
glfwPollEvents();
|
||||
glfwSwapBuffers(w);
|
||||
}
|
||||
|
||||
WindowGLFW::~WindowGLFW() {
|
||||
@@ -15,6 +15,10 @@ namespace Archimedes {
|
||||
|
||||
void doFrame();
|
||||
|
||||
void getSize(int&, int&);
|
||||
|
||||
auto getWindow() { return w; }
|
||||
|
||||
private:
|
||||
GLFWwindow* w;
|
||||
};
|
||||
Reference in New Issue
Block a user