Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Better tracing output - patch  (Read 2482 times)
0 Members and 1 Guest are viewing this topic.
Offline abies

Sr. Member
**

Posts: 456



« on: 2003-06-21 11:14:55 »

http://jogl.dev.java.net/issues/show_bug.cgi?id=12

direct link to patch

http://nwn-j3d.sf.net/jogl/trace.diff

This patch against BuildComposablePipeline.java creates TraceGL which IMHO is a bit better. In addition to reporting function name, it dumps arguments, including arrays up to 16 values long (longer are truncucated) and return value of function if available.

Example output:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
glVertex3f(1.0517219,-0.7641209,0.25)
glNormal3f(-1.0,-1.7484555E-7,0.0)
glVertex3f(1.3,2.2729921E-7,-0.25)
glVertex3f(1.3,2.2729921E-7,0.25)
glEnd()
glEndList()
glEnable(2977)
glMatrixMode(5889)
glGetString(7936) = NVIDIA Corporation
glGetString(7937) = GeForce3/AGP/3DNOW!
glGetString(7938) = 1.4.0
isFunctionAvailable(glLoadTransposeMatrixfARB) = true
isFunctionAvailable(glLoadTransposeMatrixfARB) = true
glLoadTransposeMatrixfARB([1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0])
glFrustum(-1.0,1.0,-0.9109588861465454,0.9109588861465454,5.0,60.0)

Unfortunately, constants are not resolved at the moment - still thinking about best way for that.

Artur Biesiadowski
Offline ckline

JGO n00b
*

Posts: 15



« Reply #1 on: 2003-06-21 15:38:43 »

Awesome! This is the style TraceGL that Magician used, and it's very handy. I wanted to implement it for JOGL but just didn't have time.

Some more nice things to add at some point would be support for indenting the stuff between glBegin*()/glEnd*() pairs, and outputting the actual constant name (e.g., GL_LIGHT0) instead of its integer value. That shouldn't be too hard to do with reflection.

chris
Offline abies

Sr. Member
**

Posts: 456



« Reply #2 on: 2003-06-21 15:58:00 »

Quote

Some more nice things to add at some point would be support for indenting the stuff between glBegin*()/glEnd*() pairs, and outputting the actual constant name (e.g., GL_LIGHT0) instead of its integer value. That shouldn't be too hard to do with reflection.


Indenting is indeed not hard - I'll try to do it. As for the constants, it is unfortunately not so easy. Reflection will not tell a difference between plain int and GLenum.
Ugly solution would be to always output both integer and possible constant value - but this is not acceptable for 'serious' API. I don't think there is anything that can be done with current way it is handled. Only solution I see, is to add some kind of dump to GlueGen code, to output function prototypes in some readable form (probably just serialiazed Map) and the reading it from pipeline builder and checking exact type of 'int' arguments. Possible, but this is not few-line patch and I'm a bit afraid to play with so big changes to build system at the moment.

Artur Biesiadowski
Games published by our own members! Go get 'em!
Offline ckline

JGO n00b
*

Posts: 15



« Reply #3 on: 2003-06-21 16:16:03 »

Yes, you're right. The composable pipeline builder works purely via reflection, and doesn't have any info about the Types of the function arguments. I did it this way initially just because it was the fastest way to get a composable pipeline built.

In light of this, perhaps I'll sink some time into building an emitter a la GLEmitter so that we can generate the pipeline classes with full knowledge of type information.

-chris
Offline abies

Sr. Member
**

Posts: 456



« Reply #4 on: 2003-06-21 16:52:18 »

Indent is here
http://nwn-j3d.sourceforge.net/jogl/indent.diff

It is incremental path against previous one. I have added it to issue on jogl bugzilla, so both patches are there.

Currently it indents on glBegin and glNewList.

Artur Biesiadowski
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.092 seconds with 21 queries.