Main Menu

Recent posts

#81
General Discussion / multiple windows
Last post by KSergeyP - 06 November 2024, 12:18:28
How?)
Backend: SDL3_OPENGL(Using the new SDL3 Callback App Structure)
Tried to launch SDL_EnterAppMainCallbacks (2 windows) from different threads. Windows are created, but the first created window slows down, the second created window works well.
I also tried to create 2 windows at once from one thread - both work well, but it is unclear how to distinguish from which window I receive events?
Are there any examples of correctly launching multiple windows. Preferably in different threads.
#82
General Discussion / Re: Custom Widgets - Clock and...
Last post by KSergeyP - 06 November 2024, 04:35:06
yes this is what I need
#83
General Discussion / Re: Custom Widgets - Clock and...
Last post by texus - 05 November 2024, 19:53:25
TGUI has nothing for time or date picking.

Can you explain a bit more what exactly you would want though? I'm imagining you mean something like a date picker that looks like the attached image?
#84
General Discussion / Custom Widgets - Clock and Cal...
Last post by KSergeyP - 05 November 2024, 19:33:17
Are there any libraries (SDL or SFML) for creating clock and calendar that can be used with TGUI?
Are there any plans to add these widgets to TGUI?
#85
General Discussion / Re: Black area during resize
Last post by KSergeyP - 30 October 2024, 13:30:39
Quote from: texus on 25 October 2024, 09:14:22SDL recently worked around it by allowing you to bind a SDL_EVENT_WINDOW_EXPOSED callback that would get called during resize (and in which you can then render (see e.g. https://github.com/libsdl-org/SDL/issues/1059).

Yes, it works with SDL3
But it stretches with a bit of a slowdown, the black area is visible if you quickly drag it with the mouse, but then it is automatically filled and the layouts are automatically stretched
Perhaps you need to tweak something in the SDL settings for greater smoothness/speed of rendering
#86
General Discussion / Re: Black area during resize
Last post by texus - 25 October 2024, 09:14:22
It is a Windows-issue in the sense that it is a Windows call that hangs during resize. All window libraries will face issues with it, but a library like QT will have workarounds to make things work. In the SFML github issue they also mention some of the things that they can do to make it work in the future.

Other libraries have the same issue, e.g. GLFW's glfwPollEvents also hangs (e.g. https://stackoverflow.com/a/56614042 describes a method to redraw when the mouse is moved during resizing).
SDL recently worked around it by allowing you to bind a SDL_EVENT_WINDOW_EXPOSED callback that would get called during resize (and in which you can then render (see e.g. https://github.com/libsdl-org/SDL/issues/1059).

I have not experimented with any of these workarounds in combination with TGUI though. Although it should be the exact same as rendering otherwise: you call gui.draw() inbetween the locations where you are clearing and displaying the window contents.

As for which backend is the best. For most people either one will work, there are only minor differences. While I love SFML, it is the one that is the least feature-complete and lacks some advanced functionality, while SDL is commonly used in many places so it probably has the most options that can be tuned to get what you want.
#87
General Discussion / Re: Black area during resize
Last post by KSergeyP - 25 October 2024, 08:46:15
Quote from: texus on 25 October 2024, 08:36:34This is a known issue in SFML that is related to how resizing works on Windows. See e.g. https://github.com/SFML/SFML/issues/3016
They write that this is a Windows problem. But QT somehow solves this - by default it works on Windows without these problems.
#88
General Discussion / Re: Black area during resize
Last post by KSergeyP - 25 October 2024, 08:40:07
I'm using SFML Graphics (Windows). Tried SFML Windows - same thing
Which backend is best for Windows?
#89
General Discussion / Re: Black area during resize
Last post by texus - 25 October 2024, 08:36:34
I'm assuming you are using the SFML backend and are using Windows? (other backends might have a similar issue though)

This is a known issue in SFML that is related to how resizing works on Windows. See e.g. https://github.com/SFML/SFML/issues/3016
#90
General Discussion / Black area during resize
Last post by KSergeyP - 25 October 2024, 08:30:33
When I stretch the window with the mouse, a black area appears and the window is redrawn only when I release the mouse button.
Are there any simple examples with automatic image update when resizing?