本文整理汇总了C++中Error::Report方法的典型用法代码示例。如果您正苦于以下问题:C++ Error::Report方法的具体用法?C++ Error::Report怎么用?C++ Error::Report使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Error
的用法示例。
在下文中一共展示了Error::Report方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UseEffect
void UseEffect(Effect *effect) {
glUseProgram(effect->getProgramID());
Error error = _checkForErrors();
if(error.Report().length() > 0) {
throw error;
}
}
示例2: _compileShader
GLuint _compileShader(int shaderType, std::vector<std::string> scripts) {
std::vector<const char*> scriptData;
for(unsigned int i=0; i<scripts.size(); i++) {
scriptData.push_back(scripts.at(i).data());
}
GLuint shaderID = glCreateShader(shaderType);
glShaderSource(shaderID, scripts.size(), &scriptData[0], NULL);
glCompileShader(shaderID);
Error error = _checkShaderCompiled(shaderID, shaderType);
if(error.Report().length() > 0) {
throw error;
}
return shaderID;
}
示例3: Error
Effect::Effect(std::vector<std::string> scripts, std::vector<int> types) {
GLuint programID = glCreateProgram();
std::vector<std::string> vscript, fscript;
for (unsigned int i=0; i<scripts.size(); i++) {
if(types.at(i) == Vertex) {
vscript.push_back(scripts.at(i));
} else if(types.at(i) == Fragment) {
fscript.push_back(scripts.at(i));
}
}
GLuint vshaderID = _compileShader(Vertex, vscript);
glAttachShader(programID, vshaderID);
GLuint fshaderID = _compileShader(Fragment, fscript);
glAttachShader(programID, fshaderID);
Error error = _checkForErrors();
if(error.Report().length() > 0) {
throw error;
}
glLinkProgram(programID);
GLint status;
glGetProgramiv(programID, GL_LINK_STATUS, &status);
if(status == GL_FALSE) {
char programInfoLog[100];
GLsizei length;
glGetProgramInfoLog(programID, 100, &length, &programInfoLog[0]);
throw Error(&programInfoLog[0]);
}
this->program = programID;
}