Merge branch 'master' of github.com:sippeangelo/Escape-the-Dawn

Conflicts:
	Escape-the-Dawn/Escape-the-Dawn.vcxproj.filters
	Escape-the-Dawn/GameWorld.cpp
	Escape-the-Dawn/Renderer.cpp
	Escape-the-Dawn/Systems/RenderSystem.cpp
This commit is contained in:
Tobias Dahl
2014-03-12 15:34:25 +01:00
7 changed files with 25 additions and 467 deletions
+12 -1
View File
@@ -72,6 +72,17 @@ void Renderer::Draw(double dt)
glPolygonMode(GL_FRONT_AND_BACK, m_DrawWireframe ? GL_LINE : GL_FILL);
DrawModels();
#ifdef DEBUG
// Debug draw normals
if (m_DrawNormals) {
m_ShaderProgramNormals.Bind();
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
DrawModels();
}
#endif
ModelsToRender.clear();
#ifdef DEBUG
// Debug draw normals
if (m_DrawNormals) {
@@ -113,7 +124,7 @@ void Renderer::DrawModels()
for (auto texGroup : model->TextureGroups) {
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texGroup.Texture->texture);
glDrawArrays(GL_TRIANGLES, texGroup.StartIndex, texGroup.EndIndex - texGroup.StartIndex + 1);
glDrawArrays(GL_TRIANGLES, texGroup.StartIndex, (texGroup.EndIndex - texGroup.StartIndex + 1) * abs(sin(glfwGetTime())));
}
}
}