Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: OpenGL draw ignoring sf::View  (Read 915 times)

0 Members and 1 Guest are viewing this topic.

neos300

  • Newbie
  • *
  • Posts: 6
    • MSN Messenger - omgborg@gmail.com
    • View Profile
OpenGL draw ignoring sf::View
« on: January 05, 2012, 11:57:41 pm »
So I need to constrain my GUI to an sf::View (the default one) and the library I use uses some opengl trickery to draw textures (it was made for OpenGL but has a SFML renderer)
The only problem is that these textures ignore my sf::View, which I need.

Is there any way to get the texture to obey me?
The code for rendering: (tex is a sf::Texture)
tex->Bind();
 
                        glColor4f(1, 1, 1, 1 );
 
                        glBegin( GL_QUADS );
                                glTexCoord2f( u1, v1 );         glVertex2f(rect.x,     rect.y);
                                glTexCoord2f( u1, v2 );         glVertex2f(rect.x,     rect.y + rect.h);
                                glTexCoord2f( u2, v2 );         glVertex2f(rect.x + rect.w, rect.y + rect.h);
                                glTexCoord2f( u2, v1 );         glVertex2f(rect.x + rect.w, rect.y) ;
                        glEnd();
 
                        glBindTexture( GL_TEXTURE_2D, 0);