const CompiledShaderPtr ShaderCompiler::Compile(const char*const pszShader, const GLint shaderType) { const char* shaderCode[1] = { pszShader }; CompiledShaderPtr compiledShader(new CompiledShader(shaderType)); GL_CHECKERR(glShaderSource(compiledShader->GetShaderHandle(), 1, shaderCode, nullptr)); shaderCode[0] = nullptr; // Lets compile the shader GL_CHECKERR(glCompileShader(compiledShader->GetShaderHandle())); GLint status; GL_CHECKERR(glGetShaderiv(compiledShader->GetShaderHandle(), GL_COMPILE_STATUS, &status)); // Dump debug info (source and log) if compilation failed. if (status != GL_TRUE && mbVerbose) DumpDebugInfo(compiledShader->GetShaderHandle()); return compiledShader; }
ResourceManager::~ResourceManager() { DumpDebugInfo(); }