Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Window Bugged?  (Read 2778 times)

0 Members and 2 Guests are viewing this topic.

An0nym8us

  • Newbie
  • *
  • Posts: 3
    • View Profile
Window Bugged?
« 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:



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

SpeCter

  • Full Member
  • ***
  • Posts: 151
    • View Profile
Re: Window Bugged?
« Reply #1 on: June 25, 2015, 12:58:29 pm »
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();

An0nym8us

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Window Bugged?
« Reply #2 on: June 25, 2015, 01:09:23 pm »
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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: Window Bugged?
« Reply #3 on: June 25, 2015, 01:20:55 pm »
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...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

An0nym8us

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Window Bugged?
« Reply #4 on: June 25, 2015, 01:29:25 pm »
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

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 :).

 

anything