Skip to content

Conversation

@mardy
Copy link
Collaborator

@mardy mardy commented Mar 4, 2024

The OGC_video_flip() function does not simply flip the current video frame: if the mouse cursor is visible, it will draw it. If/when we'll add support for the OSK keyboard, that will also be drawn at the end of every frame.

Since these operations require a specific blending mode, we must make sure that it is restored to its original value before starting drawing the next frame.

We could optimize this by having OGC_video_flip() return a boolean (or a bit mask, in case there are more settings beside the blending mode that it can alter) telling whether the blending mode was changed, in order not to perform an unneeded operation. It might make sense to do it once we decide to do the same for the vertex formats and the texture stages, which change more often and are heavier operations.

The OGC_video_flip() function does not simply flip the current video
frame: if the mouse cursor is visible, it will draw it. If/when we'll
add support for the OSK keyboard, that will also be drawn at the end of
every frame.

Since these operations require a specific blending mode, we must make
sure that it is restored to its original value before starting drawing
the next frame.

We could optimize this by having OGC_video_flip() return a boolean (or
a bit mask, in case there are more settings beside the blending mode
that it can alter) telling whether the blending mode was changed, in
order not to perform an unneeded operation. It might make sense to do it
once we decide to do the same for the vertex formats and the texture
stages, which change more often and are heavier operations.
@WinterMute WinterMute merged commit afa67bc into devkitPro:ogc-sdl-2.28 Mar 5, 2024
@WinterMute
Copy link
Member

Nice commit messages btw. I do rather enjoy the detail here.

WinterMute pushed a commit that referenced this pull request Oct 27, 2024
The OGC_video_flip() function does not simply flip the current video
frame: if the mouse cursor is visible, it will draw it. If/when we'll
add support for the OSK keyboard, that will also be drawn at the end of
every frame.

Since these operations require a specific blending mode, we must make
sure that it is restored to its original value before starting drawing
the next frame.

We could optimize this by having OGC_video_flip() return a boolean (or
a bit mask, in case there are more settings beside the blending mode
that it can alter) telling whether the blending mode was changed, in
order not to perform an unneeded operation. It might make sense to do it
once we decide to do the same for the vertex formats and the texture
stages, which change more often and are heavier operations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants