Graphics2D and AffineTransform Questions

Glad you were able to solve your problem :slight_smile:

EDIT:
Here is something about that flag: http://download.oracle.com/javase/1.5.0/docs/guide/2d/flags.html#ddforcevram
Keeping an image in VRAM is quite expensive if you draw it a lot, so it is best to not have that flag :slight_smile:

Thanks for the link (and reply). I suspect that my video card was eventually filling up with memory because I was drawing SO many of them (Every 50 MS 15,000 images where checked and depending on what zoom I was at, it could range from 20 images to 9,000 being drawn) and it probably was starting to have issues from that. Just a guess.

I will check out your link you included. I am surely certain it will be useful to me.

Thanks again for your guys help.

EDIT (I love to edit posts): I have given you both appreciation. ;D 8)

I really hate to bring an old post back from the dead but I just wanted to give an update about this. It may help others.

In the end, the above changes did not help me. I still ran into the issue.

I could not figure it out to save my life. Then I had a friend of mine use my game and he said that when a tool tip appeared on the Close icon on a window, he noticed the slow down. So I tested this out and sure enough, the tool tips were causing the slow down! I was really surprised. I turned the tool tips off and then the problem went away.

I’m not really sure why the tool tips were causing issues with drawing but the problem is gone now and I am very pleased.

Maybe this is useful for someone else out there that are seeing weird slow downs.

Which tool tips?

Sounds like the tooltip added by the window manager. Could be a problem with the desktop compositor maybe?

I’m using JInternalFrames so whatever happens to be default to Swing and that component.

You’re using Swing for your games?!?!? O_O Why?!?

I wonder what kind of game that use JInternalFrame. I learned that the only one swing’s friend that you can use in game is JFrame and JPanel only.

Not even JPanel!
You should only use JFrame + Canvas. That’s it.

Why? ???

Why even use JPanel?

Also a JFrame is also overkill. java.awt.Frame + java.awt.Canvas is all you need. No need for the extra bloat of Swing if you’re not gonna use it.

I like LWJGL.

@theagentd
Completely irrelevant to this thread. >:(

Okay, I like LWJGL because I don’t have to use Swing or AWT to create a window. Happy?

;D

Completely irrelevant to this thread. :stuck_out_tongue: ;D

Actually it does answer your question: “happy?” ;D ;D

Haha, let’s stop this… xD

Frame + Canvas + BufferStrategy then :wink:

Remember, Frame doesn’t have the convenient “setDefaultCloseOperation(…)” method, so you will have to manually exit the JVM when the window closes:


frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
        System.exit(0);
    }
});