Show Posts
|
|
Pages: [1]
|
|
2
|
Java Game APIs & Engines / JOGL Development / Re: Problem building mipmaps on OSX
|
on: 2005-06-04 08:00:24
|
|
I just tried my code with JOGL 1.1b12 and there's been progress! With the java version of the glu library, some of my mipmaps are built correctly!
The ones that fail are mipmaps made from 1x1 textures. There's a bug in the algorithm in BuildMipmap.java:gluBuild2DMipmapLevelsCore() when width, height, widthPowerOf2 and heightPowerOf2 are equal to 1. We enter the if statement (if (width == newwidth && height == newheight)) and get down to the switch(type) statement where I'm passing in GL.GL_UNSIGNED_BYTE, so we call HalveImage.halveImage_ubyte() with width and height = 1. But halveImage_ubyte() has an assertion that width and height can't both be 1 so we fail.
There's obviously a bug in the control flow here. Here's a stack trace of the error:
Caused by: java.lang.AssertionError at net.java.games.jogl.impl.mipmap.HalveImage.halveImage_ubyte(HalveImage.java:95) at net.java.games.jogl.impl.mipmap.BuildMipmap.gluBuild2DMipmapLevelsCore(BuildMipmap.java:365) at net.java.games.jogl.impl.mipmap.Mipmap.gluBuild2DMipmaps(Mipmap.java:719) at net.java.games.jogl.impl.GLUImpl.gluBuild2DMipmapsJava(GLUImpl.java:587) at net.java.games.jogl.impl.GLUImpl.gluBuild2DMipmaps(GLUImpl.java:823) at torusworld.TextureManager.initTexture(TextureManager.java:196) at torusworld.TextureManager.initNewTextures(TextureManager.java:146) at torusworld.TorusWorld.drawTurtle(TorusWorld.java:2111) at torusworld.TorusWorld.renderMobileObject(TorusWorld.java:2059) at torusworld.TorusWorld.renderMobileObjects(TorusWorld.java:1990) at torusworld.TorusWorld.drawIt(TorusWorld.java:1907) at torusworld.TorusWorld.display(TorusWorld.java:1275) at net.java.games.jogl.impl.GLDrawableHelper.display(GLDrawableHelper.java:74) at net.java.games.jogl.GLCanvas$DisplayAction.run(GLCanvas.java:249) at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:292) at net.java.games.jogl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:266)
|
|
|
|
|
4
|
Java Game APIs & Engines / JInput / Re: Can't compile nightly build on OSX
|
on: 2005-04-26 19:37:58
|
|
Sorry, here's the full build log for both jutils, then jinput. The jinput.jar file is created. The ant script copied it to jinput/plugins/DX8/lib. That seems like the wrong place for an OSX build, no?
Andrew
[Brisket:~/Developer/jutils] abegel% ant Buildfile: build.xml
init:
compile:
jar: [copy] Copying 1 file to /Users/abegel/Developer/jinput/coreAPI/lib [copy] Copying 1 file to /Users/abegel/Developer/jinput/plugins/DX8/lib
all: [echo] Application built. Hello ${hello}!
BUILD SUCCESSFUL Total time: 1 second [Brisket:~/Developer/jutils] abegel% cd .. [Brisket:~/Developer] abegel% cd jinput/ [Brisket:~/Developer/jinput] abegel% ant Buildfile: build.xml
init:
core:
init:
compile: [javac] Compiling 17 source files to /Users/abegel/Developer/jinput/coreAPI/classes
jar: [jar] Building jar: /Users/abegel/Developer/jinput/coreAPI/bin/jinput.jar [copy] Copying 1 file to /Users/abegel/Developer/jinput/plugins/DX8/lib
all: [echo] JInput has been built and jinput.jar is located in the bin directory.
windows_plugin:
linux_plugin:
OSX_plugin:
init: [mkdir] Created dir: /Users/abegel/Developer/jinput/plugins/OSX/classes [mkdir] Created dir: /Users/abegel/Developer/jinput/plugins/OSX/dist
compile: [javac] Compiling 7 source files to /Users/abegel/Developer/jinput/plugins/OSX/classes [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:167: cannot resolve symbol [javac] symbol : class ButtonID [javac] location: class net.java.games.input.OSXMouse.ButtonImpl [javac] public ButtonImpl(ButtonID id, InputControllerElement element) [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:202: cannot resolve symbol [javac] symbol : class AbstractAxis [javac] location: class net.java.games.input.OSXMouse.BallAxis [javac] class BallAxis extends AbstractAxis [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:211: cannot resolve symbol [javac] symbol : class Identifier [javac] location: class net.java.games.input.OSXMouse.BallAxis [javac] public BallAxis(Identifier id, InputControllerElement element) [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXKeyboard.java:225: cannot resolve symbol [javac] symbol : class KeyID [javac] location: class net.java.games.input.OSXKeyboard [javac] KeyID id = (KeyID)key.getIdentifier(); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXKeyboard.java:225: cannot resolve symbol [javac] symbol : class KeyID [javac] location: class net.java.games.input.OSXKeyboard [javac] KeyID id = (KeyID)key.getIdentifier(); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:108: package Axis does not exist [javac] x = new BallAxis( Axis.Identifier.X, element ); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:113: package Axis does not exist [javac] y = new BallAxis( Axis.Identifier.Y, element ); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:118: package Axis does not exist [javac] wheel = new BallAxis( Axis.Identifier.SLIDER, element ); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:140: cannot resolve symbol [javac] symbol : variable ButtonID [javac] location: class net.java.games.input.OSXMouse.ButtonsImpl [javac] left = new ButtonImpl( ButtonID.LEFT, element ); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:144: cannot resolve symbol [javac] symbol : variable ButtonID [javac] location: class net.java.games.input.OSXMouse.ButtonsImpl [javac] right = new ButtonImpl( ButtonID.RIGHT, element ); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:148: cannot resolve symbol [javac] symbol : variable ButtonID [javac] location: class net.java.games.input.OSXMouse.ButtonsImpl [javac] middle = new ButtonImpl( ButtonID.MIDDLE, element ); [javac] ^ [javac] 11 errors
BUILD FAILED file:/Users/abegel/Developer/jinput/plugins/OSX/build.xml:15: Compile failed; see the compiler error output for details.
Total time: 4 seconds
|
|
|
|
|
5
|
Java Game APIs & Engines / JOGL Development / Re: Problem building mipmaps on OSX
|
on: 2005-04-26 19:34:18
|
|
Added -Djogl.glu.nojava makes my program succeed. And I miswrote earlier. The original texture is 128x128, not 256x256.
According to the Java code in mipmap.Mipmap.closestFit() in Mipmap.java:259, the GL_PROXY_TEXTURE_2D argument to glTexImage2D() is passed explicitly and on purpose.
I haven't used JOGL's TraceGL before. I'll read up on it and figure out how to use it.
I'll also report this as a bug on the Issue tracker.
|
|
|
|
|
6
|
Java Game APIs & Engines / JInput / Can't compile nightly build on OSX
|
on: 2005-04-26 09:02:39
|
|
When I try to compile the nightly build of jinput on OSX (from March 25, 2005) jinput-1.1.0-b04-src.tar.gz, I get this compile error. Is there any updated source code (cvs HEAD shows the same problem) that actually compiles?
Andrew
compile: [javac] Compiling 7 source files to /Users/abegel/Developer/jinput/plugins/OSX/classes [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:167: cannot resolve symbol [javac] symbol : class ButtonID [javac] location: class net.java.games.input.OSXMouse.ButtonImpl [javac] public ButtonImpl(ButtonID id, InputControllerElement element) [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:202: cannot resolve symbol [javac] symbol : class AbstractAxis [javac] location: class net.java.games.input.OSXMouse.BallAxis [javac] class BallAxis extends AbstractAxis [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:211: cannot resolve symbol [javac] symbol : class Identifier [javac] location: class net.java.games.input.OSXMouse.BallAxis [javac] public BallAxis(Identifier id, InputControllerElement element) [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXKeyboard.java:225: cannot resolve symbol [javac] symbol : class KeyID [javac] location: class net.java.games.input.OSXKeyboard [javac] KeyID id = (KeyID)key.getIdentifier(); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXKeyboard.java:225: cannot resolve symbol [javac] symbol : class KeyID [javac] location: class net.java.games.input.OSXKeyboard [javac] KeyID id = (KeyID)key.getIdentifier(); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:108: package Axis does not exist [javac] x = new BallAxis( Axis.Identifier.X, element ); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:113: package Axis does not exist [javac] y = new BallAxis( Axis.Identifier.Y, element ); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:118: package Axis does not exist [javac] wheel = new BallAxis( Axis.Identifier.SLIDER, element ); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:140: cannot resolve symbol [javac] symbol : variable ButtonID [javac] location: class net.java.games.input.OSXMouse.ButtonsImpl [javac] left = new ButtonImpl( ButtonID.LEFT, element ); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:144: cannot resolve symbol [javac] symbol : variable ButtonID [javac] location: class net.java.games.input.OSXMouse.ButtonsImpl [javac] right = new ButtonImpl( ButtonID.RIGHT, element ); [javac] ^ [javac] /Users/abegel/Developer/jinput/plugins/OSX/src/java/net/java/games/input/OSXMouse.java:148: cannot resolve symbol [javac] symbol : variable ButtonID [javac] location: class net.java.games.input.OSXMouse.ButtonsImpl [javac] middle = new ButtonImpl( ButtonID.MIDDLE, element ); [javac] ^ [javac] 11 errors
BUILD FAILED file:/Users/abegel/Developer/jinput/plugins/OSX/build.xml:15: Compile failed; see the compiler error output for details.
|
|
|
|
|
7
|
Java Game APIs & Engines / JOGL Development / Problem building mipmaps on OSX
|
on: 2005-04-26 06:46:56
|
|
I'm having a problem building a 2D mipmap on JOGL 1.1b10 on OSX 10.3.9 (Powerbook G4 ATI Radeon 9700 card). No matter what image I send to the function, it keeps giving me a GL_INVALID_VALUE exception inside of an internal call to glTexImage2D. Here's the code:
glu.gluBuild2DMipmaps( texture.target, texture.dstPixelFormat, texture.width, texture.height, texture.srcPixelFormat, GL.GL_UNSIGNED_BYTE, texture.byteBuffer );
where, texture.target is GL_TEXTURE_2D, dstPixelFormat is GL_RGBA, srcPixelFormat is GL_RGBA, width and height are 256 and byteBuffer points to image data loaded from a PNG file (which looks ok with Preview).
The error I get is this:
Initializing new texture 22 - /Users/abegel/Developer/eandl/starlogo-tng/build/models/hulk/blue.png building mipmap for image width: 256 height: 256 net.java.games.jogl.GLException: glGetError() returned the following error codes after a call to glTexImage2D(): GL_INVALID_VALUE at net.java.games.jogl.DebugGL.checkGLGetError(DebugGL.java:13901) at net.java.games.jogl.DebugGL.glTexImage2D(DebugGL.java:10554) at net.java.games.jogl.impl.mipmap.Mipmap.closestFit(Mipmap.java:259) at net.java.games.jogl.impl.mipmap.Mipmap.gluBuild2DMipmaps(Mipmap.java:676) at net.java.games.jogl.impl.GLUImpl.gluBuild2DMipmapsJava(GLUImpl.java:587) at net.java.games.jogl.impl.GLUImpl.gluBuild2DMipmaps(GLUImpl.java:823) at torusworld.TextureManager.initTexture(TextureManager.java:186) at torusworld.TextureManager.initNewTextures(TextureManager.java:137) at torusworld.TorusWorld.drawTurtle(TorusWorld.java:2076) at torusworld.TorusWorld.renderMobileObject(TorusWorld.java:2024) at torusworld.TorusWorld.renderMobileObjects(TorusWorld.java:1957) at torusworld.TorusWorld.drawIt(TorusWorld.java:1874) at torusworld.TorusWorld.display(TorusWorld.java:1249) at net.java.games.jogl.impl.GLDrawableHelper.display(GLDrawableHelper.java:74) at net.java.games.jogl.GLCanvas$DisplayAction.run(GLCanvas.java:241) at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:292) at net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext.invokeGL(MacOSXOnscreenGLContext.java:84) Using Apple's OpenGL Profiler, I found the arguments for the offending glTexImage2D() call at the end of this sequence (the calls above it are definitely my own that happen before the gluBuild2DMipmap code):
/* context 0x023a9800 */ glGenTextures(14, 0x49ff88ec); /* context 0x023a9800 */ glGetError(); /* returns: GL_ZERO */ /* context 0x023a9800 */ glBindTexture(GL_TEXTURE_2D, 18); /* context 0x023a9800 */ glGetError(); /* returns: GL_ZERO */ /* context 0x023a9800 */ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); /* context 0x023a9800 */ glGetError(); /* returns: GL_ZERO */ /* context 0x023a9800 */ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); /* context 0x023a9800 */ glGetError(); /* returns: GL_ZERO */ /* context 0x023a9800 */ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); /* context 0x023a9800 */ glGetError(); /* returns: GL_ZERO */ /* context 0x023a9800 */ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); /* context 0x023a9800 */ glGetError(); /* returns: GL_ZERO */ /* context 0x023a9800 */ glGetString(GL_VERSION); /* context 0x023a9800 */ glGetError(); /* returns: GL_ZERO */ /* context 0x023a9800 */ glTexImage2D(GL_PROXY_TEXTURE_2D, 1, GL_RGBA, 64, 64, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0x00000000); /* context 0x023a9800 */ glGetError(); /* returns: GL_INVALID_VALUE */
Any idea what I can do to debug this further? This works perfectly with the same JOGL on a PC running WinXP with an NVidia card.
Thanks,
Andrew
|
|
|
|
|
8
|
Java Game APIs & Engines / JOGL Development / Re: Compiling JOGL on OSX
|
on: 2003-08-11 22:16:18
|
|
Thanks for posting a new build, even if there's no real changes. I tried compiling JOGL myself, but ran into the problem listed in my first message in this thread (that was unresolved by the helpful suggestions of the other replies). I'm less than amazed by ant, esp. re: classloaders and separating different java programs in the same JVM image (which is obviously where I'm having problems).
|
|
|
|
|
9
|
Java Game APIs & Engines / JOGL Development / Re: Compiling JOGL on OSX
|
on: 2003-08-11 07:33:27
|
|
The stack trace was cut and pasted in, no alterations were made.
If you download the July 17th build from the File Sharing section of this website and run javap -c on net.java.games.jogl.impl.macosx.JAWT_MacOSXDrawingSurfaceInfo, you'll see a cocoaWindowRef() method.
Compiled from JAWT_MacOSXDrawingSurfaceInfo.java public class net.java.games.jogl.impl.macosx.JAWT_MacOSXDrawingSurfaceInfo extends java.lang.Object { public static int size(); public net.java.games.jogl.impl.macosx.JAWT_MacOSXDrawingSurfaceInfo(); public net.java.games.jogl.impl.macosx.JAWT_MacOSXDrawingSurfaceInfo(java.nio.ByteBuffer); public java.nio.ByteBuffer getBuffer(); public net.java.games.jogl.impl.macosx.JAWT_MacOSXDrawingSurfaceInfo cocoaViewRef(long); public long cocoaViewRef(); public net.java.games.jogl.impl.macosx.JAWT_MacOSXDrawingSurfaceInfo cocoaWindowRef(long); public long cocoaWindowRef(); public net.java.games.jogl.impl.macosx.JAWT_MacOSXDrawingSurfaceInfo cgContextRef(long); public long cgContextRef(); }
Granted, there's also a cocoaViewRef() method. And, if you disassemble the net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext class, the lockSurface() method calls cocoaViewRef(), not cocoaWindowRef(). So, I can't explain what's going on. All I know is that my error is quite repeatable.
There's no other jogl in my CLASSPATH and none in /Library/Java/Extensions.
Perhaps someone could post a more up-to-date build, and perhaps this problem might go away?
Thanks.
Andy
|
|
|
|
|
10
|
Java Game APIs & Engines / JOGL Development / Re: Compiling JOGL on OSX
|
on: 2003-08-09 08:38:51
|
|
Nope, it's not in my /Library/Java/Extensions folder. It's in /usr/local/pkg/antlr-2.7.2/share/antlr-2.7.2/antlr.jar.
I did try downloading the JOGL build from July 2 and that works for me. I think the telltale sign here is the reference to cocoaWindowRef() which doesn't exist in OSX 10.3's jawt_md.h file (replaced by cocoaViewRef()). Maybe the july 17th build was a half-hearted attempt at OSX 10.2 compatiblity?
|
|
|
|
|
11
|
Java Game APIs & Engines / JOGL Development / Compiling JOGL on OSX
|
on: 2003-08-09 07:35:16
|
|
I've tried to compile JOGL on OSX (10.3) and I've run into big problems. I've got ant and antlr installed, but when I do ant macosx It runs through all the build steps but fails java.generate: java.generate.check:
java.generate: [gluegen] Exception in thread "main" java.lang.NoClassDefFoundError: antlr/TokenStreamException
BUILD FAILED file:/Volumes/Tsimmes/Users/abegel/Developer/eandl/jogl/make/build.xml:524: GlueGen returned: 1
I've set antlr.jar variable in host.properties to the antlrall.jar from the antlr-2.7.2 download (antlr.jar didn't work) and antlr successfully ran on a few things, but then fails here. I've verified that antlrall.jar does have antlr.TokenStreamException.class in it. I'm using ant 1.5.3 that I built from source.
What can I do? I've tried using the prebuilt jogl.jar file from july 17, but that doesn't work on my system (gives the following error on the first paint call:
java.lang.IndexOutOfBoundsException: 0 at java.nio.DirectIntBufferU.get(DirectIntBufferU.java:196) at net.java.games.gluegen.runtime.StructAccessor.getIntAt(StructAccessor.java:118) at net.java.games.jogl.impl.macosx.JAWT_MacOSXDrawingSurfaceInfo.cocoaWindowRef(JAWT_MacOSXDrawingSurfaceInfo.java:63) at net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext.lockSurface(MacOSXOnscreenGLContext.java:233) at net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext.makeCurrent(MacOSXOnscreenGLContext.java:134) at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:153) at net.java.games.jogl.impl.macosx.MacOSXOnscreenGLContext.invokeGL(MacOSXOnscreenGLContext.java:73) at net.java.games.jogl.GLCanvas.displayImpl(GLCanvas.java:179) at net.java.games.jogl.GLCanvas.paint(GLCanvas.java:92) at sun.awt.RepaintArea.paint(RepaintArea.java:177) at apple.awt.ContainerModel.paintDamagedArea(ContainerModel.java:105) at apple.awt.PeerPaintEvent.dispatch(PeerPaintEvent.java:172) at apple.awt.CocoaEvent$1.run(CocoaEvent.java:86) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178) at apple.awt.CocoaEvent.dispatch(CocoaEvent.java:45) at java.awt.EventQueue.dispatchEvent(EventQueue.java:448) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:230) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
Thanks
Andy
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|