citra: Add OpenGL configuration

This commit is contained in:
Emmanuel Gil Peyrot 2014-11-19 11:56:28 +00:00
parent 45b5244e12
commit 22c2d51e21
4 changed files with 27 additions and 5 deletions

View File

@ -61,6 +61,11 @@ void Config::ReadValues() {
Settings::values.gpu_refresh_rate = glfw_config->GetInteger("Core", "gpu_refresh_rate", 30);
Settings::values.frame_skip = glfw_config->GetInteger("Core", "frame_skip", 0);
// OpenGL
Settings::values.opengl_version_major = glfw_config->GetReal("OpenGL", "version_major", 2);
Settings::values.opengl_version_minor = glfw_config->GetReal("OpenGL", "version_minor", 1);
Settings::values.opengl_flavor = glfw_config->Get("OpenGL", "flavor", "compatibility");
// Data Storage
Settings::values.use_virtual_sd = glfw_config->GetBoolean("Data Storage", "use_virtual_sd", true);

View File

@ -31,6 +31,12 @@ cpu_core = ## 0: Interpreter (default), 1: OldInterpreter (may work better, soon
gpu_refresh_rate = ## 30 (default)
frame_skip = ## 0: No frameskip (default), 1 : 2x frameskip, 2 : 4x frameskip, etc.
[OpenGL]
## Allowed values: 2.1 to 4.5 for compatibility, 3.1 to 4.5 for core and 2.0 to 3.1 for es (subject to driver restrictions)
version_major =
version_minor =
flavor = ## compatibility (default), core, gles
[Data Storage]
use_virtual_sd =

View File

@ -67,11 +67,17 @@ EmuWindow_GLFW::EmuWindow_GLFW() {
LOG_CRITICAL(Frontend, "Failed to initialize GLFW! Exiting...");
exit(1);
}
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, Settings::values.opengl_version_major);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, Settings::values.opengl_version_minor);
// Set hints for OpenGL core and GLES support.
if (Settings::values.opengl_flavor == "core") {
// GLFW on OSX requires these window hints to be set to create a 3.2+ GL context.
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
} else if (Settings::values.opengl_flavor == "gles") {
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
} // compatibility is assumed otherwise, and doesn't require any hint.
std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth,

View File

@ -33,6 +33,11 @@ struct Values {
int gpu_refresh_rate;
int frame_skip;
// OpenGL
std::string opengl_flavor;
int opengl_version_major;
int opengl_version_minor;
// Data Storage
bool use_virtual_sd;