Make wireframe mode work again

This commit is contained in:
4VRDriver
2020-09-21 09:30:26 +02:00
parent d641944119
commit 297735d6a7
4 changed files with 8 additions and 3 deletions

View File

@@ -155,11 +155,16 @@ void Controller::run() {
glBindTexture(GL_TEXTURE_2D, pp_framebuffer->getTextureId());
GLint location = glGetUniformLocation(postProcessingProgram.getShaderProgramId(), "u_texture");
glUniform1i(location, 0);
// Disable wireframe mode
GLint wireframe;
glGetIntegerv(GL_POLYGON_MODE, &wireframe);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
GLuint temp_vao;
glGenVertexArrays(1, &temp_vao);
glBindVertexArray(temp_vao);
glDrawArrays(GL_TRIANGLES, 0, 3);
glBindVertexArray(0);
glPolygonMode(GL_FRONT_AND_BACK, wireframe);
postProcessingProgram.unbind();
#ifdef _DEBUG

View File

@@ -108,7 +108,7 @@ void Skybox::draw(glm::mat4 viewMatrix, glm::mat4 projectionMatrix) {
shaderProgram->setUniform("u_viewProjectionMatrix", viewProjectionMatrix);
cubeMap.bind(shaderProgram);
cubeModel->getMesh(0)->drawWithoutTextures(shaderProgram);
cubeModel->getMesh(0)->drawWithoutTextures();
cubeMap.unbind();
shaderProgram->unbind();

View File

@@ -36,7 +36,7 @@ void Mesh::draw(ShaderProgram *shaderProgram) {
}
void Mesh::drawWithoutTextures(ShaderProgram *shaderProgram) {
void Mesh::drawWithoutTextures() {
vertexArray.bind();
glDrawElements(GL_TRIANGLES, numElements, GL_UNSIGNED_INT, 0);

View File

@@ -15,7 +15,7 @@ public:
~Mesh() = default;
void draw(ShaderProgram *shaderProgram);
void drawWithoutTextures(ShaderProgram *shaderProgram);
void drawWithoutTextures();
VertexArray * getVertexArray() { return &vertexArray; }