GLuint ScreenImage()
{
sf::Image img;
img.CopyScreen(App,sf::IntRect(0,0,512,256));
const sf::Uint8* ptr = img.GetPixelsPtr();
GLuint tex;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,512,256,0,GL_RGBA,GL_UNSIGNED_INT,ptr);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glBindTexture(GL_TEXTURE_2D, 0);
return tex;
}
what am I doing wrong?