Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Textures  (Read 1818 times)
0 Members and 1 Guest are viewing this topic.
Offline darkdemise99

Junior Newbie

« Posted 2010-10-19 03:30:32 »


I'm trying to create a sphere with a texture mapped inside, so when I'm inside it i can see the texture.

I've searched online how to create textures in JOGL, but everything I've found uses something called TextureReader, which gives me an error saying it's not a class. I've also tried TextureLoader, but I get an error:

Multiple markers at this line
   - The method load(String) is undefined for the type TextureLoader
   - Access restriction: The type TextureLoader is not accessible due to restriction on required library /System/Library/Java/Extensions/

What's the easiest way to get texture working?
Offline lhkbob

JGO Knight

Medals: 32

« Reply #1 - Posted 2010-10-19 06:06:52 »

If you're looking at the nehe's demo, it looks like they have a custom TextureReader that you can get somehow (in package demos.common).  Where are you getting TextureLoader?  Are you sure you're using the newest version of JOGL?

The easiest way is probably with TextureIO, which is included with JOGL, but will have different methods that you need to call compared to what might be in a demo that uses the TextureReader.

Offline Bananni

Senior Newbie

Belive the hype!

« Reply #2 - Posted 2010-10-19 07:57:03 »

you should use TYPE_INT_ARGB_PRE, its the fastet so far i know.
  Texture makeTex(BufferedImage img){
      if(img.getType() == BufferedImage.TYPE_INT_ARGB_PRE){
        return TextureIO.newTexture(img,false);
        BufferedImage bimg = new BufferedImage(img.getWidth(),img.getHeight(),BufferedImage.TYPE_INT_ARGB_PRE);
        Graphics2D g2d = bimg.createGraphics();
        g2d.drawImage(img, 0, 0, null);
        return TextureIO.newTexture(bimg,false);


Pages: [1]
  ignore  |  Print  

EgonOlsen (45 views)
2018-06-10 19:43:48

EgonOlsen (27 views)
2018-06-10 19:43:44

EgonOlsen (47 views)
2018-06-10 19:43:20

DesertCoockie (210 views)
2018-05-13 18:23:11

nelsongames (127 views)
2018-04-24 18:15:36

nelsongames (126 views)
2018-04-24 18:14:32

ivj94 (867 views)
2018-03-24 14:47:39

ivj94 (128 views)
2018-03-24 14:46:31

ivj94 (779 views)
2018-03-24 14:43:53

Solater (143 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!