git-svn-id: svn://db.shs.com.ru/libs@47 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2015-11-26 11:53:29 +00:00
parent 2ace72ff47
commit 4cbcbb5174
26 changed files with 346 additions and 105 deletions

View File

@@ -109,9 +109,14 @@ void createGLTexture(GLuint & tex, int width, int height, const GLenum & format,
glTexImage2D(target, 0, format, width, height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, 0);
else {
int t = GL_UNSIGNED_BYTE;
if (format == GL_RGB32F || format == GL_RGB16F)
int f = GL_RGBA;
if (format == GL_RGB32F || format == GL_RGB16F || format == GL_RGBA32F || format == GL_RGBA16F)
t = GL_FLOAT;
glTexImage2D(target, 0, format, width, height, 0, GL_RGBA, t, 0);
if (format == GL_RGB32F || format == GL_RGB16F || format == GL_RGB8 || format == GL_RGB)
f = GL_RGB;
glTexImage2D(target, 0, format, width, height, 0, f, t, 0);
//glGenerateMipmap(target);
//qDebug() << "glTexImage2D" << width << height << QString::number(t, 16);
}
//qDebug() << QString::number(glGetError(), 16);
}