Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - provener

#1
Sorry, this is all pretty new to me. On the surface level it seemed like SDL was this API-agnostic layer on top of any renderer that was appropriate for the platform, but it seems like most SDL programs just assume OpenGL is the rendererĂ¢â‚¬"not just TGUI but others. So I kind of thought that with the move from SFML to SDL2 I was gaining access to a broader amount of libraries guaranteed to work cross-platform. But it really does seem like most of the ecosystem is just SDL2 with the expectation that OpenGL is available. It's pretty confusing for someone who hasn't really worked with these kinds of libraries before.
#2
I gotcha. Thank you for the context (hah).

I haven't even gotten as far as to tear out SFML in my GUI code yet, so no actual prototypes with TGUI/SDL, but it seems like I'd end up at the impasse you described above, especially since I'm attempting to use OS-exclusive renderers where I can (i.e. Metal for macOS and Direct3D11 for Windows).

Thank you again!
#3
I was using canvas because it seemed like the correct way to use the layout engine to separate your screen into resize-/scale-friendly panels, and then draw all application-related sprites/textures to it. It may be the case that all I need to do is use the layout engine, have it set up a horizontal panel on the side, and draw things directly to the screen in whatever way the API expects (passing sf::Drawables to Canvas#draw for SFML, or SDL_RenderCopy for SDL), in the "left-over" space that is not taken by the GUI.

What makes it awkward without the notion of a canvas is if I have two areas on screen that I want to directly render to, one of which is contained within the layout of a GUI, I will have to keep track of the location of the individual GUI widgets in order to render textures at the right coordinate positions. Does that make sense?
#4
Hello,

I'm migrating an app from SFML to SDL, and I'd very much like to keep my TGUI interfaces. The primary layout for my app is a set of panels on one side of the screen, with a tgui::Canvas on the other side for drawing sf::Drawables:

Code (cpp) Select
  auto main_hud = tgui::HorizontalLayout::create();
  // add side panels...
  this.primary_canvas_ = tgui::Canvas::create();
  main_hud->add(primary_canvas_, 1.0f);
  main_hud->add(side_panels, 0.8f);


In TGUI 0.9.1, it appears as if tgui::Canvas is hidden behind ifdef guards for the SFML backend exclusively.

What is the proper way, with the SDL backend, to reserve an area of the GUI window for directly rendering, say, SDL_Textures to? And additionally, is it possible to have multiple such areas of the GUI window?

Cheers!