LWJGL Forum

Programming => OpenGL => Topic started by: Qudus on June 07, 2008, 00:16:56

Title: debug mode
Post by: Qudus on June 07, 2008, 00:16:56
Is there a way to set LWJGL into debug mode and let it execute a checkGLErrors() after each gl-call without recompiling it? That would be great, since it tends to be a nightmare to debug gl-errors when the error is only thrown with swapBuffers. I have to place a checkGLErrors() at each suspicious line in my whole code.

Marvin
Title: Re: debug mode
Post by: Matzon on June 07, 2008, 05:57:57
in platform_build.xml#generate-opengl you can comment in or out the line that says <arg value="-Ageneratechecks"/>. Once you have build that, you can do an 'ant jars' which will create lwjgl.jar in the libs folder. Rename this as lwjgl-debug.jar lwjgl.jar as appropriate. The use one or the other on the command line.
Title: Re: debug mode
Post by: Qudus on June 07, 2008, 11:33:44
ok, thanks. Would be nice to have binary download on the download-page for the debug jar.

Marvin
Title: Re: debug mode
Post by: Qudus on June 07, 2008, 12:15:51
I tried that. Unfortunately the ant-script (build.xml) seems to be made for apt-based linux distros. I am on SuSE-Linux, which is rpm-based. Well, I can install apt even on SuSE, and I did it. But it doesn't compile, since the apt-parameters don't seem to be the same. Could you possibly provide a download of the debug-lwjgl.jar? That would help me a lot.

Thanks.

Marvin
Title: Re: debug mode
Post by: Matzon on June 07, 2008, 19:34:22
I'm sorry, where does apt-get fit into the picture ?
lwjgl is purely ant based when compiling, except for the native part which assumes you have the dependencies installed.
For the debug jar you need only compile the java stuff:

Code: [Select]
svn co https://java-game-lib.svn.sourceforge.net/svnroot/java-game-lib/trunk/LWJGL lwjgl
cd lwjgl
mkdir bin
<edit platform_build/build-generator.xml>
ant jars
Title: Re: debug mode
Post by: Qudus on June 07, 2008, 21:04:30
I don't know much about ant. Could you possibly attach a modified ant script, so that only the debug lwjgl.jar is compiled?

When I try to execute ant as you say, I get this output:
Code: [Select]
Buildfile: build.xml

-initialize:
[initialiazing bin folder] Created dir: /media/sda6/lwjgl-co/lwjgl/bin/lwjgl
[initialiazing dist folder] Created dir: /media/sda6/lwjgl-co/lwjgl/dist
[initialiazing docs folder] Created dir: /media/sda6/lwjgl-co/lwjgl/doc/javadoc
[initialiazing temp folder] Created dir: /media/sda6/lwjgl-co/lwjgl/temp
[initialiazing temp/jar folder] Created dir: /media/sda6/lwjgl-co/lwjgl/temp/jar
[initialiazing temp/doc folder] Created dir: /media/sda6/lwjgl-co/lwjgl/temp/doc
[initialiazing temp/res folder] Created dir: /media/sda6/lwjgl-co/lwjgl/temp/res
[initialiazing temp/native folder] Created dir: /media/sda6/lwjgl-co/lwjgl/temp/native
[initialiazing temp/win32 folder] Created dir: /media/sda6/lwjgl-co/lwjgl/temp/native/win32
[initialiazing temp/linux folder] Created dir: /media/sda6/lwjgl-co/lwjgl/temp/native/linux
[initialiazing temp/macosx folder] Created dir: /media/sda6/lwjgl-co/lwjgl/temp/native/macosx

generators:
[generator] Compiling 81 source files to /media/sda6/lwjgl-co/lwjgl/bin

generate-openal:
    [apply] apt: error: no or unrecognized action provided
    [apply] Usage: apt [options] [apt-rpm options] <action> [packages]
    [apply] Use man apt for extended help.
    [apply] Result: 100

generate-opengl:
    [apply] apt: error: no or unrecognized action provided
    [apply] Usage: apt [options] [apt-rpm options] <action> [packages]
    [apply] Use man apt for extended help.
    [apply] Result: 100

generate-opengl-capabilities:
    [apply] apt: error: no or unrecognized action provided
    [apply] Usage: apt [options] [apt-rpm options] <action> [packages]
    [apply] Use man apt for extended help.
    [apply] Result: 100

generate-opengl-references:
    [apply] apt: error: no or unrecognized action provided
    [apply] Usage: apt [options] [apt-rpm options] <action> [packages]
    [apply] Use man apt for extended help.
    [apply] Result: 100

generate-all:

compile:

BUILD FAILED
/media/sda6/lwjgl-co/lwjgl/build.xml:229: srcdir "/media/sda6/lwjgl-co/lwjgl/src/generated" does not exist!

Total time: 5 seconds

Marvin
Title: Re: debug mode
Post by: Matzon on June 07, 2008, 21:31:32
aha!

you have to make sure that the JDK is on you path - you are unable to run APT - Annotation Processing Tool, what we use to generate the source code for some of the classes - it has nothing to do with apt-get :)
Title: Re: debug mode
Post by: Qudus on June 08, 2008, 12:30:19
Thanks. That worked.

But still. Wouldn't it make sense to provide a binary download for the debug jar?

Marvin
Title: Re: debug mode
Post by: Matzon on June 08, 2008, 13:57:54
well, since you're the first that actively wanted that, not really :)
We might do some restructuring in the future, to have a single download instead of 4 - when we get to that, I'll look into supplying (and building) a debug release too.
Title: Re: debug mode
Post by: Qudus on June 08, 2008, 14:32:15
Fair enough :). Thanks.

Marvin