LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: baegsi on January 28, 2005, 19:43:34

Title: Sys.alert after Display.create fails
Post by: baegsi on January 28, 2005, 19:43:34
I can't get Sys.alert() to display a message after Display.create() fails
try {
 Sys.alert("test", "Before create");
 Display.create();
 Sys.alert("test", "Success");
} catch (LWJGLException e) {
 Sys.alert("test", "Failure");
}

On an openGl enabled machine I got two alerts => "Before create" => "Success"
On a non-openGL enabled machine I got one alert => "Before create"
but nothing more.

I need Sys.alert() to work because I won't have any other means to show an user a message in case he doesn't meet the requirements.

BTW - Alien Flux (very old version though) does show an alert after display.create() fails. So it is possible. But I can't see what I do wrong. The code above is all I do. Any ideas?
Title: Sys.alert after Display.create fails
Post by: elias on January 28, 2005, 20:11:00
Exception? Native crash? Hang (check with 'ctrl-\')? OS version?

- elias
Title: Sys.alert after Display.create fails
Post by: baegsi on January 28, 2005, 20:29:49
No hang, No exception, no crash since everything runs as supposed, i.e it goes into the catch block and finishes there, except that it does not bring up the alert window.

Os: Win 98 on a non-accelerated graphics card.
Title: Sys.alert after Display.create fails
Post by: baegsi on January 28, 2005, 20:41:56
To make it a little more clear here a modified code:
try {
           Sys.alert("test", "Before create");
           Display.create();
           Sys.alert("test", "Success");
       } catch (LWJGLException e) {
           System.out.println("Catch block entered");
           Sys.alert("test", "Failure");
           e.printStackTrace();
       }


Has following result: an alert window shows up displaying "Before create" and then following output:

Catch block entered
org.lwjgl.LWJGLException: Could not apply pixel format to window
       at org.lwjgl.opengl.Win32Display.createWindow(Native Method)
       at org.lwjgl.opengl.Display.createWindow(Display.java:218)
       at org.lwjgl.opengl.Display.create(Display.java:533)
       at org.lwjgl.opengl.Display.create(Display.java:507)
       at com.levelfactory.game.desktop.test.TestSys.main(TestSys.java:21)

but no alert saying "Failure" shows up
I'm using lwjgl .94
Title: Sys.alert after Display.create fails
Post by: elias on January 28, 2005, 20:47:22
Try 0.95. I fixed a bug regarding Sys.alert in that release.

- elias
Title: Sys.alert after Display.create fails
Post by: baegsi on January 28, 2005, 21:22:47
Nope, sorry, that's not it. I also checked 0.93 with same outcome. BUT:

I downloaded as a test the current AlienFlux demo. Same result here: no warning message whatsoever, the game just doesn't run (bad for business :( ). But the old version of AF I have does indeed bring up the alert. So I checked my code again using the very old version 0.90 of lwjgl (with Window.create() instead of Display.create) and voila: here finally as supposed two alerts are showing up including the "Failure" warning.

So a bug seemed to be introduced somewhere between 0.90 and 0.93.
Title: Sys.alert after Display.create fails
Post by: elias on January 28, 2005, 22:43:44
I found the bug and it's fixed in CVS now.

 - elias
Title: Sys.alert after Display.create fails
Post by: baegsi on January 29, 2005, 09:49:43
Thanks a lot, that was fast.

One question: I checked out the source from CVS. I ran the ant build file but I guess I need some sort of c++ toolkit in order to compile the dlls, right? (I don't have one, in that case I'll better wait for the next release.)
Title: Sys.alert after Display.create fails
Post by: Matzon on January 29, 2005, 10:32:19
yeah - but this is all included in Mac & linux. For windows the easiest option is to use the free Microsoft compiler kit: http://msdn.microsoft.com/visualc/vctoolkit2003/
Title: Sys.alert after Display.create fails
Post by: baegsi on January 29, 2005, 16:15:19
You don't happen to have a current build available, do you?
Title: Sys.alert after Display.create fails
Post by: elias on January 29, 2005, 18:13:06
Sure:

http://odense.kollegienet.dk/~naur/lwjgl.dll

- elias
Title: Sys.alert after Display.create fails
Post by: baegsi on January 30, 2005, 13:18:15
Thanks! Sys.alert works now :)