Headless: Run OpenGL offscreen on macOS, without a window

A CGL context with no drawable, rendering into a framebuffer object of its
own that stands in for the backbuffer through g_defaultFBO. Core profile,
as the SDL app uses on macOS.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-09-25 09:47:58 -06:00
1 parent c9cddb99e9
commit ea101b714f
3 files changed
+151

No files matched your search

+5
View File
@@ -966,6 +966,11 @@ int main(int argc, const char* argv[]) {
vulkanContext->SetOffscreen(480, 272);
graphicsContext = vulkanContext;
deviceSetting = &g_Config.sVulkanDevice;
#if PPSSPP_PLATFORM(MAC) && defined(SDL)
} else if (gpuCore == GPUCORE_GLES) {
// So does OpenGL, into a framebuffer object of its own.
graphicsContext = new CGLHeadlessGraphicsContext(480, 272);
#endif
} else {
// TODO: Will we need a larger window for higher resolutions? Well, not if we use buffered rendering.
window = CreateHiddenWindow(480, 272, cmdLineOptions.gpuBackend.value_or(GPUBackend::OPENGL), &windowDesc);