JOGL Texture Demo: one more time

2008/12/28 Joel Uckelman <uckelman@nomic.net (uckelman@nomic.net)>

What happens if you add

-Dsun.awt.noerasebackground=true

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

I get worse flickering and sometimes garbage during the flickering.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Was out all day. New class did the trick, looks fine now

From: Michael Kiefte mkiefte@dal.ca
To: VASSAL Engine Forums Mailing List messages@forums.vassalengine.org
Sent: Sunday, December 28, 2008 3:43:41 PM
Subject: Re: [Developers]Re: JOGL Texture Demo: one more time

Put a new version up here:

http://myweb.dal.ca/mkiefte/TextureDemo081228.zip

This might solve Tim’s antialiasing problem.

Tim, you only need to download and substitute this file:

http://myweb.dal.ca/mkiefte/TextureDemo.class

  • M.

2008/12/28 Michael Kiefte <mkiefte@dal.ca (mkiefte@dal.ca)>

Post generated using Mail2Forum (mail2forum.com)

What does your cursor normally do when you click on a window? Does it do something funky?

  • M.

Post generated using Mail2Forum (mail2forum.com)

Okay good. That problem is solved.

  • M.

2008/12/28 Timothy Mccarron <timothy.mccarron@sbcglobal.net (timothy.mccarron@sbcglobal.net)>

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

The only thing which happens for other windows is that they gain focus if
they didn’t already have it.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

One more question:

When you added -Dsun.awt.noerasebackground=true

does it ever show what it’s supposed to or is it always garbage?

  • M.

2008/12/29 Joel Uckelman <uckelman@nomic.net (uckelman@nomic.net)>

Post generated using Mail2Forum (mail2forum.com)

Also, how do these demos look to you in Compiz:

https://jogl-demos.dev.java.net/

In particular, try the gears and rotate them with the mouse.

  • M.

2008/12/29 Michael Kiefte <mkiefte@dal.ca (mkiefte@dal.ca)>

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

It’s garbage until the map is loaded, and then similar garbage briefly
flickers in on each mouse button press. The rest of the time it looks
the way it should. Would you like a screenshot of the garbage?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

The gears flicker also whenever I do a mouse press.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Would it help?

For some reason, Compiz is compelled to clear the canvas more often. I’ll work on a possible solution today.

Let me know how the gears demo goes. I suspect it will have the same problem, but if it doesn’t, then I’ll check its source.

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

No, I just thought you might like screenshots of garbage. :slight_smile:

Already have. It flickers on mouse presses too.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

I discovered something just now: The flicker seems to be caused by the
background being painted without the foreground also being painted. I
can see this clearly if I call setBackground(Color.GREEN) on the canvas,
as the flickering becomes bright green.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

This is a longshot:

-Dsun.java2d.noddraw=true

  • M.

2008/12/29 Joel Uckelman <uckelman@nomic.net (uckelman@nomic.net)>

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

That makes the flickering black instead of grey.

J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

2008/12/29 Joel Uckelman <uckelman@nomic.net (uckelman@nomic.net)>

That’s not what I expected. What happens if you change the background alpha to 0x00? I’m guessing you get the garbage back. And then I would try the 0x00 alpha with the -Dsun.java2d.noddraw=true switch.

Any ideas of what method gets the background colour? paint() and update() are already overridden in GLCanvas. What else is there?

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

In both cases, the alpha component is ignored—when I set the background
to Color(255,0,0,0) I see pure red. I think this is because heavyweight
components are always opaque.

I’ve been looking at the source for GLCanvas, and all paint() does is call
display(), which in turn seems only to call GLEventListener.display().

So, I’m not sure where the background is actually painted—something called
from TextureDemo.display() must be doing it, since I don’t see any calls to
super.paint() anywhere.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Here’s another longshot:

-Dsun.java2d.opengl.fbobject=false

The desktop manager is clearing your window without calling a Java method at all. When you have direct draw enabled, setting the background colour calls a native method that sets the background colour for the window. When you added -Dsun.java2d.noddraw=true, the desktop no longer knew what the correct background colour was according to the JVM.

Now the problem is, why would the desktop clear without calling a repaint?

  • M.

2008/12/29 Joel Uckelman <uckelman@nomic.net (uckelman@nomic.net)>

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Michael Kiefte”:

That doesn’t help. It also degrades performance noticeably.

J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

I actually expected it to degrade performance…

It turns out that there are a lot of posts on this on the Internet, but no solution. Do a google search for compiz and jogl and you’ll see the same problem described by multiple people.

  • M.

2009/1/2 Joel Uckelman <uckelman@nomic.net (uckelman@nomic.net)>

Post generated using Mail2Forum (mail2forum.com)