mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 08:26:50 +00:00
Refactor demo API test initialisation order
* Instead of only doing a very lightweight check to see if the API is available up-front, we now share the API initialisation among all API tests far enough to determine availability of extensions, features, etc. Then we can precisely determine which tests are available and which aren't before running.
This commit is contained in:
@@ -29,10 +29,28 @@
|
||||
|
||||
#include "../linux/linux_window.h"
|
||||
|
||||
bool OpenGLGraphicsTest::Init(int argc, char **argv)
|
||||
void OpenGLGraphicsTest::Prepare(int argc, char **argv)
|
||||
{
|
||||
// parse parameters here to override parameters
|
||||
GraphicsTest::Init(argc, argv);
|
||||
GraphicsTest::Prepare(argc, argv);
|
||||
|
||||
static bool prepared = false;
|
||||
static void *libGL = NULL;
|
||||
|
||||
if(!prepared)
|
||||
{
|
||||
prepared = true;
|
||||
|
||||
libGL = dlopen("libGL.so", RTLD_GLOBAL | RTLD_NOW);
|
||||
}
|
||||
|
||||
if(!libGL)
|
||||
Avail = "libGL.so is not available";
|
||||
}
|
||||
|
||||
bool OpenGLGraphicsTest::Init()
|
||||
{
|
||||
if(!GraphicsTest::Init())
|
||||
return false;
|
||||
|
||||
X11Window::Init();
|
||||
|
||||
@@ -65,23 +83,6 @@ bool OpenGLGraphicsTest::Init(int argc, char **argv)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OpenGLGraphicsTest::IsSupported()
|
||||
{
|
||||
static bool checked = false, result = false;
|
||||
|
||||
if(checked)
|
||||
return result;
|
||||
|
||||
checked = true;
|
||||
|
||||
void *GL = dlopen("libGL.so", RTLD_GLOBAL | RTLD_NOW);
|
||||
|
||||
if(GL)
|
||||
result = true;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
GraphicsWindow *OpenGLGraphicsTest::MakeWindow(int width, int height, const char *title)
|
||||
{
|
||||
return new X11Window(width, height, title);
|
||||
|
||||
Reference in New Issue
Block a user