QOpenGLTexture II

来源:互联网 发布:淘宝网铁链条鞭 编辑:程序博客网 时间:2024/05/20 07:16

1 Creating an opengl texture from QImage (with a transparent background)

2 How to construct a cubemap texture using QOpenGLTexture?  *****

3

void display() { ... }

glutDisplayFunc(display) ;          VS      glDrawArrays(......)  ;



glEnable(GL_TEXTURE_2D);glBegin(GL_QUADS);......
glEnd();glDisable(GL_TEXTURE_2D);


--------------------------------------

new QOpenGLTexture();create();setSize();setFormat();allocateStorage();setData();

QOpenGLTexture

      glActiveTexture(GL_TEXTURE0);      texture = new QOpenGLTexture(QImage(textureName));      texture->bind(0);  //**      m_program->setUniformValue("colorTexture", 0);


OldVersion

glBindTexture(GL_TEXTURE_2D, texture[0]);  //**
原创粉丝点击