Commit 699e8ff7 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

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