From 22d83bc9f655d5ae7a1b49709c4c1b663725daf5 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 3 Oct 2016 16:33:42 -0300 Subject: Begining of GLES3 renderer: -Most 2D drawing is implemented -Missing shaders -Missing all 3D -Editor needs to be set on update always to be used, otherwise it does not refresh -Large parts of editor not working --- platform/x11/os_x11.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'platform/x11/os_x11.cpp') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 5f1ab5b4aa..d2d6e88c4b 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -27,7 +27,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "servers/visual/visual_server_raster.h" -#include "drivers/gles2/rasterizer_gles2.h" +#include "drivers/gles3/rasterizer_gles3.h" #include "os_x11.h" #include "key_mapping_x11.h" #include @@ -74,7 +74,7 @@ int OS_X11::get_video_driver_count() const { } const char * OS_X11::get_video_driver_name(int p_driver) const { - return "GLES2"; + return "GLES3"; } OS::VideoMode OS_X11::get_default_video_mode() const { @@ -203,19 +203,22 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi //print_line("def videomode "+itos(current_videomode.width)+","+itos(current_videomode.height)); #if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) + context_gl = memnew( ContextGL_X11( x11_display, x11_window,current_videomode, false ) ); context_gl->initialize(); - rasterizer = memnew( RasterizerGLES2 ); + RasterizerGLES3::register_config(); -#endif - visual_server = memnew( VisualServerRaster(rasterizer) ); + RasterizerGLES3::make_current(); +#endif + visual_server = memnew( VisualServerRaster ); +#if 0 if (get_render_thread_mode()!=RENDER_THREAD_UNSAFE) { visual_server =memnew(VisualServerWrapMT(visual_server,get_render_thread_mode()==RENDER_SEPARATE_THREAD)); } - +#endif // borderless fullscreen window mode if (current_videomode.fullscreen) { // needed for lxde/openbox, possibly others @@ -487,7 +490,7 @@ void OS_X11::finalize() { visual_server->finish(); memdelete(visual_server); - memdelete(rasterizer); + //memdelete(rasterizer); physics_server->finish(); memdelete(physics_server); @@ -1878,7 +1881,7 @@ void OS_X11::set_icon(const Image& p_icon) { if (!p_icon.empty()) { Image img=p_icon; - img.convert(Image::FORMAT_RGBA); + img.convert(Image::FORMAT_RGBA8); int w = img.get_width(); int h = img.get_height(); -- cgit v1.2.3 From b5c383fd61d554fa02c3e231dd1f92145d90e04e Mon Sep 17 00:00:00 2001 From: ISylvox Date: Tue, 8 Nov 2016 21:06:57 +0700 Subject: vsnc --> vsync --- platform/x11/os_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/x11/os_x11.cpp') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 5f1ab5b4aa..0172dca4c4 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1951,7 +1951,7 @@ void OS_X11::set_use_vsync(bool p_enable) { return context_gl->set_use_vsync(p_enable); } -bool OS_X11::is_vsnc_enabled() const { +bool OS_X11::is_vsync_enabled() const { if (context_gl) return context_gl->is_using_vsync(); -- cgit v1.2.3 From 8d3efe2b7de494c0971d4b7f7af6ed0dc2f4613c Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Wed, 16 Nov 2016 02:04:39 +0100 Subject: X11: Fix maximized boot splash When instructing the window manager to (un)maximize a window, the resulting resolution is recieved via an XEvent of type "ConfigureNotify". The problem here was that these events were only handled in the `OS_X11::process_xevents()` method, which is initially called on the first iteration of the main loop. Because of this, the VideoMode still hadn't been updated yet when doing the boot splash setup. --- platform/x11/os_x11.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) mode change 100644 => 100755 platform/x11/os_x11.cpp (limited to 'platform/x11/os_x11.cpp') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp old mode 100644 new mode 100755 index 0172dca4c4..65f546e2ee --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -880,6 +880,9 @@ bool OS_X11::is_window_minimized() const { } void OS_X11::set_window_maximized(bool p_enabled) { + + if (is_window_maximized() == p_enabled) return; + // Using EWMH -- Extended Window Manager Hints XEvent xev; Atom wm_state = XInternAtom(x11_display, "_NET_WM_STATE", False); @@ -898,6 +901,23 @@ void OS_X11::set_window_maximized(bool p_enabled) { XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); maximized = p_enabled; + + //wait until the window has been resized and update video mode + while (true) { + XEvent ev; + XNextEvent(x11_display, &ev); + if (ev.type == ConfigureNotify) { + XConfigureEvent &xc = ev.xconfigure; + if (xc.send_event == 1 && + (xc.width == get_screen_size(get_current_screen()).width || (!p_enabled && xc.width < current_videomode.width))) { + + current_videomode.width=xc.width; + current_videomode.height=xc.height; + break; + }; + } + }; + } bool OS_X11::is_window_maximized() const { @@ -1990,6 +2010,7 @@ OS_X11::OS_X11() { AudioDriverManagerSW::add_driver(&driver_alsa); #endif + maximized = false; minimized = false; xim_style=0L; mouse_mode=MOUSE_MODE_VISIBLE; -- cgit v1.2.3 From 9d635f06298f84a59160e8e8cce0187cde6cf74e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 22 Nov 2016 20:51:56 -0300 Subject: Migrated from GLES to GLAD, fixes many issues. --- platform/x11/os_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/x11/os_x11.cpp') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index d2d6e88c4b..581a930143 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -204,7 +204,7 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi #if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED) - context_gl = memnew( ContextGL_X11( x11_display, x11_window,current_videomode, false ) ); + context_gl = memnew( ContextGL_X11( x11_display, x11_window,current_videomode, true ) ); context_gl->initialize(); RasterizerGLES3::register_config(); -- cgit v1.2.3 From f18470c199ae79cc7a1e6e952780fb0899b74c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 23 Nov 2016 07:53:31 +0100 Subject: Revert "X11: Fix maximized boot splash" This reverts commit 8d3efe2b7de494c0971d4b7f7af6ed0dc2f4613c. It introduced crashes for some users when trying to capture the XConfigureNotify event. --- platform/x11/os_x11.cpp | 21 --------------------- 1 file changed, 21 deletions(-) mode change 100755 => 100644 platform/x11/os_x11.cpp (limited to 'platform/x11/os_x11.cpp') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp old mode 100755 new mode 100644 index 65f546e2ee..0172dca4c4 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -880,9 +880,6 @@ bool OS_X11::is_window_minimized() const { } void OS_X11::set_window_maximized(bool p_enabled) { - - if (is_window_maximized() == p_enabled) return; - // Using EWMH -- Extended Window Manager Hints XEvent xev; Atom wm_state = XInternAtom(x11_display, "_NET_WM_STATE", False); @@ -901,23 +898,6 @@ void OS_X11::set_window_maximized(bool p_enabled) { XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); maximized = p_enabled; - - //wait until the window has been resized and update video mode - while (true) { - XEvent ev; - XNextEvent(x11_display, &ev); - if (ev.type == ConfigureNotify) { - XConfigureEvent &xc = ev.xconfigure; - if (xc.send_event == 1 && - (xc.width == get_screen_size(get_current_screen()).width || (!p_enabled && xc.width < current_videomode.width))) { - - current_videomode.width=xc.width; - current_videomode.height=xc.height; - break; - }; - } - }; - } bool OS_X11::is_window_maximized() const { @@ -2010,7 +1990,6 @@ OS_X11::OS_X11() { AudioDriverManagerSW::add_driver(&driver_alsa); #endif - maximized = false; minimized = false; xim_style=0L; mouse_mode=MOUSE_MODE_VISIBLE; -- cgit v1.2.3 From 2495e8a9410d8b6e21628ea26814148617d5327f Mon Sep 17 00:00:00 2001 From: Gustav Lund Date: Mon, 12 Dec 2016 08:26:22 +0100 Subject: fix for crash when no ALSA or Pulse installed on linux --- platform/x11/os_x11.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'platform/x11/os_x11.cpp') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 0172dca4c4..0179480efa 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1990,6 +1990,11 @@ OS_X11::OS_X11() { AudioDriverManagerSW::add_driver(&driver_alsa); #endif + if(AudioDriverManagerSW::get_driver_count() == 0){ + WARN_PRINT("No sound driver found... Defaulting to dummy driver"); + AudioDriverManagerSW::add_driver(&driver_dummy); + } + minimized = false; xim_style=0L; mouse_mode=MOUSE_MODE_VISIBLE; -- cgit v1.2.3 From c7bc44d5ad9aae4902280012f7654e2318cd910e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 1 Jan 2017 22:01:57 +0100 Subject: Welcome in 2017, dear changelog reader! That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games! --- platform/x11/os_x11.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/x11/os_x11.cpp') diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 0179480efa..4d8ddeb79a 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ -- cgit v1.2.3