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.
The look of the title bar should be set automatically by the window manager of the OS, which OS are you running on?
I'm using windows 7 pro with the alienware overlay on the OS. This is how the title bar looks:
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.
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.
Does undecorating take away the border?
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.
Im not sure on doing it this way, my frame rate is already deathly low.
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.
How would I get the lwjgl canvas in a JFrame.
Place an AWT Canvas onto a JFrame, then:
Display.setParent(the_canvas_to_use).
I'll try that! Thanks.
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?
Yes, tell the rest of the development team if they want to do it they have to do what you say.
Cas :)
That wont work. Really all that we need is the correct title bar when using themes like on alienware computers.
well, send us a big fat top-specced alienware computer so we can start looking into it ;)
I am not aware of anyone else having this issue - and certainly not the developers.
I think the quickest way to fix this is to look into what is needed and implement it yourself.
Then provide a patch that we can apply.
If you could tell me where in lwjgl it gives the display its title bar I could build a fix.
http://java-game-lib.svn.sourceforge.net/viewvc/java-game-lib/trunk/LWJGL/src/native/windows/opengl/context.c?revision=3731&view=markup
Somthing is wrong with the lwjgl.dll when getting the system window style properties.
It was raining outside my house yesterday.
Cas :)
It was snowing at my house yesterday.
How can I edit the dll file to look for whats wrong? ???
You didn't get my hint so I shall spell it out to you: what goes wrong? Give us logs, stacktraces, outputs, descriptions. Be professional! Our time is valuable.
Cas :)
Why does my game not work?
You forgot to double click the icon, d'oh!
Mike
Does that Alienware overlay work with other applications?
And seriously is it really that important?
There are no errors just the windows clasic like theme. Also it works on all programs unless they where built using lwjgl.
And YES it is important. The game needs to actually work on all systems not just a little, but in all ways.
Just updated to lwjgl 2.8.3 still no fix. :-\
Quote from: tlf30 on January 26, 2012, 20:50:50
Just updated to lwjgl 2.8.3 still no fix. :-\
Well we can't fix a problem which we can't reproduce or know the cause of.
You should either provide some useful information or try debug LWJGL to find the source of the problem.
I have never used netbeans debugger, how do I turn lwjgl on debug mod in netbeans
Quote from: tlf30 on January 26, 2012, 21:02:17
I have never used netbeans debugger, how do I turn lwjgl on debug mod in netbeans
*sigh*, its not Java code you need to be looking at but likely the native Windows API part.
How do I look at that?
Well I'd start by writing a simple native application using the Windows API, something that just creates a window to see if it suffers from the same problem. Then I'd compare my simple program with how LWJGL creates the window to try narrow down the issue.
Where will I find the window API? I have only used Swing when making GUI applications.
In that case you should ask one of the other developers on your team, maybe one of them knows C and has used the Windows API.
Also do stay open to the possibility that this isn't a bug with LWJGL but the Alienware Overlay, maybe try another theme?
I'm the only one that has used C, but that was raw C for building an OS with assembly. I taught the rest of my team how to program, all they know is java. From looking at the lwjgl code it looks like the lwjgl.dll works with the windows system, there is probably somthing wrong in there, I just do not have a way to open it.
Here is the title bar on a white and black background, as you can see there are transparent parts. Also attached is the theme it should be...
When turning off the alienwre theme it works correctly. The theme is managed with: stardock my colors
It looks as if only themes run by stardock my colors theme manager do not work.
Does a JFrame have the correct look and feel, btw?
Yes.
Then I would recommend that instead of messing around with native code, use Display.setParent. Its performance isn't particularly worse, and you have a fast solution to the problem. Explain to your team that it's the simplest reliable solution, and doesn't really have a downside. They're creating a restriction that is essentially pointless, and if they aren't strong programmers, they shouldn't be advising you on how to program.
Additionally, you can very easily port your game to an applet, if that is something you're interested in.
Is there no way to download a stardock theme and look for the problem, a lot of people use stardock themes.
Quote from: tlf30 on February 08, 2012, 06:39:24
Is there no way to download a stardock theme and look for the problem, a lot of people use stardock themes.
Sure. You can download free themes from here:
http://www.wincustomize.com/explore/objectdock/sort/popular (http://www.wincustomize.com/explore/objectdock/sort/popular)
AWT fails, so far the icons are not working correctly, we will have to rebuild them. Also putting the lwjgl window in AWT is glichy. I have traced the problem with the title bar to the lwjgl.dll, but I have no idea how the stardock themes work so I am not able to fix the problem. There has to be a way to get overlay themes running and apply them to the title bar because no other programs has this problem only lwjgl built ones.
Quote from: tlf30 on January 23, 2012, 08:29:41
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?
Is there any technical reason why you can't apply the solution you were given?
It seems odd (and moderately offensive) to have a group of non-programmers rejecting the advice that a group of domain experts have given you (at great length, I might add)
Stardock?!
Don't get me wrong, but you want the lwjgl team to create a fix/workaround that works with propritary software like stardock?
That's hilarious!
As CodeBunny allready suggested you should try to go with Display.setParent or switch to Fullscreen. Or is there any particular reason to have a windowed viewport?
We need the window and fullscreen options, because some computers, esspecially thoughs that do not have the correct drivers, will have thier screens just go black. Also we have been working with fullscreen is there a way to support multiple screens?
Not that I know of, no. The Display is a single, static entity.
Potentially you could work out something similar with multiple AWTGLCanvases; however, that would most likely be impossible to make rigorous. Such functionality would probably be waaaay too much work for far too little payoff.
How have other games made multipal screens work, there has got to be a was to split the canvas between 2 screens and identify them sepratly.
IDEA:
could you open 2 windows from the same program then put each one to fullscreen on one of the 2 screens?
You're starting to get very far afield. I'd recommend that you focus on the topic of this thread; if you want to start a new topic on multi-monitor fullscreen apps with LWJGL, that's a better idea.
I'm not sure, but I've always assumed that multi-monitor fullscreen was something the graphics card did on its own, not something that applications managed. A quick look on Wikipedia seems to support this (http://en.wikipedia.org/wiki/Multi-monitor#Span_or_extended_desktop_mode (http://en.wikipedia.org/wiki/Multi-monitor#Span_or_extended_desktop_mode)). However, there does seem to be a mention of how you can explicitly program such functionality (http://en.wikipedia.org/wiki/Multi-monitor#Programming (http://en.wikipedia.org/wiki/Multi-monitor#Programming)).
As to your idea, that's what I was alluding to, yes. However, AWTGLCanvas is the only way to have multiple display surfaces concurrently in LWJGL, and it's been very unstable when I've used it. Additionally, you need to impose some sort of artificial mechanics to prevent one of the windows from being moved, minimized, closed, etc. without the other following suit.
Well, if lwjgl can go into fullscreen, then there should be a way to look to see if multiple scrren are there, then be able to use each one independently.
...You have no idea of how the GPU / fullscreen applications work if you think that. It's simply not that easy.
You also seem to be forgetting that LWJGL is just an OpenGL wrapper API with very few embellishments (OpenAL and JInput, basically); adding a complex AI for something as esoteric as multi-monitor fullscreen is just not fully in line with LWJGL itself. Please note that a focused API is much better than an API with a bunch of random features added in. In this case, especially because this particular addition would come in priority after a long line of other functionality.
Side Note: It's confusing to randomly rename the topic on a whim - please don't do that. Again, start a new topic.