mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
OpenGL: use FFOpenGLOptions in detection code
This commit is contained in:
@@ -13,6 +13,6 @@ typedef struct FFOpenGLResult
|
||||
FFstrbuf slv;
|
||||
} FFOpenGLResult;
|
||||
|
||||
const char* ffDetectOpenGL(FFOpenGLResult* result);
|
||||
const char* ffDetectOpenGL(FFOpenGLOptions* options, FFOpenGLResult* result);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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[] = {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user