-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor DisplaySurface locking as used by ApiHawk (and Lua) (#2575)
* Refactor how the "emu" drawing surface is automatically opened/closed fixes #2571 again `gui.DrawNew("native")` now throws (I will replace this with something better). `gui.DrawNew("emu")` and `gui.DrawFinish()` do nothing but print warning messages, for backwards compatibility. This removes the feature which allowed scripts to draw as soon as they became enabled. It also removes the feature to draw without clearing the surface, though that wasn't working. * Reimplement drawing to "client" surface (see desc.) Changed surface names in APIs to "emucore" and "client" (not in DisplayManager yet because I can't be bothered). Via ApiHawk, `IGuiApi.WithEmuSurface(Action)` has been replaced with `IGuiApi.WithSurface(DrawingSurfaceID, Action)`, the first param being an enum. Via Lua (or ApiHawk), pass an extra string param (`DrawingSurfaceID` enum for ApiHawk) to each `gui.draw*` call. To make it less verbose, omitting the param is treated as using the default "emucore" surface, *unless* the helper `gui.use_surface("client")` had been called, which persists the chosen surface until Lua restarts or it's overwritten. (The same is done when using `WithSurface` in ApiHawk, though it's cleared once `WithSurface` returns.) Along with the new surface names, the old names are still valid in the `surface` params and `gui.use_surface` for now. * Propogate enum to DisplayManager, s/Lua/ApiHawk/ in DisplayManager
- Loading branch information
Showing
9 changed files
with
281 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7749d02
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This didn't actually fix #2571! >:( It is nearly there though, I just needed to call
UnlockSurface
when reinitialising theApiContainer
. I did this inDispose
: bba4286, a0ebb2f