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

Author Topic: Get current screen (image)  (Read 2136 times)

0 Members and 1 Guest are viewing this topic.

Bizarreofnature

  • Newbie
  • *
  • Posts: 48
    • View Profile
Get current screen (image)
« on: October 20, 2017, 09:49:35 pm »
Hello there!

I got a small problem. I want the current screen contents to load into a texture.

TextureWindow.update (gWindow);
Window.setTexture (TextureWindow);

gWindow is my renderwindow and Texturewindow an sf::texture, Window an sf:sprite.

Somewhy it does not work. The Window sprite is empty.

Please help me.

Best regards
Bizarreofnature

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Get current screen (image)
« Reply #1 on: October 20, 2017, 10:37:05 pm »
Have you read the paragraph about The white square problem?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Bizarreofnature

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Get current screen (image)
« Reply #2 on: October 20, 2017, 11:04:16 pm »
Cant be it. I store my sf::texture as a private member var in a class.
(aswell as my sf::sprite)

Bizarreofnature

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Get current screen (image)
« Reply #3 on: October 20, 2017, 11:15:17 pm »
The texture and sprite itself work both. If i load a normal file it works fine. Its just this .update which isnt working.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Get current screen (image)
« Reply #4 on: October 20, 2017, 11:29:32 pm »
Is the texture created with the correct size before the call to update?
Laurent Gomila - SFML developer

Bizarreofnature

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Get current screen (image)
« Reply #5 on: October 20, 2017, 11:31:40 pm »
Thank you very much! Works like a charm  :)

 

anything