Simplifying GPU creation.

Part of #296.
This commit is contained in:
Ben Vanik
2015-06-27 09:11:03 -07:00
parent 3439641101
commit 883126d497
13 changed files with 56 additions and 145 deletions

View File

@@ -15,9 +15,29 @@
#include "xenia/gpu/gpu-private.h"
#include "xenia/kernel/objects/xthread.h"
// TODO(benvanik): based on platform/build support.
#include "xenia/gpu/gl4/gl4_graphics_system.h"
namespace xe {
namespace gpu {
std::unique_ptr<GraphicsSystem> GraphicsSystem::Create(Emulator* emulator) {
if (FLAGS_gpu.compare("gl4") == 0) {
return xe::gpu::gl4::GL4GraphicsSystem::Create(emulator);
} else {
// Create best available.
std::unique_ptr<GraphicsSystem> best;
best = xe::gpu::gl4::GL4GraphicsSystem::Create(emulator);
if (best) {
return best;
}
// Nothing!
return nullptr;
}
}
GraphicsSystem::GraphicsSystem(Emulator* emulator)
: emulator_(emulator),
memory_(nullptr),