SFML community forums

Help => Graphics => Topic started by: neos300 on January 05, 2012, 11:57:41 pm

Title: OpenGL draw ignoring sf::View
Post by: neos300 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);