Title bar and multi window support

Started by tlf30, November 26, 2011, 00:55:14

Previous topic - Next topic

tlf30

I'm working on a game client, everything works good except the way the title bar looks. I was wondering if there was a way to have it take on the theme of the OS.

kappa

The look of the title bar should be set automatically by the window manager of the OS, which OS are you running on?

tlf30

I'm using windows 7 pro with the alienware overlay on the OS. This is how the title bar looks:

tlf30

I have icons and a background texture for the title bar, I just need a way to swap them out with the ones lwjgl gives it.

jediTofu

You'll have to set Undecorated to true:

http://www.lwjgl.org/wiki/index.php?title=LWJGL_Hidden_Switches

Then draw the title bar and mini/max/close buttons using OpenGL via LWJGL.

Else you'll have to modify the native code as there is no other way that I know of.
cool story, bro

tlf30

Does undecorating take away the border?

jediTofu

It has no border for me on linux; tested with this:

java -cp .:res:jar/lwjgl.jar:jar/lwjgl_test.jar:jar/lwjgl_util.jar:jar/jinput.jar: -Djava.library.path=native/linux -Dorg.lwjgl.opengl.Window.undecorated=true org.lwjgl.test.WindowCreationTest

http://www.lwjgl.org/wiki/index.php?title=Downloading_and_Setting_Up_LWJGL

I assume Windows probably uses WM_POPUP or something and doesn't have border as well.
cool story, bro

tlf30

Im not sure on doing it this way, my frame rate is already deathly low.

jediTofu

You could also stick the game window inside JFrame and modify the look&feel to use your icons.  Of course, AWT's Frame would be better to use, but no idea how to modify the icons through that.
cool story, bro

tlf30

How would I get the lwjgl canvas in a JFrame.

CodeBunny

Place an AWT Canvas onto a JFrame, then:

Display.setParent(the_canvas_to_use).

tlf30


tlf30

Changing the canvas over was voted down in my last development meeting, it there a way of adding custom title bar theme support to lwjgl?

princec

Yes, tell the rest of the development team if they want to do it they have to do what you say.

Cas :)

tlf30

That wont work. Really all that we need is the correct title bar when using themes like on alienware computers.