Почему TextureIO не принимает newTexture(BufferedImage, Boolean?

Я пытаюсь создать новую текстуру:

BufferedImage image = ImageIO.read(new File("firstImage.jpg"));
Texture t = TextureIO.newTexture(image,true);  

Но получить

Метод newTexture(File, boolean) в типе TextureIO неприменим для arguments (BufferedImage, boolean).

я импортирую

import com.jogamp.opengl.util.texture.TextureIO;

Который согласно Javadoc должен читать newTexture(BufferedImage, Boolean)

Так что я делаю неправильно?


person J C    schedule 25.11.2012    source источник


Ответы (2)


В итоге я решил закинуть изображение прямо в newTexture.

Мой код выглядит так

//BufferedImage im = ImageIO.read(new File("image.jpg"));

Texture t = TextureIO.newTexture(new File("image.jpg"),true);

Спасибо всем заглянувшим.

JC

person J C    schedule 26.11.2012

На самом деле, ветка немного устарела, но мой ответ может помочь кому-то еще. В JOGL2 (в отличие от JOGL1.1) вы должны использовать AWTTextureIO для загрузки BufferedImages, то есть Texture t = AWTTextureIO.newTexture(profile, image,true);, где profile — ваш текущий GLProfile.

person Alexis Drogoul    schedule 05.03.2014