diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-01-06 07:35:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-06 07:35:12 +0100 |
commit | cab97f4b504a67955108b5346e033502cae636fc (patch) | |
tree | c3f3cbc73131b93b910f206dc009ffab2136efc8 /drivers/gles2 | |
parent | d968d032e91412ae980d6415f625c3b1e65fd9fa (diff) | |
parent | 0cad2c0cd103a7d616d55e4d5c973a20f398115f (diff) |
Merge pull request #32126 from Calinou/expose-video-adapter-name-vendor
Add VisualServer methods to get the video adapter name and vendor
Diffstat (limited to 'drivers/gles2')
-rw-r--r-- | drivers/gles2/rasterizer_gles2.cpp | 3 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.cpp | 10 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_storage_gles2.h | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index cac124ff5f..c4e9541a36 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -263,8 +263,7 @@ void RasterizerGLES2::initialize() { #endif // GLES_OVER_GL #endif // CAN_DEBUG - const GLubyte *renderer = glGetString(GL_RENDERER); - print_line("OpenGL ES 2.0 Renderer: " + String((const char *)renderer)); + print_line("OpenGL ES 2.0 Renderer: " + VisualServer::get_singleton()->get_video_adapter_name()); storage->initialize(); canvas->initialize(); scene->initialize(); diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp index 94a7d4e1b5..bb087a7f47 100644 --- a/drivers/gles2/rasterizer_storage_gles2.cpp +++ b/drivers/gles2/rasterizer_storage_gles2.cpp @@ -5766,6 +5766,16 @@ int RasterizerStorageGLES2::get_render_info(VS::RenderInfo p_info) { } } +String RasterizerStorageGLES2::get_video_adapter_name() const { + + return (const char *)glGetString(GL_RENDERER); +} + +String RasterizerStorageGLES2::get_video_adapter_vendor() const { + + return (const char *)glGetString(GL_VENDOR); +} + void RasterizerStorageGLES2::initialize() { RasterizerStorageGLES2::system_fbo = 0; diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h index 62926ce713..83697b9872 100644 --- a/drivers/gles2/rasterizer_storage_gles2.h +++ b/drivers/gles2/rasterizer_storage_gles2.h @@ -1307,6 +1307,8 @@ public: virtual int get_captured_render_info(VS::RenderInfo p_info); virtual int get_render_info(VS::RenderInfo p_info); + virtual String get_video_adapter_name() const; + virtual String get_video_adapter_vendor() const; RasterizerStorageGLES2(); }; |