From 3a0715575607bfd07f1cc34f58ff64486420283f Mon Sep 17 00:00:00 2001 From: Tim Blume Date: Wed, 9 Mar 2022 01:01:07 +0100 Subject: [PATCH] end foo --- .gitignore | 1 + game/game_window.hpp | 2 -- game/opengl.cpp | 8 ++++++++ game/renderer_polygon_3d/polygon_model.cpp | 5 ++--- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 1c4ab77..9208d91 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ tests/tests *.swp *.core vgcore* +.cache diff --git a/game/game_window.hpp b/game/game_window.hpp index daf06ae..0ecf84a 100644 --- a/game/game_window.hpp +++ b/game/game_window.hpp @@ -51,8 +51,6 @@ class GameWindow : public endofthejedi::GLWindow { void resize() override { - //std::cout<<"resize()" << std::endl; - glViewport(0, 0, getwidth(), getheight()); // resize the game diff --git a/game/opengl.cpp b/game/opengl.cpp index a64cb36..8fc8a6b 100644 --- a/game/opengl.cpp +++ b/game/opengl.cpp @@ -99,7 +99,15 @@ namespace endofthejedi { m_width = attribs.width; m_height = attribs.height; resize(); + } else if (event.type == ConfigureNotify) { + XConfigureEvent xce = event.xconfigure; + if ((unsigned int)xce.width != m_width|| + (unsigned int)xce.height != m_height) { + m_width = xce.width; + m_height = xce.height; + resize(); + } } else if (event.type == ClientMessage) { if (event.xclient.data.l[0] == (int) m_atomWmDeleteWindow) { stop(); diff --git a/game/renderer_polygon_3d/polygon_model.cpp b/game/renderer_polygon_3d/polygon_model.cpp index de2895f..3d6d1fb 100644 --- a/game/renderer_polygon_3d/polygon_model.cpp +++ b/game/renderer_polygon_3d/polygon_model.cpp @@ -1,6 +1,7 @@ #include "polygon_model.hpp" #include +#include namespace endofthejedi { PolygonModel::PolygonModel(const std::string &filename) @@ -99,9 +100,7 @@ namespace endofthejedi { return false; } - aiNode *node = scene->mRootNode; - const aiMesh* mesh = scene->mMeshes[node->mMeshes[0]]; - + const aiMesh* mesh = scene->mMeshes[0]; // 3 vertices per face, 3 floats per vertex m_numVertices = mesh->mNumFaces*3;