[Tizen] Add codes for Dali Windows Backend
[platform/core/uifw/dali-core.git] / dali / internal / render / shaders / program.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 5739f18..530b629
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -248,7 +248,7 @@ void Program::GetActiveSamplerUniforms()
   mGlAbstraction.GetProgramiv( mProgramId, GL_ACTIVE_UNIFORM_MAX_LENGTH, &uniformMaxNameLength );
 
   std::vector<std::string> samplerNames;
-  char name[uniformMaxNameLength+1]; // Allow for null terminator
+  std::vector<char> name(uniformMaxNameLength + 1); // Allow for null terminator
   std::vector< LocationPosition >  samplerUniformLocations;
 
   {
@@ -258,13 +258,13 @@ void Program::GetActiveSamplerUniforms()
 
     for( int i=0; i<numberOfActiveUniforms; ++i )
     {
-      mGlAbstraction.GetActiveUniform( mProgramId, (GLuint)i, uniformMaxNameLength,
-                                       &nameLength, &number, &type, name );
+      mGlAbstraction.GetActiveUniform( mProgramId, static_cast< GLuint >( i ), uniformMaxNameLength,
+                                       &nameLength, &number, &type, name.data() );
 
       if( type == GL_SAMPLER_2D || type == GL_SAMPLER_CUBE || type == GL_SAMPLER_EXTERNAL_OES )
       {
-        GLuint location = mGlAbstraction.GetUniformLocation( mProgramId, name );
-        samplerNames.push_back(name);
+        GLuint location = mGlAbstraction.GetUniformLocation( mProgramId, name.data() );
+        samplerNames.push_back( name.data() );
         samplerUniformLocations.push_back(LocationPosition(location, -1));
       }
     }