SFML community forums

Help => Graphics => Topic started by: juanmemo on October 13, 2015, 10:30:00 pm

Title: Image not displayed with Open GL
Post by: juanmemo on October 13, 2015, 10:30:00 pm
Why the code in the attachment is  not displaying my image?

Title: Re: Image not displayed with Open GL
Post by: Satus on October 13, 2015, 10:39:35 pm
How about, do you check return value of loadFromFile?
Title: Re: Image not displayed with Open GL
Post by: juanmemo on October 13, 2015, 11:00:19 pm
Its returning true.
Title: Re: Image not displayed with Open GL
Post by: Laurent on October 13, 2015, 11:27:07 pm
Please post the code directly, it's always better if you avoid a download to people who want to help you.

I haven't looked in detail, but a few remarks:
- track GL errors, that's the only way to immediately know when something goes wrong with OpenGL
- don't use sf::RenderWindow for pure OpenGL drawing, use sf::Window
- start with simpler stuff if nothing shows (remove unnecessary render states)
Title: Re: Image not displayed with Open GL
Post by: Mr_Blame on October 16, 2015, 03:14:00 pm
Also the coordinates for stuff in this code look not right in old and kind openGL the coordinates are in range from -1.0 to 1.0 in SFML it is avoided by using projection matrixes(that translate pixell coordinates to range from -1 - 1) but as i see, that you use default projection matrix and as i mentioned - default projection matrix has range from -1 to 1 that means, that point thats coords are smaller than -1 or bigger than 1 is out of screen. thanks for reading :)