16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-17 23:39:18 +02:00

add gfx.angleplatform ini setting

This commit is contained in:
milek7
2021-01-21 22:15:57 +01:00
parent 1374dec99c
commit 7cacab0dc8
9 changed files with 443 additions and 164 deletions

View File

@@ -878,6 +878,11 @@ global_settings::ConfigParse(cParser &Parser) {
Parser.getTokens(1);
Parser >> gfx_usegles;
}
else if (token == "gfx.angleplatform")
{
Parser.getTokens(1);
Parser >> gfx_angleplatform;
}
else if (token == "gfx.shadergamma")
{
Parser.getTokens(1);

View File

@@ -250,6 +250,7 @@ struct global_settings {
bool gfx_extraeffects = true;
bool gfx_shadergamma = false;
bool gfx_usegles = false;
std::string gfx_angleplatform;
bool vr = false;
std::string vr_backend;

View File

@@ -707,6 +707,31 @@ eu07_application::init_locale() {
int
eu07_application::init_glfw() {
{
int glfw_major, glfw_minor, glfw_rev;
glfwGetVersion(&glfw_major, &glfw_minor, &glfw_rev);
m_glfwversion = glfw_major * 10000 + glfw_minor * 100 + glfw_minor;
}
#ifdef GLFW_ANGLE_PLATFORM_TYPE
if (m_glfwversion >= 30400) {
int platform = GLFW_ANGLE_PLATFORM_TYPE_NONE;
if (Global.gfx_angleplatform == "opengl")
platform = GLFW_ANGLE_PLATFORM_TYPE_OPENGL;
else if (Global.gfx_angleplatform == "opengles")
platform = GLFW_ANGLE_PLATFORM_TYPE_OPENGLES;
else if (Global.gfx_angleplatform == "d3d9")
platform = GLFW_ANGLE_PLATFORM_TYPE_D3D9;
else if (Global.gfx_angleplatform == "d3d11")
platform = GLFW_ANGLE_PLATFORM_TYPE_D3D11;
else if (Global.gfx_angleplatform == "vulkan")
platform = GLFW_ANGLE_PLATFORM_TYPE_VULKAN;
else if (Global.gfx_angleplatform == "metal")
platform = GLFW_ANGLE_PLATFORM_TYPE_METAL;
glfwInitHint(GLFW_ANGLE_PLATFORM_TYPE, platform);
}
#endif
if( glfwInit() == GLFW_FALSE ) {
ErrorLog( "Bad init: failed to initialize glfw" );
@@ -745,7 +770,8 @@ eu07_application::init_glfw() {
}
else {
#ifdef GLFW_CONTEXT_CREATION_API
glfwWindowHint( GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API );
if (m_glfwversion >= 30200)
glfwWindowHint( GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API );
#endif
glfwWindowHint( GLFW_CLIENT_API, GLFW_OPENGL_ES_API );
glfwWindowHint( GLFW_CONTEXT_VERSION_MAJOR, 3 );

View File

@@ -120,6 +120,7 @@ private:
mode_stack m_modestack; // current behaviour mode
python_taskqueue m_taskqueue;
std::vector<GLFWwindow *> m_windows;
int m_glfwversion;
std::optional<network::manager> m_network;
std::optional<headtrack> m_headtrack;

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.