General question concerning hardwareacceleration

Hi,

got a general question!!! Is there any differrence between swing- / awt- components regarding the usage of harware accelaration? Is there a difference using a JPanel or a JFrame as container for a 3d scene?

well … for JOGL, but work normally, but I don’t think it will make any difference in speed. Not sure yet. Haven’t really tried, quite a Swing fan so :slight_smile:

Referring to this article:

http://www.sm.luth.se/csee/courses/smd/159/UsersGuide/

You will not be able to get hardware acceleration using swing-based (lightweight) components.

Ok, does this mean that as long as I use a GLCanvas to contain my 3d scene hardware acceleration is provided?
I have added the GLCanvas to a JInternalFrame/JPanel and if I have unterstood the article this is all right ???

Well, I have just tested a GLCanvas contained within a JFrame and I still receive hardware acceleration. Not sure about mixing with a JInternalFrame or JPanel though - test and see - let us know what the results are.

On a personal note, mixing heavyweight with lightweight components is a no no, and oftens ends up with many more unwanted problems. I personally just stick to AWT, but render all my widgets in OpenGL. Though many other developers may think otherwise.

I recommend, uh, just totally forgetting all about Swing and AWT if you want to write games. Unless you like ugly broken GUIs with quirks galore :slight_smile:

Here’s 2 examples of game guis:

Alien Flux
Super Elvis

Note how neither of them use Swing (or even AWT but that’s another story). Note also the different approach used by both: Alien Flux goes out-and-out for posh clever-ass widgetry, and Super Elvis is as brain-dead as you like, simply dividing the screen up into areas and reacting to mouseovers.

Super Elvis is arguably the most sensible way to approach the whole thing, seeing as it took about 50 lines of code and Does The Job It Needs To :smiley:

O’course, if this ain’t about writing games, then … well never mind :wink: Strikes me that we’re in games forum so what the hell!

Cas :slight_smile:

Off Topics - Super Elivs is very nice. I like it all around, except for the Elvis part. For me, it kind of ruins the abstractness, but that’s just me.:slight_smile: