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

Author Topic: GUI rendering frequency  (Read 1818 times)

0 Members and 1 Guest are viewing this topic.

upseen

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
GUI rendering frequency
« on: November 04, 2012, 04:32:39 pm »
Hello,

I'm planning to write some personal GUI that mainly focuses on a jQuery-like animation functions, but i'm having some questions concerning render frequency :

  • Render every GUI element each frame.
  • Render only when an element requests un update, on a screen-sized texture that is rendered on the screen every frame.

The latter seems rather interesting, however I had read somewhere that rendering big textures is slow, not to mention that there would be quite a number of updates since there would be animations all the time (hovering, screen transition).

Being unable to do any tests (since I hadn't wrote anything yet), I wanted to ask for advice if ever someone already tried.

Thanks!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: GUI rendering frequency
« Reply #1 on: November 05, 2012, 01:17:42 am »
First up, SFML wasn't developed as a rendering system for GUIs, thus if your aim is a GUI-only application, then you maybe should consider other possibilities.

  • Render every GUI element each frame.
  • Render only when an element requests un update, on a screen-sized texture that is rendered on the screen every frame.
There isn't that much difference, because for both operations you'll draw all the pixel of the whole window, thus what would count is rather the logic on calculating the positions and perspectives etc., which if done right shouldn't take up that much time.
Knowing the developers of SFGUI, I can only tell you that the bigger performance breaker is the rendering part with SFML. ;)

TBH I don't really see any reason for the project. Everything that has to do with web frontend development are very often just 'hacks', because you're very limited on what you can and can't do. If you have C++ and SFML (/OpenGL) on the other hand you get (nearly) maximum freedom and thus trying to copying the hacks & workarounds for a limited system into a freedom system seems kind of strange. :D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

upseen

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: GUI rendering frequency
« Reply #2 on: November 05, 2012, 09:22:02 am »
Oh, Forgot to mention that it's a GUI for game, jQuery was just an example to show how easing and animations are handled :)

I've looked onto other GUIs and they either don't have what I need or have way more than what I need (just like every library out there anyway), so I decided to make my own which didn't seem that hard afterall.

Well, after I've done a few tests, it seems that i'll drop the lazy-rendering option since I noticed that the GUI will be still re-rendered the most of the regions since there will be animations most of the time, and now this topic seems like a waste  ::)

Thanks!