本文整理汇总了C++中util::checkGLError方法的典型用法代码示例。如果您正苦于以下问题:C++ util::checkGLError方法的具体用法?C++ util::checkGLError怎么用?C++ util::checkGLError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类util
的用法示例。
在下文中一共展示了util::checkGLError方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void Texture::draw() {
bind();
quad.draw();
unbind();
checkGLError("Texture::draw quad draw");
}
示例2: glBindBuffer
unsigned char *Texture::mapData() {
if(!texture) {
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pboTexture);
texture = (unsigned char*)(glMapBuffer(GL_PIXEL_UNPACK_BUFFER,
GL_READ_WRITE));
}
checkGLError("Texture::mapData");
return texture;
}
示例3: createTexture
void Texture::createTexture() {
glGenTextures(1, &idTexture);
glBindTexture(GL_TEXTURE_2D, idTexture);
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_WRAP_S, GLint(GL_REPEAT));
glTexParameteri(GL_TEXTURE_2D,
GL_TEXTURE_WRAP_T, GLint(GL_REPEAT));
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA8, width, height);
checkGLError("Texture::createTexture glTexStorage2D");
glGenBuffers(1, &pboTexture);
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pboTexture);
glBufferData(GL_PIXEL_UNPACK_BUFFER,
getWidth() * getHeight() * getChannelCount(),
nullptr, GL_DYNAMIC_DRAW);
checkGLError("Texture::createTexture glBufferData");
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
}
示例4: uploadData
void Texture::uploadData() {
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pboTexture);
bind();
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height,
GL_BGRA, GL_UNSIGNED_BYTE, 0);
unbind();
glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0);
checkGLError("Texture::uploadData");
}
示例5: unmapData
void Texture::unmapData() {
glUnmapBuffer(GL_PIXEL_UNPACK_BUFFER);
checkGLError("Texture::unmapData");
texture = nullptr;
}