Example (right from the source):
I initialize my RenderTextures:
sf::RenderTexture ninjaRender[maxPlayers];
...
for (int i = 0; i < maxPlayers; i++)
{
ninjaRender[i].create(256, 256);
ninjaRender[i].setView(*ninjaRenderView);
ninjaRender[i].clear(sf::Color(0, 0, 0, 0));
ninjaRender[i].display();
}
Then I cap and draw them:
ninjaRender[ninjaNum].clear(sf::Color(0, 0, 0, 0));
ninjaRender[ninjaNum].draw(*anim->drawable);
ninjaRender[ninjaNum].display();
mainWindow->draw(sf::Sprite(ninjaRender[ninjaNum].getTexture()));
Works (nvm crappy solutions, just testing).
However, when I try this:
glEnable(GL_TEXTURE_2D);
sf::Texture::bind(&ninjaRender[ninjaNum].getTexture());
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 1.0f); glVertex2f(0, 0);
glTexCoord2f(1.0f, 1.0f); glVertex2f(256, 0);
glTexCoord2f(1.0f, 0.0f); glVertex2f(256, 256);
glTexCoord2f(0.0f, 0.0f); glVertex2f(0, 256);
glEnd();
...it breaks everything.