Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (526)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JOGL Development / [Solution] Re: SWT + jogl -> z ordering issues on: 2008-09-12 07:48:17
Just for the records: Solution found!

Ok. This is really somewhat hidden (or i must read more javadoc). What the snipped #209 doesn't take into account: If the size of the depthbuffer is not set on the passed on GLData object, there is no! depthbuffer.

Corrected lines of code:
1  
2  
3  
4  
GLData gld = new GLData();
gld.depthSize = 4; //measured in bytes.

org.eclipse.swt.GLCanvas canvas = new GLCanvas(gld);


everything else as usual.

Hope this helps other people having the luck to just copy & paste the snipped and than wonder about the wired/ messed up rendering.

Regards,
funsheep
2  Java Game APIs & Engines / JOGL Development / [Solution] SWT + jogl -> z ordering issues on: 2008-09-11 07:58:20
Hi,

i'm trying to use jogl with SWT. Everything is up and running with the latest jogl-release from May 2008. Somehow i have problems with z ordering although GL_DEPTH_TEST is enabled.

Below you will find my GLContext creation code (copied from Snipped #209).
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
org.eclipse.swt.GLCanvas canvas = new GLCanvas(new GLData());

canvas.setCurrent();
GLContext glcontext = GLDrawableFactory.getFactory().createExternalGLContext();
glcontext.makeCurrent();

//do some rendering and enable GL_DEPTH_TEST

glcontext.release();
glcanvas.swapBuffers();


Since i couldn't find anything to correct this problem: Has someone a solution? Maybe its the same issue for which the GLJPanel was created? And no, i don't want to use SWT_AWT bridge.

[edit]
OS: Intel Linux 32 bit. Latest nvidia driver (173.xxx). And swt 3.3.2
[/edit]
3  Java Game APIs & Engines / JOGL Development / GL Context Handling on: 2006-11-18 14:36:08
Hi *,

i am currently redesigning my renderengine and wondering about the OpenGL context handling. If i have several displaylists and VBOs, do they get invalid, if i, e.g. change into fullscreen mode (does that work with java 1.6 ?). Or, more generic, can the GL object or the GLContext object get invalid? and when yes, in which situations does that event occur?

Can the javadoc made more specific regarding this topic?

thx in advance,
funsheep

4  Java Game APIs & Engines / JOGL Development / Re: IndexedTriangleStripArray on: 2006-10-17 21:34:29
is there been a solution for this problem? My profiler says that the glGetIntegerv1() function in checkElementVBODisabled() needs 34% of the time spend in my displaymethod .

[edit]
i have made some tests, it seems, that this bottleneck only occures, when using big indexbuffers.
indexbuffer with ~500000 indices the call consumes 34% of the time.
where indexbuffer with ~3000 indices the call consumes 9% of the time.
[\edit]

i have a intel mac with a ATI X1900 and i am using the jogl-jsr231-1.0.0 build from 14. sep. 2006.


kind regards,
funsheep
5  Java Game APIs & Engines / JOGL Development / Re: [SOLVED] Attempt to make the same context current twice on thread Thread[AWT on: 2006-10-16 14:09:59
it was my fault. im using my own LibraryLoader, and didnt load the "jogl_awt"-library before the "jogl"-library, so one loadCall fixed the problem.
6  Java Game APIs & Engines / JOGL Development / [SOLVED] Attempt to make the same context current twice on thread Thread[AWT on: 2006-10-16 12:58:02
couldnt find a thread with this problem, also didnt know, if posting this to "Experiences of migrating from JOGL 1.1.1 to JSR231", so i startet a new thread.

i have the problem mentioned in the subject.

config:
* jogl-jsr231-1.0.0 from september
* mac os x 10.4.8
* intel core duo mac
* Java HotSpot(TM) Client VM (build 1.5.0_06-61, mixed mode, sharing)

i tried it with my own program, ported from jogl-1.1.1 and also with the gears demo from the jogl-demos package (also jsr231-1.0.0)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
006-10-16 15:28:22.810 java[2305] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0x11b03, name = 'java.ServiceProvider'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2006-10-16 15:28:22.811 java[2305] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (java.ServiceProvider)
Exception in thread "Thread-2" javax.media.opengl.GLException: java.lang.UnsatisfiedLinkError: JAWT_GetAWT0
   at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:271)
   at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:256)
   at javax.media.opengl.GLCanvas.display(GLCanvas.java:130)
   at com.sun.opengl.util.Animator.display(Animator.java:144)
   at com.sun.opengl.util.Animator$MainLoop.run(Animator.java:181)
   at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.UnsatisfiedLinkError: JAWT_GetAWT0
   at com.sun.opengl.impl.JAWTFactory.JAWT_GetAWT0(Native Method)
   at com.sun.opengl.impl.JAWTFactory.JAWT_GetAWT(JAWTFactory.java:38)
   at com.sun.opengl.impl.JAWT$1.run(JAWT.java:99)
   at java.security.AccessController.doPrivileged(Native Method)
   at com.sun.opengl.impl.JAWT.getJAWT(JAWT.java:95)
   at com.sun.opengl.impl.macosx.MacOSXOnscreenGLDrawable.lockSurface(MacOSXOnscreenGLDrawable.java:141)
   at com.sun.opengl.impl.macosx.MacOSXOnscreenGLContext.makeCurrentImpl(MacOSXOnscreenGLContext.java:57)
   at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:127)
   at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
   at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:298)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Attempt to make the same context current twice on thread Thread[AWT-EventQueue-0,6,main]
   at com.sun.opengl.impl.GLContextLock.lock(GLContextLock.java:83)
   at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:124)
   at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
   at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:258)
   at javax.media.opengl.GLCanvas.display(GLCanvas.java:130)
   at javax.media.opengl.GLCanvas.paint(GLCanvas.java:142)
   at sun.awt.RepaintArea.paintComponent(RepaintArea.java:276)
   at sun.awt.RepaintArea.paint(RepaintArea.java:241)
   at apple.awt.ComponentModel.handleEvent(ComponentModel.java:251)
   at java.awt.Component.dispatchEventImpl(Component.java:4097)
   at java.awt.Component.dispatchEvent(Component.java:3869)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


regards,
funsheep
7  Game Development / Performance Tuning / Re: can anyone recommend a good profiler? on: 2006-06-22 21:30:27
as mentioned in http://www.java-gaming.org/forums/index.php?topic=14127.0

a good tutorial for jip

http://www-128.ibm.com/developerworks/java/library/j-jip/?ca=dgr-lnxw01JavaProfiling#resources
8  Game Development / Performance Tuning / Re: avoiding FULL GCs on: 2006-06-22 08:32:48
my secret tip:

http://jiprof.sourceforge.net/

and a tutorial for usage:
http://www-128.ibm.com/developerworks/java/library/j-jip/?ca=dgr-lnxw01JavaProfiling#resources

the profiler takes advantage of the Java 1.5 agent interface, it hooks up direktly to the vm, causing much less impakt on performance of the messured application
9  Java Game APIs & Engines / JOGL Development / Re: Tiling Textures on: 2005-02-21 06:56:44
how you descripted it, you now have a quad for the floor. and the standard texturecoordinates {(0,0), (0,1), (1,0), (1,1)}. when you want to tile the texture, you have to scale the texturecoordinates: e.g. {(0,0), (0,4), (4,0), (4,4)} - you get 4 tiles in each direction. when you want to tile only in one direction. you will have to do something like that: {(0,0), (0,1), (4,0), (4,1)}
hope that helps.
10  Java Game APIs & Engines / JOGL Development / Re: How can I add the JOGL JavaDoc to Eclipse? on: 2005-01-23 08:36:35
or you just download the precompiled binaries + the source.zip.

and attach the zip to the jar
11  Java Game APIs & Engines / JOGL Development / Re: Loading textures in a Thread on: 2005-01-22 10:04:43
I think, u should have something like a texturefactory, that loads the file into a BufferedImage and converts it into a bytebuffer, also it should prevend from loading the same texture twice.
Then there have to be some sort of sync with your jogl thread, to notice him, that the texture is loaded and ready to be binded.

Than the jogl thread should have access to some sort of a TextureLibrary, which also knows, if the texture is already binded, if it is in the graphicscard memory, etc.

The texturefactory should have something like this:
1  
2  
3  
4  
5  
6  
7  
8  
public int bind(Texture2D tex)
{
     /* look if it is already binded */

    /* if not, maybe convert it and bind it */

    /* return the bindid */
}


also look at this thread for a good implementation of such things. only, u will have to split the TextureLoader into a Converter file -> BufferedImage/ByteBuffer and a Converter Image/buffer -> opengl int

http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jogl;action=display;num=1058674409
12  Java Game APIs & Engines / JOGL Development / Re: So you like Textures eh? Texturing Demo in JOG on: 2005-01-18 13:18:22
i'm currently porting the postet files to my own application. we are using a sever <-> client concept, where the server loads the textures from a db and then transfer them to the client. so i will split both files into a version without OpenGL (for the server) and a conversion + binding loader/manager on the client side.

currently i'm wondering, if i save the byte array in the db or the real file...

i will post again, when its done Smiley

regards,
funsheep
13  Java Game APIs & Engines / JOGL Development / Re: So you like Textures eh? Texturing Demo in JOG on: 2005-01-18 08:52:46
hi there,

saw the "get2Fold" method in the TextureLoader. I am using the following elegant code snippet for this job

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
      /**
       * Generates the next power of two.
       * @param in An int.
       * @return The next power of two.
       */

      public static final int nextPowerOf2(int in)
      {
             in -= 1;

             in |= in >> 16;
             in |= in >> 8;
             in |= in >> 4;
             in |= in >> 2;
             in |= in >> 1;

             return in + 1;
      }


got this from a c library, actually, i currently don't know, which one it was. if you guys want to know, i can search for it.

regarts,
funsheep
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (72 views)
2014-11-26 15:22:04

toopeicgaming1999 (61 views)
2014-11-26 15:20:36

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (28 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (26 views)
2014-11-24 19:59:16

trollwarrior1 (39 views)
2014-11-22 12:13:56

xFryIx (78 views)
2014-11-13 12:34:49

digdugdiggy (56 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!