Make wireframe mode work again
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
~Mesh() = default;
|
||||
|
||||
void draw(ShaderProgram *shaderProgram);
|
||||
void drawWithoutTextures(ShaderProgram *shaderProgram);
|
||||
void drawWithoutTextures();
|
||||
|
||||
VertexArray * getVertexArray() { return &vertexArray; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user