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

Author Topic: [SOLVED]Draw video frames on sf::RenderWindow  (Read 1991 times)

0 Members and 1 Guest are viewing this topic.

hoozh

  • Newbie
  • *
  • Posts: 4
    • View Profile
[SOLVED]Draw video frames on sf::RenderWindow
« 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?

« Last Edit: August 25, 2015, 09:55:54 am by hoozh »

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Draw video frames on sf::RenderWindow
« Reply #1 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

hoozh

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Draw video frames on sf::RenderWindow
« Reply #2 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?
« Last Edit: August 25, 2015, 10:31:56 am by hoozh »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: [SOLVED]Draw video frames on sf::RenderWindow
« Reply #3 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, 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.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything