diff --git a/SQCSim2021/engine.cpp b/SQCSim2021/engine.cpp index 8eb7a25..aa59055 100644 --- a/SQCSim2021/engine.cpp +++ b/SQCSim2021/engine.cpp @@ -25,8 +25,8 @@ void Engine::Init() // Light GLfloat light0Pos[4] = { 0.0f, CHUNK_SIZE_Y, 0.0f, 1.0f }; - GLfloat light0Amb[4] = { 0.9f, 0.9f, 0.9f, 1.0f }; - GLfloat light0Diff[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; + GLfloat light0Amb[4] = { 0.9f, 0.9f, 0.9f, 1.f }; + GLfloat light0Diff[4] = { 1.f, 1.f, 1.f, 1.f }; GLfloat light0Spec[4] = { 0.2f, 0.2f, 0.2f, 1.0f }; glEnable(GL_LIGHT0); @@ -68,21 +68,21 @@ void Engine::Render(float elapsedTime) m_player.Move(m_keyW, m_keyS, m_keyA, m_keyD, elapsedTime); m_player.ApplyTransformation(all); - m_player.ApplyTransformation(skybox, false); - skybox.Use(); + m_player.ApplyTransformation(skybox, false); // Version d'ApplyTransformation qui ne tient compte que de la rotation (donc l'objet bouge relativement au joueur). // Skybox + skybox.Use(); m_textureSkybox.Bind(); glDisable(GL_DEPTH_TEST); glBegin(GL_QUADS); - glTexCoord2f(1, 0); - glVertex3f(10.f, 10.f, 10.f); - glTexCoord2f(0, 0); - glVertex3f(-10.f, 10.f, 10.f); - glTexCoord2f(0, 1); - glVertex3f(-10.f, -10.f, 10.f); glTexCoord2f(1, 1); + glVertex3f(10.f, 10.f, 10.f); + glTexCoord2f(0, 1); + glVertex3f(-10.f, 10.f, 10.f); + glTexCoord2f(0, 0); + glVertex3f(-10.f, -10.f, 10.f); + glTexCoord2f(1, 0); glVertex3f(10.f, -10.f, 10.f); glTexCoord2f(1, 0); @@ -94,29 +94,29 @@ void Engine::Render(float elapsedTime) glTexCoord2f(1, 1); glVertex3f(10.f, 10.f, -10.f); - glTexCoord2f(1, 0); - glVertex3f(-10.f, 10.f, 10.f); - glTexCoord2f(0, 0); - glVertex3f(-10.f, 10.f, -10.f); - glTexCoord2f(0, 1); - glVertex3f(-10.f, -10.f, -10.f); glTexCoord2f(1, 1); + glVertex3f(-10.f, 10.f, 10.f); + glTexCoord2f(0, 1); + glVertex3f(-10.f, 10.f, -10.f); + glTexCoord2f(0, 0); + glVertex3f(-10.f, -10.f, -10.f); + glTexCoord2f(1, 0); glVertex3f(-10.f, -10.f, 10.f); - glTexCoord2f(1, 0); - glVertex3f(10.f, 10.f, -10.f); - glTexCoord2f(0, 0); - glVertex3f(10.f, 10.f, 10.f); - glTexCoord2f(0, 1); - glVertex3f(10.f, -10.f, 10.f); glTexCoord2f(1, 1); + glVertex3f(10.f, 10.f, -10.f); + glTexCoord2f(0, 1); + glVertex3f(10.f, 10.f, 10.f); + glTexCoord2f(0, 0); + glVertex3f(10.f, -10.f, 10.f); + glTexCoord2f(1, 0); glVertex3f(10.f, -10.f, -10.f); - glTexCoord2f(0, 0); // Les coordos de textures du plafond sont intentionnellement laissées à 0 pour que l'engine sample 1 pixel et ainsi me fait une couleur unie. + glTexCoord2f(0, 0); glVertex3f(10.f, 10.f, -10.f); - glTexCoord2f(0, 0); + glTexCoord2f(0, 0.1f); glVertex3f(10.f, 10.f, 10.f); - glTexCoord2f(0, 0); + glTexCoord2f(0, 0.1f); glVertex3f(-10.f, 10.f, 10.f); glTexCoord2f(0, 0); glVertex3f(-10.f, 10.f, -10.f); diff --git a/SQCSim2021/media/textures/curtains.png b/SQCSim2021/media/textures/curtains.png index 91aa6ff..2c3375a 100644 Binary files a/SQCSim2021/media/textures/curtains.png and b/SQCSim2021/media/textures/curtains.png differ diff --git a/SQCSim2021/media/textures/curtainsbak.png b/SQCSim2021/media/textures/curtainsbak.png new file mode 100644 index 0000000..db89258 Binary files /dev/null and b/SQCSim2021/media/textures/curtainsbak.png differ diff --git a/SQCSim2021/openglcontext.cpp b/SQCSim2021/openglcontext.cpp index b89d5d5..356d22e 100644 --- a/SQCSim2021/openglcontext.cpp +++ b/SQCSim2021/openglcontext.cpp @@ -152,7 +152,7 @@ void OpenglContext::ShowCrossCursor() const void OpenglContext::InitWindow(int width, int height) { - m_app.create(sf::VideoMode(width, height, 32), m_title.c_str(), m_fullscreen ? sf::Style::Fullscreen : (sf::Style::Resize|sf::Style::Close), sf::ContextSettings(32, 8, 4)); + m_app.create(sf::VideoMode(width, height, 32), m_title.c_str(), m_fullscreen ? sf::Style::Fullscreen : (sf::Style::Resize|sf::Style::Close), sf::ContextSettings(32, 8, 0)); } OpenglContext::MOUSE_BUTTON OpenglContext::ConvertMouseButton(sf::Mouse::Button button) const