2014-09-05 57 views
0

當試圖創建一個JOGL對象TextureData,根據一些文件的構造器採用下列參數:「創建一個新的TextureData使用指定的參數對象和數據包含給定緩衝區」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) 

我找不到「pixelFormat」int,「PixelType」int和沖刷器代表的信息類型。有人可以解釋嗎?

+2

pixelFormat和pixelType可能與glTexImage2D中的格式和類型參數相同。 https://www.opengl.org/sdk/docs/man/html/glTexImage2D.xhtml – user3256930 2014-09-05 17:11:54

+0

你看看它的Java文檔? http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/util/texture/TextureData.html#TextureData%28javax.media.opengl.GLProfile,%20int,%20int, %20int,%20int,%20int,%20int,%20boolean,%20boolean,%20boolean,%20java.nio.Buffer,%20com.jogamp.opengl.util.texture.TextureData.Flusher%29沖洗器是可選的,允許釋放由TextureData對象使用的本地內存,它通常用於銷燬直接的NIO緩衝區。你不能在你的情況下使用TextureIO.newTextureData()嗎? user3256930是正確的。 – gouessej 2014-09-06 14:48:05

回答

1

這取決於您給GL的圖像數據的類型。

對於.png,它是GL_RGBA和GL_UNSIGNED_BYTE。

相關問題