opengl优化

This commit is contained in:
Barry 2018-10-31 19:33:52 +08:00
parent 979000e340
commit 1becba6e3d
2 changed files with 3 additions and 3 deletions

View file

@ -16,7 +16,7 @@ int main(int argc, char *argv[])
qputenv("QTSCRCPY_SERVER_PATH", "G:\\mygitcode\\QtScrcpy\\src\\scrcpy-server.jar");
Dialog w;
w.move(50, 930);
//w.move(50, 930);
w.show();
return a.exec();

View file

@ -178,7 +178,7 @@ void YUVGLWidget::bindPixelTexture(GLuint texture, YUVTextureType textureType, q
makeCurrent();
glBindTexture(GL_TEXTURE_2D, texture);
glPixelStorei(GL_UNPACK_ROW_LENGTH, stride);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, size.width(), size.height(), GL_RED, GL_UNSIGNED_BYTE, pixels);
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, size.width(), size.height(), GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels);
doneCurrent();
}
@ -196,7 +196,7 @@ void YUVGLWidget::initTexture(qint32 textureType)
QSize size(0, 0);
calcTextureSize(textureType, size);
glTexImage2D(GL_TEXTURE_2D, 0, GL_R8, size.width(), size.height(), 0, GL_RED, GL_UNSIGNED_BYTE, NULL);
glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, size.width(), size.height(), 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL);
}
void YUVGLWidget::initTextures()