Main Menu

debug mode

Started by Qudus, June 07, 2008, 00:16:56

Previous topic - Next topic

Qudus

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

Matzon

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.

Qudus

ok, thanks. Would be nice to have binary download on the download-page for the debug jar.

Marvin

Qudus

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

Matzon

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:

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


Qudus

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:
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

Matzon

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 :)

Qudus

Thanks. That worked.

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

Marvin

Matzon

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.

Qudus

Fair enough :). Thanks.

Marvin