Replaced all occurrences of GL_POLYGON render mode with GL_TRIANGLE_FAN since...

Replaced all occurrences of GL_POLYGON render mode with GL_TRIANGLE_FAN since GL_POLYGON is deprecated.
parent 427729d0
......@@ -245,7 +245,7 @@ namespace campvis {
}
_paintShader->setIgnoreUniformLocationError(false);
_quad->render(GL_POLYGON);
_quad->render(GL_TRIANGLE_FAN);
LGL_ERROR;
}
......
......@@ -84,7 +84,7 @@ namespace campvis {
* Renders this GeometryData.
* Must be called from a valid OpenGL context.
*/
virtual void render(GLenum mode = GL_POLYGON) const = 0;
virtual void render(GLenum mode = GL_TRIANGLE_FAN) const = 0;
/**
* Returns the geometry extent in world coordinates.
......
......@@ -95,7 +95,7 @@ namespace campvis {
* Renders this GeometryDataCollection.
* Must be called from a valid OpenGL context.
*/
virtual void render(GLenum mode = GL_POLYGON) const;
virtual void render(GLenum mode = GL_TRIANGLE_FAN) const;
/**
* Returns the geometry extent in world coordinates.
......
......@@ -88,6 +88,7 @@ namespace campvis {
void VisualizationProcessor::createAndAttachTexture(GLint internalFormat) {
GLenum attachment = 0;
switch(internalFormat) {
case GL_R32F:
case GL_RGB:
case GL_RGB16F_ARB:
case GL_RGBA:
......
......@@ -48,9 +48,9 @@ namespace campvis {
/**
* Renders a [-1, 1]^2 quad in the XY plane having texture coordinates [0, 1]^2.
* \param mode OpenGL rendering mode (defaults to GL_POLYGON).
* \param mode OpenGL rendering mode (defaults to GL_TRIANGLE_FAN).
*/
void renderQuad(GLenum mode = GL_POLYGON);
void renderQuad(GLenum mode = GL_TRIANGLE_FAN);
private:
/// Private Constructor, must be called from valid OpenGL context.
......
......@@ -103,7 +103,7 @@ namespace campvis {
// this will all get better with scripting support.
static_cast<BoolProperty*>(_vmEepGenerator.getProperty("applyMask"))->setValue(true);
_vmRenderer.p_renderTargetID.addSharedProperty(static_cast<DataNameProperty*>(_vmEepGenerator.getProperty("maskID")));
_vmRenderer.p_renderMode.selectByOption(GL_POLYGON);
_vmRenderer.p_renderMode.selectByOption(GL_TRIANGLE_FAN);
_renderTargetID.setValue("combine");
......
......@@ -102,7 +102,7 @@ namespace campvis {
_cubeRenderer.p_geometryID.setValue("cube");
_cubeRenderer.p_renderTargetID.setValue("cube.render");
_cubeRenderer.p_renderMode.selectById("polygon");
_cubeRenderer.p_renderMode.selectById("trianglefan");
_cubeRenderer.p_showWireframe.setValue(false);
_cubeRenderer.p_textureID.setValue("CampTexture");
_cubeRenderer.p_coloringMode.selectByOption(GeometryRenderer::TEXTURE_COLOR);
......
......@@ -174,7 +174,7 @@ namespace campvis {
glClearDepth(1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glCullFace(p_enableMirror.getValue() ? GL_FRONT : GL_BACK);
clipped.render(GL_POLYGON);
clipped.render(GL_TRIANGLE_FAN);
RenderData* entrypoints = new RenderData(_fbo);
_fbo->detachAll();
......@@ -192,7 +192,7 @@ namespace campvis {
glClearDepth(0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glCullFace(p_enableMirror.getValue() ? GL_BACK : GL_FRONT);
clipped.render(GL_POLYGON);
clipped.render(GL_TRIANGLE_FAN);
RenderData* exitpoints = new RenderData(_fbo);
decorateRenderEpilog(_shader);
......
......@@ -147,7 +147,7 @@ namespace campvis {
createAndAttachDepthTexture();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
slice.render(GL_POLYGON);
slice.render(GL_TRIANGLE_FAN);
_shader->deactivate();
cgt::TextureUnit::setZeroUnit();
......
......@@ -113,7 +113,7 @@ namespace campvis {
createAndAttachColorTexture();
createAndAttachDepthTexture();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
slice.render(GL_POLYGON);
slice.render(GL_TRIANGLE_FAN);
_shader->deactivate();
cgt::TextureUnit::setZeroUnit();
......
......@@ -296,7 +296,7 @@ namespace campvis {
_shader->setUniform("_viewMatrix", cgt::mat4::createTranslation(cgt::vec3(srs.x, 0.f, 0.f)));
break;
}
_quad->render(GL_POLYGON);
_quad->render(GL_TRIANGLE_FAN);
_shader->setUniform("_renderBackground", false);
decorateRenderEpilog(_shader);
......@@ -311,7 +311,7 @@ namespace campvis {
_shader->setUniform("_modelMatrix", cgt::mat4::createScale(cgt::vec3(srs.x, srs.y, .5f)));
_shader->setUniform("_viewMatrix", cgt::mat4::createTranslation(cgt::vec3(0.f, 2.f * srs.y, 0.f)));
}
_quad->render(GL_POLYGON);
_quad->render(GL_TRIANGLE_FAN);
}
if (ySliceImage != 0) {
ySliceImage->bind(_shader, colorUnit, depthUnit);
......@@ -323,7 +323,7 @@ namespace campvis {
_shader->setUniform("_modelMatrix", cgt::mat4::createScale(cgt::vec3(srs.x, srs.y, .5f)));
_shader->setUniform("_viewMatrix", cgt::mat4::createTranslation(cgt::vec3(0.f, srs.y, 0.f)));
}
_quad->render(GL_POLYGON);
_quad->render(GL_TRIANGLE_FAN);
}
if (xSliceImage != 0) {
xSliceImage->bind(_shader, colorUnit, depthUnit);
......@@ -335,7 +335,7 @@ namespace campvis {
_shader->setUniform("_modelMatrix", cgt::mat4::createScale(cgt::vec3(srs.x, srs.y, .5f)));
_shader->setUniform("_viewMatrix", cgt::mat4::createTranslation(cgt::vec3(0.f, 0.f, 0.f)));
}
_quad->render(GL_POLYGON);
_quad->render(GL_TRIANGLE_FAN);
}
_shader->deactivate();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment