summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorlawnjelly <lawnjelly@gmail.com>2020-11-18 18:11:30 +0000
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-10-30 02:05:48 +0200
commite3491a37445014cc3527d6f2c1467063222b2dd8 (patch)
tree7f8250aee66fbc382040f0c843a91a5f85238d45 /core
parentd046817536a21358f9c51bf5b932d0a6615ee76a (diff)
Add GLES2 2D renderer + Linux display manager
First implementation with Linux display manager. - Add single-threaded mode for EditorResourcePreview (needed for OpenGL). Co-authored-by: clayjohn <claynjohn@gmail.com> Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/os/os.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/os/os.h b/core/os/os.h
index 2700759fef..f02f600c58 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -68,6 +68,11 @@ class OS {
bool restart_on_exit = false;
List<String> restart_commandline;
+ // for the user interface we keep a record of the current display driver
+ // so we can retrieve the rendering drivers available
+ int _display_driver_id = -1;
+ String _current_rendering_driver_name = "";
+
protected:
void _set_logger(CompositeLogger *p_logger);
@@ -81,6 +86,11 @@ public:
RENDER_SEPARATE_THREAD
};
+ enum RenderMainThreadMode {
+ RENDER_MAIN_THREAD_ONLY,
+ RENDER_ANY_THREAD,
+ };
+
protected:
friend class Main;
// Needed by tests to setup command-line args.
@@ -88,6 +98,7 @@ protected:
HasServerFeatureCallback has_server_feature_callback = nullptr;
RenderThreadMode _render_thread_mode = RENDER_THREAD_SAFE;
+ RenderMainThreadMode _render_main_thread_mode = RENDER_ANY_THREAD;
// Functions used by Main to initialize/deinitialize the OS.
void add_logger(Logger *p_logger);
@@ -95,6 +106,9 @@ protected:
virtual void initialize() = 0;
virtual void initialize_joypads() = 0;
+ void set_current_rendering_driver_name(String p_driver_name) { _current_rendering_driver_name = p_driver_name; }
+ void set_display_driver_id(int p_display_driver_id) { _display_driver_id = p_display_driver_id; }
+
virtual void set_main_loop(MainLoop *p_main_loop) = 0;
virtual void delete_main_loop() = 0;
@@ -110,6 +124,9 @@ public:
static OS *get_singleton();
+ String get_current_rendering_driver_name() const { return _current_rendering_driver_name; }
+ int get_display_driver_id() const { return _display_driver_id; }
+
void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, bool p_editor_notify = false, Logger::ErrorType p_type = Logger::ERR_ERROR);
void print(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;
void printerr(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;
@@ -241,6 +258,8 @@ public:
virtual uint64_t get_free_static_memory() const;
RenderThreadMode get_render_thread_mode() const { return _render_thread_mode; }
+ RenderMainThreadMode get_render_main_thread_mode() const { return _render_main_thread_mode; }
+ void set_render_main_thread_mode(RenderMainThreadMode p_thread_mode) { _render_main_thread_mode = p_thread_mode; }
virtual String get_locale() const;
String get_locale_language() const;