本文整理汇总了Java中com.jogamp.opengl.util.texture.awt.AWTTextureIO.newTextureData方法的典型用法代码示例。如果您正苦于以下问题:Java AWTTextureIO.newTextureData方法的具体用法?Java AWTTextureIO.newTextureData怎么用?Java AWTTextureIO.newTextureData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.util.texture.awt.AWTTextureIO
的用法示例。
在下文中一共展示了AWTTextureIO.newTextureData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateBitmap
import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
private void updateBitmap() {
try {
BufferedImage img = ImageIO.read(imageInputStream);
data = AWTTextureIO.newTextureData(GLContext.getCurrentGL().getGLProfile(), img, false);
if (data.getMustFlipVertically()) {
ImageUtil.flipImageVertically(img);
data = AWTTextureIO.newTextureData(GLContext.getCurrentGL().getGLProfile(), img, false);
}
} catch (IOException ex) {
//TODO this is a very, very bad practice...
throw new RuntimeException(ex.getMessage());
}
updateTextureFlag = false;
}
示例2: updateBitmap
import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
private void updateBitmap() {
try {
BufferedImage img = ImageIO.read(imageInputStream);
data = AWTTextureIO.newTextureData(GLContext.getCurrentGL().getGLProfile(), img, false);
if (data.getMustFlipVertically()) {
ImageUtil.flipImageVertically(img);
data = AWTTextureIO.newTextureData(GLContext.getCurrentGL().getGLProfile(), img, false);
}
} catch (IOException ex) {
//TODO this is a very, very bad practice...
throw new RuntimeException(ex.getMessage());
}
markForUpdate = false;
}
示例3: newTextureData
import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
/**
* Method newTextureData()
*
* @see com.jogamp.opengl.util.texture.spi.TextureProvider#newTextureData(com.jogamp.opengl.GLProfile, java.io.File,
* int, int, boolean, java.lang.String)
*/
@Override
public TextureData newTextureData(final GLProfile glp, final File file, final int internalFormat,
final int pixelFormat, final boolean mipmap, final String fileSuffix) throws IOException {
final IScope scope = GAMA.getRuntimeScope();
final GamaImageFile f = new GamaImageFile(scope, file.getAbsolutePath());
if (f.getExtension(scope).equals("pgm")) {
final BufferedImage image = f.getImage(scope, true);
return AWTTextureIO.newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
} else {
return null;
}
}
示例4: buildTexture
import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
public static Texture buildTexture(final GL gl, final BufferedImage image) {
try {
final TextureData data = AWTTextureIO.newTextureData(gl.getGLProfile(),
correctImage(image, !Abstract3DRenderer.isNonPowerOf2TexturesAvailable), false);
final Texture texture = new Texture(gl, data);
data.flush();
return texture;
} catch (final GLException e) {
e.printStackTrace();
return null;
}
}
示例5: addTexture
import com.jogamp.opengl.util.texture.awt.AWTTextureIO; //导入方法依赖的package包/类
public void addTexture(BufferedImage img, int index) {
try {
TextureData data = AWTTextureIO.newTextureData(GLProfile.getDefault(), img, false);
texturePool[index] = TextureIO.newTexture(data);
} catch(Exception e) {
System.err.println("Error while setting a texture from an BufferedImage("+img.toString()+") Exception: "+e);
System.exit(1);
}
}