Jump to content
  • Advertisement
Sign in to follow this  
iliak

OpenGL Sprite fliping (texture ) in OpenGL

This topic is 3660 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi In my 2D engine (C#, OpenGL via TaoFramework) I set texture matrix to match 1:1 on my texture. So if a texture is 256 x 256, I access each texel by its coordinate : texel(0,0) is up left, texel(255, 255) is down right. So far, so good. Now I want to flip vertically or horizontaly the texture to allow my sprite to go left, and go right (up or down) only by flipping the texture coordinate. I tried this :
Gl.GlMatrixMode( GL_TEXTURE )
Gl.GlPushMatrix();

// Verticaly flip the sprite
Gl.GlScaleF(1.0f, -1.0f, 0.0f)


// blah blah


Gl.GlPopMatrix();

Nothing happen... Where am I wrong ??

Share this post


Link to post
Share on other sites
Advertisement
Uhm, could it be the filter mode on the texture? I assume you're using fixed functionality so forgetting to multiply with the texture matrix in a shader isn't the issue.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!