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

Author Topic: Image not displayed with Open GL  (Read 1257 times)

0 Members and 1 Guest are viewing this topic.

juanmemo

  • Newbie
  • *
  • Posts: 2
    • View Profile
Image not displayed with Open GL
« on: October 13, 2015, 10:30:00 pm »
Why the code in the attachment is  not displaying my image?


Satus

  • Guest
Re: Image not displayed with Open GL
« Reply #1 on: October 13, 2015, 10:39:35 pm »
How about, do you check return value of loadFromFile?

juanmemo

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Image not displayed with Open GL
« Reply #2 on: October 13, 2015, 11:00:19 pm »
Its returning true.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Image not displayed with Open GL
« Reply #3 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)
Laurent Gomila - SFML developer

Mr_Blame

  • Full Member
  • ***
  • Posts: 192
    • View Profile
    • Email
Re: Image not displayed with Open GL
« Reply #4 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 :)

 

anything