Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed pixel primitive texture binding

  • Loading branch information...
commit 3c181cda530ab33e6efc686dde777f8e6e8ae9bd 1 parent d293a5d
@gaborpapp gaborpapp authored
Showing with 15 additions and 12 deletions.
  1. +15 −12 libfluxus/src/PixelPrimitive.cpp
View
27 libfluxus/src/PixelPrimitive.cpp
@@ -384,27 +384,29 @@ void PixelPrimitive::Render()
m_ReadyForUpload=false;
}
+ glMatrixMode(GL_PROJECTION);
+ glPushMatrix();
+ glMatrixMode(GL_MODELVIEW);
+ glPushMatrix();
+
// render the pixel primitive scenegraph
if (m_FBOSupported && m_RendererActive)
{
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
Bind();
m_Renderer->Reinitialise();
m_Renderer->Render();
Unbind();
+ }
- // reapply state (texture states, shader, etc)
- ApplyState();
+ // bind texture with current texture filter settings in passive mode and
+ // reapply state after FBO (texture states, shader, etc) if renderer is active
+ ApplyState();
- // restore transform
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
- }
+ // restore transform
+ glMatrixMode(GL_PROJECTION);
+ glPopMatrix();
+ glMatrixMode(GL_MODELVIEW);
+ glPopMatrix();
if (m_State.Hints & HINT_WIRE)
{
@@ -447,6 +449,7 @@ void PixelPrimitive::Render()
glTexCoord2f(0,t);
glVertex3fv(m_Points[3].arr());
glEnd();
+
glBindTexture(GL_TEXTURE_2D, 0);
glEnable(GL_LIGHTING);
glDisable(GL_TEXTURE_2D);
Please sign in to comment.
Something went wrong with that request. Please try again.