Hi!
I’m using SFML, which uses OpenGL, and have found that a simple OpenGL triangle will only display under weird circumstances. Here’s the code for the triangle:
drawInterfaces() is a function to display some 2D sprites. state is changed to 2 when I want the triangle to be displayed.
This will only work if I remove the state system all together and just allow drawGL() to display by its own. Example: the above window portion will NOT work. This, however, WILL work.
window.clear();
drawGL();
window.display();
I’m pretty sure this isn’t SFML’s fault because I can still initialize all of my sprites, load the images and put them into sprites before calling drawGL() and it works. :doh:
What I mean is, I have an integer to see whether or not the program should draw the interface or OpenGL. At the moment it will draw the 2D interface to begin with, but when the state is changed I get a black background with no triangle.
Nothing else in the loop really concerns the problem. The only relevant information to give you is that before I start the window’s frame loop, I initialize some SFML sprites and textures. This doesn’t seem to effect anything when I start the loop with drawGL(), though. I think this is my fault. I think I’ll just do the usual “stare at the code until it shows itself” technique.