Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java TextureData Constructor中需要什么类型的信息?_Java_Opengl_Jogl - Fatal编程技术网

Java TextureData Constructor中需要什么类型的信息?

Java TextureData Constructor中需要什么类型的信息?,java,opengl,jogl,Java,Opengl,Jogl,尝试在jogl中创建TextureData对象时,根据某些文档,构造函数采用以下参数: TextureData(GLProfile glp, int internalFormat, int width, int height, int border, int pixelFormat, int pixelType, boolean mipmap, boolean dataIsCompressed, boolean mustFlipVertically, Buffer buffer

尝试在jogl中创建TextureData对象时,根据某些文档,构造函数采用以下参数:

TextureData(GLProfile glp,
int internalFormat, 
int width, 
int height, 
int border, 
int pixelFormat, 
int pixelType, 
boolean mipmap, 
boolean dataIsCompressed, 
boolean mustFlipVertically, 
Buffer buffer, 
TextureData.Flusher flusher)
“使用指定的参数构造新的TextureData对象,并且数据包含给定的缓冲区。”


我不知道什么类型的信息由“pixelFormat”int、“PixelType”int和flusher表示。有人能解释一下吗?

这取决于您提供的图像数据的类型


对于.png,它是GL_RGBA和GL_UNSIGNED_字节。

pixelFormat和pixelType可能与glTexImage2D中的格式和类型参数相同。你看过它的Java文档了吗?flusher是可选的,允许释放TextureData对象使用的本机内存,它通常用于销毁直接NIO缓冲区。您不能在您的案例中使用TextureIO.newTextureData()吗?用户3256930是对的。