Explorar o código

WIP: Getting OpenGL up to date
- GLSL strings are now passed to the compiler as one long string instead of individual lines, in order to aid the debugging tools reading them

BearishSun %!s(int64=8) %!d(string=hai) anos
pai
achega
05e9734e36
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      Source/BansheeGLRenderAPI/GLSL/BsGLSLGpuProgram.cpp

+ 7 - 1
Source/BansheeGLRenderAPI/GLSL/BsGLSLGpuProgram.cpp

@@ -213,7 +213,9 @@ namespace bs { namespace ct
 				numInsertedLines++;
 			}
 
-			mGLHandle = glCreateShaderProgramv(shaderType, (GLsizei)lines.size(), (const GLchar**)lines.data());
+			StringStream codeStream;
+			for(auto& entry : lines)
+				codeStream << entry;
 
 			for (INT32 i = numInsertedLines - 1; i >= 0; i--)
 				bs_stack_free(lines[extraLineOffset + i]);
@@ -224,6 +226,10 @@ namespace bs { namespace ct
 			for (auto iter = lines.rbegin(); iter != lines.rend(); ++iter)
 				bs_stack_free(*iter);
 
+			String code = codeStream.str();
+			const char* codeRaw = code.c_str();
+			mGLHandle = glCreateShaderProgramv(shaderType, 1, (const GLchar**)&codeRaw);
+
 			mCompileError = "";
 			mIsCompiled = !checkForGLSLError(mGLHandle, mCompileError);
 		}