The documentation doesn't seem to have a mention about this so I'm wondering if this is normal.
I get the error:
An internal OpenGL call failed in Texture.cpp(98).
Expression:
glFlush()
Error description:
GL_INVALID_OPERATION
The specified operation is not allowed in the current state.
When I try to construct a Texture object from another Texture object with loaded texture.
sf::Texture temp1;
temp.loadFromFile(image_location);
sf::Texture player_texture{ temp };
No error if the texture object doesn't have a loaded texture already
sf::Texture temp1;
sf::Texture player_texture{ temp };
But of course this serves no purpose.
My original intent was to do this:
sf::Texture texture_initialize(std::string location) {
sf::Texture texture;
texture.loadFromFile(location);
return texture;
}
--> inside a function:
sf::Texture player_texture{ texture_initialize(image_location) };
Here you go:
#include <SFML/Graphics.hpp>
int main() {
sf::Texture texture;
texture.loadFromFile(sprite_location);
sf::Texture new_texture{ texture }; // <-- causes error
system("pause");
return 0;
}
I have no idea what TransientContextLock is supposed to be though.. :P
output on console:
An internal OpenGL call failed in Texture.cpp(98).
Expression:
glFlush()
Error description:
GL_INVALID_OPERATION
The specified operation is not allowed in the current state.
Press any key to continue . . .