Tags: 2000-2024/BizHawk
Tags
Refactor DisplaySurface locking as used by ApiHawk (and Lua) (TASEmul… …ators#2575) * Refactor how the "emu" drawing surface is automatically opened/closed fixes TASEmulators#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
PreviousNext