Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/GameSetup/HWDetect.cpp
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 29 Lines | |||||
#include "ps/ConfigDB.h" | #include "ps/ConfigDB.h" | ||||
#include "ps/Filesystem.h" | #include "ps/Filesystem.h" | ||||
#include "ps/GameSetup/Config.h" | #include "ps/GameSetup/Config.h" | ||||
#include "ps/Profile.h" | #include "ps/Profile.h" | ||||
#include "ps/scripting/JSInterface_Debug.h" | #include "ps/scripting/JSInterface_Debug.h" | ||||
#include "ps/UserReport.h" | #include "ps/UserReport.h" | ||||
#include "ps/VideoMode.h" | #include "ps/VideoMode.h" | ||||
#ifdef SDL_VIDEO_DRIVER_X11 | // TODO: Support OpenGL platforms which don’t use GLX as well. | ||||
#if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES | |||||
#include <GL/glx.h> | #include <GL/glx.h> | ||||
#include "SDL_syswm.h" | #include "SDL_syswm.h" | ||||
// Define the GLX_MESA_query_renderer macros if built with | // Define the GLX_MESA_query_renderer macros if built with | ||||
// an old Mesa (<10.0) that doesn't provide them | // an old Mesa (<10.0) that doesn't provide them | ||||
#ifndef GLX_MESA_query_renderer | #ifndef GLX_MESA_query_renderer | ||||
#define GLX_MESA_query_renderer 1 | #define GLX_MESA_query_renderer 1 | ||||
#define GLX_RENDERER_VENDOR_ID_MESA 0x8183 | #define GLX_RENDERER_VENDOR_ID_MESA 0x8183 | ||||
▲ Show 20 Lines • Show All 651 Lines • ▼ Show 20 Lines | #else // CONFIG2_GLES | ||||
INTEGER(MAX_VERTEX_TEXTURE_IMAGE_UNITS); | INTEGER(MAX_VERTEX_TEXTURE_IMAGE_UNITS); | ||||
INTEGER(MAX_FRAGMENT_UNIFORM_VECTORS); | INTEGER(MAX_FRAGMENT_UNIFORM_VECTORS); | ||||
INTEGER(MAX_TEXTURE_IMAGE_UNITS); | INTEGER(MAX_TEXTURE_IMAGE_UNITS); | ||||
INTEGER(MAX_RENDERBUFFER_SIZE); | INTEGER(MAX_RENDERBUFFER_SIZE); | ||||
#endif // CONFIG2_GLES | #endif // CONFIG2_GLES | ||||
#ifdef SDL_VIDEO_DRIVER_X11 | // TODO: Support OpenGL platforms which don’t use GLX as well. | ||||
#if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES | |||||
#define GLXQCR_INTEGER(id) do { \ | #define GLXQCR_INTEGER(id) do { \ | ||||
unsigned int i = UINT_MAX; \ | unsigned int i = UINT_MAX; \ | ||||
if (pglXQueryCurrentRendererIntegerMESA(id, &i)) \ | if (pglXQueryCurrentRendererIntegerMESA(id, &i)) \ | ||||
scriptInterface.SetProperty(settings, #id, i); \ | scriptInterface.SetProperty(settings, #id, i); \ | ||||
} while (false) | } while (false) | ||||
#define GLXQCR_INTEGER2(id) do { \ | #define GLXQCR_INTEGER2(id) do { \ | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator