This commit is contained in:
Tim Blume 2022-03-09 01:01:07 +01:00
parent e1a41a526d
commit 3a07155756
4 changed files with 11 additions and 5 deletions

1
.gitignore vendored
View file

@ -11,3 +11,4 @@ tests/tests
*.swp *.swp
*.core *.core
vgcore* vgcore*
.cache

View file

@ -51,8 +51,6 @@ class GameWindow : public endofthejedi::GLWindow {
void resize() override void resize() override
{ {
//std::cout<<"resize()" << std::endl;
glViewport(0, 0, getwidth(), getheight()); glViewport(0, 0, getwidth(), getheight());
// resize the game // resize the game

View file

@ -99,7 +99,15 @@ namespace endofthejedi {
m_width = attribs.width; m_width = attribs.width;
m_height = attribs.height; m_height = attribs.height;
resize(); 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) { } else if (event.type == ClientMessage) {
if (event.xclient.data.l[0] == (int) m_atomWmDeleteWindow) { if (event.xclient.data.l[0] == (int) m_atomWmDeleteWindow) {
stop(); stop();

View file

@ -1,6 +1,7 @@
#include "polygon_model.hpp" #include "polygon_model.hpp"
#include <iostream> #include <iostream>
#include <ostream>
namespace endofthejedi { namespace endofthejedi {
PolygonModel::PolygonModel(const std::string &filename) PolygonModel::PolygonModel(const std::string &filename)
@ -99,9 +100,7 @@ namespace endofthejedi {
return false; return false;
} }
aiNode *node = scene->mRootNode; const aiMesh* mesh = scene->mMeshes[0];
const aiMesh* mesh = scene->mMeshes[node->mMeshes[0]];
// 3 vertices per face, 3 floats per vertex // 3 vertices per face, 3 floats per vertex
m_numVertices = mesh->mNumFaces*3; m_numVertices = mesh->mNumFaces*3;