1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

opengl3 driver now works on windows including multi window

fixed and simplified gl_manager_windows
swap buffers now called for all windows
fixed missing pixel format setting in additional windows
    this makes them work in OpenGL contexts
changed verbose error printing to write once
    this error message happens very frequently while opengl3 is not finished
removed dead code no longer needed after changes
fixed comments that were misinformation
window messages during window creation now handled
    these were previously discarded
    messages now tunnel the required context
changed failure to create opengl3 window on windows to be more fatal
marked a problem with pen code
conditional compilation of vulkan and opengl3 on windows fixed
windows debug builds now show messages on debug console also
rendering driver selection box now shows only compiled drivers
marked some problematic code
thanks to akien-mga for patiently rewriting my style mistakes
This commit is contained in:
derammo
2022-05-08 19:25:49 -04:00
parent 943b509952
commit 96c21bc749
13 changed files with 230 additions and 86 deletions

View File

@@ -641,6 +641,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
bool found_project = false;
#endif
String default_renderer = "";
String renderer_hints = "";
packed_data = PackedData::get_singleton();
if (!packed_data) {
packed_data = memnew(PackedData);
@@ -1306,14 +1309,33 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
// possibly be worth changing the default from vulkan to something lower spec,
// for the project manager, depending on how smooth the fallback is.
GLOBAL_DEF_RST("rendering/driver/driver_name", "vulkan");
// this list is hard coded, which makes it more difficult to add new backends.
// can potentially be changed to more of a plugin system at a later date.
// Start with Vulkan, which will be the default if enabled.
#ifdef VULKAN_ENABLED
renderer_hints = "vulkan";
#endif
// And OpenGL3 next, or first if Vulkan is disabled.
#ifdef GLES3_ENABLED
if (!renderer_hints.is_empty()) {
renderer_hints += ",";
}
renderer_hints += "opengl3";
#endif
if (renderer_hints.is_empty()) {
ERR_PRINT("No rendering driver available.");
}
default_renderer = renderer_hints.get_slice(",", 0);
GLOBAL_DEF_RST("rendering/driver/driver_name", default_renderer);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/driver/driver_name",
PropertyInfo(Variant::STRING,
"rendering/driver/driver_name",
PROPERTY_HINT_ENUM, "vulkan,opengl3"));
PROPERTY_HINT_ENUM, renderer_hints));
// if not set on the command line
if (rendering_driver.is_empty()) {