Commit graph

18 commits

Author SHA1 Message Date
Tobias Hunger
43e4b262c2
janitor: Remove some more unnecessary clone() calls 2022-01-09 14:34:03 +01:00
Simon Hausmann
ced05732a8 Improve robustness of unmapping windows with the GL backend
Make sure to make the GL context is current before destroying the femtovg canvas.

The drop implementation of the canvas will call functions to delete GL resources such as textures, FBOs, etc.
and for that to work reliably the context must be current.
2022-01-05 13:05:40 +01:00
Tobias Hunger
3e448f75eb
janitor: Remove some unnecessary references
These are immediently dereferenced by the compiler according to clippy.

Remove some now unnecessary muts to make things build again.
2022-01-04 18:22:15 +01:00
Tobias Hunger
bfca0e3573 Mass update copyright messages to be more REUSE compliant 2021-12-22 10:06:12 +01:00
Simon Hausmann
215cf68152 Add a simple frames per second counter to the GL and Qt backend
It can be activated using the `SIXTYFPS_DEBUG_PERFORMANCE` environment
variable, which takes a comma separated list of options.

This could be extended in the future with different locations for the
overlay (corner_top_left, corner_top_right, etc.) - but this is a simple
start.

cc #728
2021-12-20 15:32:20 +01:00
Simon Hausmann
2dae2a01d2 Internal cleanup in the GL renderer
Separate the image cache from the texture cache.
The latter needs additional data in the key. The two have less in common that it seemed.

This also fixes a small issue with `CachedImage::upload_to_gpu` that for
SVGs would return a decoded (rendered) SVG image, instead of a texture.
That was harmless because we always call `ensure_uploaded_to_gpu`
later, but now we assert that the texture cache only holds textures,
because clear() (former remove_textures()) just clears everything.
2021-12-10 22:26:15 +01:00
Olivier Goffart
873ab9f2e0 GL backend: fix clipping when using scale factor
The initial clipping was set in physical size rather than in logical size.
When scaling up, this does not have visible effect, but when scaling down
it clips too much.
2021-12-08 17:28:23 +01:00
Olivier Goffart
181c8aced7 GL backend: allow to override scale factor with an env variable
SIXTYFPS_SCALE_FACTOR override the scale factor at runtime
2021-12-08 17:28:23 +01:00
Lukas Jung
25dc48ae27 remove move cursor from MouseCursor 2021-12-07 22:41:24 +01:00
Lukas Jung
588a7b0c5c Format mouse-cursor changes with rustfmt 2021-12-07 22:41:24 +01:00
Lukas Jung
cea17c1958 Add mouse-cursor support to glwindow backend 2021-12-07 22:41:24 +01:00
Simon Hausmann
b29b2cfaea Make WinitWindow::apply_window_properties work outside the GL backend crate
Move the image loading related bit for the icon back into glwindow.

Amends commit
51469be56b.
2021-11-12 11:44:39 +01:00
Simon Hausmann
51469be56b Move more of the winit related code from PlatformWindow impl into WinitWindow
This will allow code sharing with the simulator in the future.
2021-11-12 09:02:52 +01:00
Simon Hausmann
68ec3ccf6f GL backend cleanup
Move the window constraint application handling into WinitWindow,
for future sharing.
2021-11-11 11:47:54 +01:00
Simon Hausmann
ad1b251966 Internal cleanup
Centralize the setting of the width/height on the window item in the core library.
2021-11-11 11:47:54 +01:00
Simon Hausmann
1fb101c0a0 GL window cleanup
Remove internal component() function. There was only one call site.
2021-11-11 11:47:54 +01:00
Simon Hausmann
6fe9c3c23c GL window cleanup
Inline map_window() and unmap_window()
2021-11-11 11:47:52 +01:00
Simon Hausmann
3c0607276c Make the GL backends' winit driven event loop a reusable module
Abstract away the dependency to the former GraphicsWindow by

(1) Renaming GraphicsWindow to GLWindow
(2) Introducing a WinitWindow trait
2021-11-11 11:45:56 +01:00
Renamed from sixtyfps_runtime/rendering_backends/gl/graphics_window.rs (Browse further)