|
|
@ -104,13 +104,6 @@ std::vector<unsigned int> indices({ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Window for the game
|
|
|
|
// Window for the game
|
|
|
|
Window win("Euclid Engine: Demo"); |
|
|
|
|
|
|
|
Renderer::Scene scene(&win); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void framebuffer_size_callback(GLFWwindow* glfwWindow, int w, int h) { |
|
|
|
|
|
|
|
win.updateSize(w, h); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void processInput(GLFWwindow *win) { |
|
|
|
void processInput(GLFWwindow *win) { |
|
|
|
int action = glfwGetKey(win, GLFW_KEY_ESCAPE); |
|
|
|
int action = glfwGetKey(win, GLFW_KEY_ESCAPE); |
|
|
|
if (action == GLFW_PRESS) { |
|
|
|
if (action == GLFW_PRESS) { |
|
|
@ -120,6 +113,9 @@ void processInput(GLFWwindow *win) { |
|
|
|
|
|
|
|
|
|
|
|
int main() { |
|
|
|
int main() { |
|
|
|
// Spawn window
|
|
|
|
// Spawn window
|
|
|
|
|
|
|
|
Window win("Euclid Engine: Demo"); |
|
|
|
|
|
|
|
Renderer::Scene scene(&win); |
|
|
|
|
|
|
|
|
|
|
|
win.spawn(); |
|
|
|
win.spawn(); |
|
|
|
|
|
|
|
|
|
|
|
if ( !gladLoadGLLoader((GLADloadproc)glfwGetProcAddress) ) { |
|
|
|
if ( !gladLoadGLLoader((GLADloadproc)glfwGetProcAddress) ) { |
|
|
@ -127,8 +123,8 @@ int main() { |
|
|
|
return 1; |
|
|
|
return 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
glViewport(0, 0, win.getWidth(), win.getHeight()); |
|
|
|
// glViewport(0, 0, win.getWidth(), win.getHeight());
|
|
|
|
glfwSetFramebufferSizeCallback(win.getWindow(), framebuffer_size_callback); // Framebuffer
|
|
|
|
// glfwSetFramebufferSizeCallback(win.getWindow(), framebuffer_size_callback); // Framebuffer
|
|
|
|
|
|
|
|
|
|
|
|
glEnable(GL_DEPTH_TEST); |
|
|
|
glEnable(GL_DEPTH_TEST); |
|
|
|
|
|
|
|
|
|
|
|