Files
goldeneye-pc-port/port/include/video.h
T
James Dansereau aebcf178e6 D75 (M-195): GE_D75V per-batch vertex probe + findings/probes doc updates
- gfx_sp_vertex probe (env GE_D75V=lo-hi): logs per G_VTX batch the
  transformed x/y/z/w min/max, raw first-vertex ob, dest_index, and the
  MP translation row. Proves the logo transform is correct and that every
  batch encodes v0=0 (slot-overwrite hypothesis).
- videoGetFrameCount() accessor for frame-gated probes.
- findings.md: M-195 entry in the D75 section (emission + transform
  eliminated; G_VTX v0=0 overwrite is the leading suspect).
- GE-ENV-PROBES.md: register GE_D75V, bump reconciled line.
2026-09-21 05:14:57 -04:00

78 lines
2.7 KiB
C

#ifndef PORT_VIDEO_H
#define PORT_VIDEO_H
/*
* Video: SDL2 window + OpenGL context + frame pacing, on top of fast3d's
* window-manager / rendering APIs (port/fast3d).
*
* The game's VI (osViSetMode / osViSwapBuffer / ...) is mapped onto this
* layer by the libultra shims; the software RSP (fast3d) renders into the GL
* context owned here.
*/
#include <SDL.h>
#include <PR/ultratypes.h>
#include <PR/gbi.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Initialize the window + GL context. Returns 0 on success. */
/* Steam Deck first-run preset; must run after the config constructor and
* before configLoad() (see video.c). No-op effect once an ini exists. */
void videoApplySteamOSDefaults(void);
int videoInit(void);
void videoDestroy(void);
/* Frame boundary hooks, driven by the SP task shim (libultra.c). These run
* on the game's scheduler thread. */
void videoStartFrame(void);
void videoSubmitCommands(Gfx *cmds); /* runs the software RSP on the list */
void videoEndFrame(void);
/* Host-thread SDL event pump: keeps the window responsive (Windows only
* dispatches messages to the creating thread) and handles quit. Called in a
* loop from main(). Exits the process on QUIT/ESC/close. */
void videoPumpEvents(void);
/* The game's native video mode (NTSC 640x480, PAL 640x400). fast3d scales
* N64 screen coordinates into window pixels using this. */
void videoUpdateNativeResolution(s32 w, s32 h);
u32 videoGetFrameCount(void);
s32 videoGetNativeWidth(void);
s32 videoGetNativeHeight(void);
/* Offscreen framebuffers (fast3d GL FBOs) + texture cache control. */
s32 videoCreateFramebuffer(u32 w, u32 h, s32 upscale, s32 autoresize);
void videoCopyFramebuffer(s32 dst, s32 src, s32 left, s32 top);
void videoResetTextureCache(void);
/* Current FPS (measured). */
float videoGetFPS(void);
/* Re-apply the live-tunable [Video] knobs (VSync / FpsCap / TextureFilter) on
* the next frame start. Called by the F10 options overlay after an edit. */
void videoRequestLiveConfig(void);
/* F10 options overlay -> window/fullscreen changes. The overlay input handler
* runs on the scheduler thread; SDL window ops must run on the thread that
* created the window, so these only post a request that videoPumpEvents()
* (host thread) applies. The Get* helpers are read-only and thread-safe. */
void videoRequestWindowSize(int w, int h);
void videoRequestFullscreen(int on);
void videoGetWindowSize(int *w, int *h);
void videoGetDesktopSize(int *w, int *h);
int videoIsFullscreen(void);
/* Snapshot live window geometry into the config vars (call before configSave
* on a clean exit). No-op if the window isn't up. */
void videoSaveWindowState(void);
#ifdef __cplusplus
}
#endif
#endif /* PORT_VIDEO_H */