Code: Alles auswählen
buf.load( "temp.png" )
tex= QGLWidget::convertToGLFormat( buffer );
glTexImage2D( GL_TEXTURE_2D, 0, 3, tex.width(), tex.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, tex.bits() );Code: Alles auswählen
QImage myImage(width ,height,QImage::Format_ARGB32);
for(int i = 0; i < width; i++){
for(int j = 0; j < height; j++)
{
uint convVal = ((uint) image->data[(j*width + i)*2]);
value = qRgb(convVal, convVal, convVal);
myImage.setPixel(i,j,value);
}
}
[code] tex = QGLWidget::convertToGLFormat(myImage);es zerlegt das programm mit einem segfault bei
Code: Alles auswählen
tex = QGLWidget::convertToGLFormat(myImage);