changeset 1332:be614695747d broker

std::string in viewport ctor
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 31 Mar 2020 10:59:00 +0200
parents ab81ee8fce1f
children 5b731e176236
files Framework/Viewport/SdlViewport.cpp Framework/Viewport/SdlViewport.h
diffstat 2 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Viewport/SdlViewport.cpp	Mon Mar 30 14:23:46 2020 +0200
+++ b/Framework/Viewport/SdlViewport.cpp	Tue Mar 31 10:59:00 2020 +0200
@@ -74,19 +74,20 @@
   }
 
   
-  SdlOpenGLViewport::SdlOpenGLViewport(const char* title,
+  SdlOpenGLViewport::SdlOpenGLViewport(const std::string& title,
                                        unsigned int width,
                                        unsigned int height,
                                        bool allowDpiScaling) :
-    context_(title, width, height, allowDpiScaling)
+    context_(title.c_str(), width, height, allowDpiScaling)
   {
     AcquireCompositor(new OpenGLCompositor(context_));  // (*)
   }
 
-  boost::shared_ptr<SdlOpenGLViewport> SdlOpenGLViewport::Create(const char* title,
-                                                                 unsigned int width,
-                                                                 unsigned int height,
-                                                                 bool allowDpiScaling)
+  boost::shared_ptr<SdlOpenGLViewport> SdlOpenGLViewport::Create(
+    const std::string& title,
+    unsigned int width,
+    unsigned int height,
+    bool allowDpiScaling)
   {
     boost::shared_ptr<SdlOpenGLViewport> that =
       boost::shared_ptr<SdlOpenGLViewport>(new SdlOpenGLViewport(title, width, height, allowDpiScaling));
--- a/Framework/Viewport/SdlViewport.h	Mon Mar 30 14:23:46 2020 +0200
+++ b/Framework/Viewport/SdlViewport.h	Tue Mar 31 10:59:00 2020 +0200
@@ -135,12 +135,12 @@
     SdlOpenGLContext  context_;
 
   private:
-    SdlOpenGLViewport(const char* title,
-                      unsigned int width,
-                      unsigned int height,
-                      bool allowDpiScaling = true);
+    SdlOpenGLViewport(const std::string& title,
+                      unsigned int       width,
+                      unsigned int       height,
+                      bool               allowDpiScaling = true);
   public:
-    static boost::shared_ptr<SdlOpenGLViewport> Create(const char* title,
+    static boost::shared_ptr<SdlOpenGLViewport> Create(const std::string&,
                                                        unsigned int width,
                                                        unsigned int height,
                                                        bool allowDpiScaling = true);