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

Author Topic: Fast drawing bitmap  (Read 4714 times)

0 Members and 3 Guests are viewing this topic.

Freedon Nadd

  • Newbie
  • *
  • Posts: 3
    • View Profile
Fast drawing bitmap
« on: January 15, 2013, 05:28:44 am »
Hi,

I'm new with SFML 2.0 and I was wondering how to rapidly draw large bitmaps.

Should I use a texture?
Should I create new texture for every bitmap or should I update the same one over and over?

What would be the fastest way?

Thanks for your help.

Freedon

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: Fast drawing bitmap
« Reply #1 on: January 15, 2013, 09:13:50 pm »
You need to define what you mean by 'large bitmaps'...

Basically you just load the images into a texture and draw them with a sprite.
Loading an image is quite a heavy process, so you shouldn't/can't to it every iteration. Having multiple textures will work tough.

Then again if you have giga bytes of image data, then you'll have problems with your GPU and you have to use some different way to load and display the data.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Freedon Nadd

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Fast drawing bitmap
« Reply #2 on: January 15, 2013, 09:20:44 pm »
Hi,

Thanks for the quick reply.

Let say the bitmap is 1920x1080 and I receive a brand new one every 33 millisecond and I cannot preload them.

What would be my options?

Thanks for your help.

Freedon

krzat

  • Full Member
  • ***
  • Posts: 107
    • View Profile
Re: Fast drawing bitmap
« Reply #3 on: January 16, 2013, 01:08:37 am »
Create texture and use Update method.

Btw what are you trying to do?
SFML.Utils - useful extensions for SFML.Net

Freedon Nadd

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Fast drawing bitmap
« Reply #4 on: January 16, 2013, 02:00:58 am »

I'm trying to make a tool that process a bitmap with different filters and display juste like a video.
I've looked around the web and SFML was rated one of the fastest renderer, I'm trying it out.

If you have any other idea please let me know.

Thanks for your help.

Freedon

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Fast drawing bitmap
« Reply #5 on: January 16, 2013, 07:53:10 am »
What about using shaders to implement those filters?
Laurent Gomila - SFML developer

 

anything