LWJGL looking bad on OS X Powerbook

If you remember my post in the Java2D forums about some problems drawing stuff on my brother’s Powerbook, you’ll remember the ugly screenshots. If you don’t know em, check the post here:

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=2D;action=display;num=1105480516

Well, after porting Rimscape to LWJGL, I gave it another shot. Unfortunately, LWJGL looks MUCH worse. All of the problems you see in those screenshots exist PLUS more. What in the world could be the cause of this?

I’d say dodgy OpenGL drivers.
What card?

I tried it on another Powerbook, and had the same effects.

Drivers… aren’t really an option. You use what the OS automatically updates for you :slight_smile: And video card… whatever comes with the machine. You don’t get any options there hehe. No external manufacturers you know.

After seeing a screenshot of the lwjgl version I concluded that this is most likely an ImageIO bug, possibly a awt bug. Nothing to do with either OpenGL or LWJGL.

Yes, that’s what I think.

Cas :slight_smile:

The problems have been resolved! They originated from this method:


      public static BufferedImage getScaledInstance(BufferedImage bi, int newWidth, int newHeight) {
            
            BufferedImage newBI = createBI(newWidth, newHeight,
                    
            //TYPE_INT_ARGB is not the Translucent equivalent on Mac's, so don't rely on it to determine transparency
      //            bi.getType() == BufferedImage.TYPE_INT_ARGB ? Transparency.TRANSLUCENT : Transparency.OPAQUE);
                    Transparency.TRANSLUCENT);
            Graphics2D g = newBI.createGraphics();
            g.setComposite(AlphaComposite.Src);
            
            //This method screws things up on mac's
            //g.drawImage(bi.getScaledInstance(newWidth, newHeight, Image.SCALE_SMOOTH), 0, 0, null);
            
            g.drawImage(bi, 0, 0, newWidth, newHeight, null);
            g.dispose();
            
            return newBI;
      }

You can see the two comments in there pointing out two different problems. There’s absolutely a bug with the getScaledInstance() method. I’ll have to do up a bug report for it at some point.

I have a better idea :slight_smile: Use DevIL!

Cas :slight_smile:

Are we still confined to Windows for DevIL ?

Kev

[quote]I have a better idea :slight_smile: Use DevIL!

Cas :slight_smile:
[/quote]
Usually I would agree. But since the LWJGL version is a port of the Java2D version, and that the Java2D version is still maintained, it makes sence to share the loading code wich uses ImageIO. Even if ImageIO is buggy :frowning:

devil is still windoze only…

hehe and the problem in this thread is totally Mac specific. So I don’t think DevIL is a very good solution for a Mac problem :wink:

A homegrown TGA loader is good enough for non-lossy images. It’s only when you need jpgs that it gets tricky. Then there is devil, ImageIO or just steal some code like I did :o

500 posts and still only a Senior Member. Whos blank do I have to blank to become a god around here :slight_smile:

DevIL will arrive on the Mac next release. There’s nothing stopping it, it just wasn’t compiled in time.

Cas :slight_smile:

You have to be sponsored by an existing God before you are recognised. I’ve just done that, so you should be fine now - see what happens when you next post (you have to post again to trigger it).

Just remember who to be grateful to, eh? :wink:

/me whistles innocently

Holy crap I just noticed I’m a YaBB god… who sponsored me? :slight_smile: