forked from Ports/goldeneye-pc-port
Quit (quit event, window close, Alt+F4, from either SDL pump) used to exit(0) immediately while the render thread could be mid-frame in the driver: the likely trigger of the host's 0x119 bugchecks. Now quits are requested; the render thread glFinish()es, unbinds the context and parks at a frame boundary, and the host exits after (max 2 s). GE_QUITFRAME=<n> gives the harness a clean self-quit; golden_gate.sh uses it.
31 lines
835 B
C
31 lines
835 B
C
#ifndef GFX_SDL_H
|
|
#define GFX_SDL_H
|
|
|
|
#include "gfx_window_manager_api.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern struct GfxWindowManagerAPI gfx_sdl;
|
|
|
|
/* Make the window's GL context current on the calling thread (rendering
|
|
* runs on the game's scheduler thread, not the thread that created it). */
|
|
void gfx_sdl_make_context_current(void);
|
|
|
|
/* Release the GL context from the calling (host main) thread after init, so
|
|
* the game's scheduler thread can bind it per frame (see gfx_sdl2.cpp). */
|
|
void gfx_sdl_release_context(void);
|
|
/* D344: finish queued GL work and unbind the context (render thread, quit). */
|
|
void gfx_sdl_park_for_exit(void);
|
|
|
|
/* Refresh the cached drawable size after a window resize (called by the
|
|
* host thread's event pump). */
|
|
void gfx_sdl_update_cached_size(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|