SVG in themes

Started by _Mir_.cpp, Yesterday at 17:27:33

_Mir_.cpp

I'd like to create an svg-based theme for TGUI, but I have some question about SVG support in the library and about theme creation in general.
  • I saw that you can use .svg files in themes, but I'd like to know if widgets using these files are really scalable as they should be (or images are converted to raster format right after loading and have same problems with scalability as raster images)?
  • Is it so important to put all graphical resourced to one image like it's done with standard themes (I'm about Black.png in the Black theme etc)?

texus

I don't have much time to answer right now, so I'll answer with what I remember, you might have to experiment a bit with it yourself to fully see how well it works.

SVGs are only rasterized when rendering. The result may be cached, but when you resize a widget, the cache will be cleared. The code to draw SVGs hasn't been tested much, and it's not as well optimized, but it should normally work.

Placing all graphics in a single image is purely an optimization, so that OpenGL will have to switch the texture less often when rendering. I don't think it's even compatible with SVGs, so you probably have to use separate image files anyway.

_Mir_.cpp

Thank you for your quick answer. I'll experiment with it.
P. S.: I have some problems with access to forum, so I will probably not read new messages here soon.