From bc6ed4f4a27616ce3f4a126e7d22a76748ef3e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 24 Aug 2023 09:55:00 +0800 Subject: [PATCH] OpenGL: use `FFOpenGLOptions` in detection code --- src/detection/opengl/opengl.h | 2 +- src/detection/opengl/opengl_apple.c | 2 +- src/detection/opengl/opengl_linux.c | 8 ++++---- src/detection/opengl/opengl_windows.c | 2 +- src/modules/opengl/opengl.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/detection/opengl/opengl.h b/src/detection/opengl/opengl.h index b4426856b..fbd9e897d 100644 --- a/src/detection/opengl/opengl.h +++ b/src/detection/opengl/opengl.h @@ -13,6 +13,6 @@ typedef struct FFOpenGLResult FFstrbuf slv; } FFOpenGLResult; -const char* ffDetectOpenGL(FFOpenGLResult* result); +const char* ffDetectOpenGL(FFOpenGLOptions* options, FFOpenGLResult* result); #endif diff --git a/src/detection/opengl/opengl_apple.c b/src/detection/opengl/opengl_apple.c index b6f4fe257..e7f3ad0e9 100644 --- a/src/detection/opengl/opengl_apple.c +++ b/src/detection/opengl/opengl_apple.c @@ -35,7 +35,7 @@ static const char* cglHandlePixelFormat(FFOpenGLResult* result, CGLPixelFormatOb return error; } -const char* ffDetectOpenGL(FFOpenGLResult* result) +const char* ffDetectOpenGL(FF_MAYBE_UNUSED FFOpenGLOptions* options, FFOpenGLResult* result) { CGLPixelFormatObj pixelFormat; CGLPixelFormatAttribute attrs[] = { diff --git a/src/detection/opengl/opengl_linux.c b/src/detection/opengl/opengl_linux.c index 43378be63..8da49361b 100644 --- a/src/detection/opengl/opengl_linux.c +++ b/src/detection/opengl/opengl_linux.c @@ -314,11 +314,11 @@ static const char* osMesaPrint(FFOpenGLResult* result) #endif //FF_HAVE_OSMESA -const char* ffDetectOpenGL(FFOpenGLResult* result) +const char* ffDetectOpenGL(FFOpenGLOptions* options, FFOpenGLResult* result) { #if FF_HAVE_GL - if(instance.config.openGL.library == FF_OPENGL_LIBRARY_GLX) + if(options->library == FF_OPENGL_LIBRARY_GLX) { #ifdef FF_HAVE_GLX return glxPrint(result); @@ -327,7 +327,7 @@ const char* ffDetectOpenGL(FFOpenGLResult* result) #endif } - if(instance.config.openGL.library == FF_OPENGL_LIBRARY_EGL) + if(options->library == FF_OPENGL_LIBRARY_EGL) { #ifdef FF_HAVE_EGL return eglPrint(result); @@ -336,7 +336,7 @@ const char* ffDetectOpenGL(FFOpenGLResult* result) #endif } - if(instance.config.openGL.library == FF_OPENGL_LIBRARY_OSMESA) + if(options->library == FF_OPENGL_LIBRARY_OSMESA) { #ifdef FF_HAVE_OSMESA return osMesaPrint(result); diff --git a/src/detection/opengl/opengl_windows.c b/src/detection/opengl/opengl_windows.c index 11d608db5..d1b2eb67f 100644 --- a/src/detection/opengl/opengl_windows.c +++ b/src/detection/opengl/opengl_windows.c @@ -82,7 +82,7 @@ LRESULT CALLBACK wglHandleWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM } } -const char* ffDetectOpenGL(FFOpenGLResult* result) +const char* ffDetectOpenGL(FF_MAYBE_UNUSED FFOpenGLOptions* options, FFOpenGLResult* result) { MSG msg = {0}; WNDCLASSW wc = { diff --git a/src/modules/opengl/opengl.c b/src/modules/opengl/opengl.c index 81e960de9..d94849cf5 100644 --- a/src/modules/opengl/opengl.c +++ b/src/modules/opengl/opengl.c @@ -14,7 +14,7 @@ void ffPrintOpenGL(FFOpenGLOptions* options) ffStrbufInit(&result.vendor); ffStrbufInit(&result.slv); - const char* error = ffDetectOpenGL(&result); + const char* error = ffDetectOpenGL(options, &result); if(error) { ffPrintError(FF_OPENGL_MODULE_NAME, 0, &options->moduleArgs, "%s", error);