java将Pixmap的一部分上传到GPU
我想上传一部分Pixmap(它的指定矩形)到GPU中的纹理(在指定位置)
我想实现的是
void updateTextureFromPixmap(sourcePixmap,sourceRectangle,destTexture, destRectangle) {
destTexture.fill(copyfrom(sourcePixmap),copyarea(SourceRectangle),newArea(destRectangle));
}
我应该使用glTexSubImage2D吗?我还在学习opengl/
# 1 楼答案
# 2 楼答案
可以使用Texture#draw将pixmap绘制到纹理中。像这样: