SFML community forums

Help => Graphics => Topic started by: hoozh on August 24, 2015, 10:26:48 am

Title: [SOLVED]Draw video frames on sf::RenderWindow
Post by: hoozh on August 24, 2015, 10:26:48 am
hi

I use sf::Texture + sf::Sprite to draw video frames on a sf::RenderWindow, it works fine on my computer.

but on some other computers, when create Texture, it fails, and output error:

Failed to create texture, its internal size is too high (2048x1024, maximum is 1024x1024)

Is there other way to draw images which is bigger than 1024x1024 on RenderWindow?

Title: Re: Draw video frames on sf::RenderWindow
Post by: Jesper Juhl on August 24, 2015, 10:28:57 am
Use multiple textures and multiple draw calls.
See also http://www.bromeon.ch/libraries/thor/v2.0/doc/classthor_1_1_big_texture.html
Title: Re: Draw video frames on sf::RenderWindow
Post by: hoozh on August 25, 2015, 09:55:21 am
Use multiple textures and multiple draw calls.
See also http://www.bromeon.ch/libraries/thor/v2.0/doc/classthor_1_1_big_texture.html

Thank you, Jesper. Problem solved by thor::BitSprite

I notice that on some computer that without display driver, the pieces of image didn't show at same time, Is it because of GDI rendering?
Title: Re: [SOLVED]Draw video frames on sf::RenderWindow
Post by: Nexus on August 25, 2015, 10:15:06 pm
Not at the same time? Since the sprites are rendered to a buffer, not directly the screen -- a principle known as double buffering -- it's likely that there's a mistake in your clear-draw-display cycle. Maybe read the tutorial here (http://www.sfml-dev.org/tutorials/2.3/graphics-draw.php), especially the red box.

A graphical artifact that may occur is screen tearing, but it usually appears in the form of horizontal lines. Vertical synchronisation (VSync) can fix it.