SFML community forums
Help => Window => Topic started by: An0nym8us on June 25, 2015, 12:53:48 pm
-
Hello :).
I was using SFML, while coding programs on Windows. I downloaded source, compiled it via MinGW - every library worked pretty.
Due to few mistakes during compiling Ogre Engine on Windows, I was forced to use Linux (Ubuntu 14.04) to writing and compiling
C++ apps. Compiling Ogre was successful, but I've encountered a couple of problems (like downloading lot of libraries via apt-get), but finally I compiled it. The problem is, when I open window (using tutorial, minimal code), it seems bugged:
(http://i.imgur.com/lIf4S9L.png)
I don't know why it happens. I updated every lib by "apt-get update"/"apt-get upgrade" and built again - not working. The same problem is with libraries for debugging. I removed libraries built by me and installed SFML by "apt-get install libsfml-dev" - the same problem. Anyone knows why I encounter that error?
Regards
-
You forgot to actually draw something to the window.
If you look at the sample closely you will see that there are some more instructions:
window.clear()
//draw stuff
window.display();
-
I think you're right :).
But - I had to use sf::RenderWindow instead of sf::Window (sf::Window doesn't have clear() method, i'm using SFML 2.3). I'm happy it's working now, but why official minimal code is using not working properly sf::Window? Is it because of Window is for OpenGL rendering?
-
sf::Window is for people who really just want to use OpenGL.
sf::RenderWindow is for people who also want to work with SFML's graphics module.
And I'm not sure where you copied the code from, but if you were in the OpenGL tutorial, then yes, obviously it would only use the sf::Window...
-
sf::Window is for people who really just want to use OpenGL.
sf::RenderWindow is for people who also want to work with SFML's graphics module.
And I'm not sure where you copied the code from, but if you were in the OpenGL tutorial, then yes, obviously it would only use the sf::Window...
I used this tutorial: http://www.sfml-dev.org/tutorials/2.3/window-window.php (http://www.sfml-dev.org/tutorials/2.3/window-window.php)
I read in API documentation that sf::Window is for OpenGL rendering.
Now it seems logical. "This tutorial only explains how to open and manage a window. Drawing stuff is beyond the scope of the sfml-window module: it is handled by the sfml-graphics module." - I didn't read this first line. As I remember, window was black automatically when I used SFML on Windows (and probably I remember it wrongly), that's why I thought window is bugged.
Thanks for help, and sorry for this simple question :).