Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (685)
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 / Java 2D / Re: Graphics2D / BufferStrategy / Swing mess on: 2005-11-04 21:36:52
i am re-starting this thread because i am having a similar problem with swing and a buffer strategy.
i am in the middle of creating a new game engine for an existing application which uses a lot of swing components throughout.
my goal is to make the app double buffered and fullscreen.
for the past week i've been trying to make it happen, and with the help of previous posts and some online tutorials regarding this subject, i think i am almost there.

the last thing (i hope) that i've stumbled on is swing ui components not responding to mouse input.
i have created a very simple test case which shows the problem.  everything displays fine, but the JSlider does not respond to the mouse.  there is an input listener class which handles keyboard and mouse input.  it works correctly for the keyboard (ie pressing escape exits the game)  but does not receive the JSlider data.   I was not sure what the "autopaint" suggestion was referring to.

if someone would be willing to take a look at this and offer some suggestions, i would be most appreciative.

thanks for your time

the code is linked here:
2  Java Game APIs & Engines / JOGL Development / 65535 bytes limit on: 2004-08-20 17:16:21
I'm running in to this error when I try to make a class that contains vertex array data that has been converted from an .obj file.  

Is the best way to handle this to read the vertex data from a file into a buffer? Will this slow down object instantiation?  Is there a better way?  Does anyone have any examples of how to handle this limitation?

Many thanks for any replies,
3  Java Game APIs & Engines / JOGL Development / Re: glDrawElements compiler error on: 2004-08-09 20:29:10
Okay, everything makes sense for the most part.  I've created an IntBuffer to use for my indices.  First I tried replacing this gl code:

glDrawElements(GL_TRIANGLE_STRIP, 80, GL_UNSIGNED_INT, &Inidices[0]);
glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_INT, &Inidices[80]);

with this java code:

gl.glDrawElements(GL.GL_TRIANGLE_STRIP, 80, GL.GL_UNSIGNED_INT, indexBuffer.position(0));
gl.glDrawElements(GL.GL_TRIANGLE_STRIP, 4, GL.GL_UNSIGNED_INT, indexBuffer.position(80));

this draws the first call, but not the second.  I guess this is what Tom means when he says JOGL doesn't respect position and limit. fine. so than I tried:

gl.glDrawElements(GL.GL_TRIANGLE_STRIP, 80, GL.GL_UNSIGNED_INT, indexBuffer.position(0).slice());
gl.glDrawElements(GL.GL_TRIANGLE_STRIP, 4, GL.GL_UNSIGNED_INT, indexBuffer.position(80).slice());

but this gives an error because position returns a Buffer not an IntBuffer and slice is not defined for Buffer.  What worked is this:
IntBuffer slc;
slc = indexBuffer.slice();
gl.glDrawElements(GL.GL_TRIANGLE_STRIP, 80, GL.GL_UNSIGNED_INT, slc);
slc = indexBuffer.slice();
gl.glDrawElements(GL.GL_TRIANGLE_STRIP, 4, GL.GL_UNSIGNED_INT, slc);

I could not figure out how to cast indexBuffer.position().slice() to an IntBuffer.  Is there a way to do this all on one line?  The reason being I have several lines from several C code opengl files that I need to convert to java using grep and I'm not that good a scripting, so I'm just trying to convert them line for line, rather than turning the 2 lines of code into 6.

Does anybody have any suggestions of a way to do this, or do I have to dust off my perl manual?

thanks for replies, rob
4  Java Game APIs & Engines / JOGL Development / Re: glDrawElements compiler error on: 2004-08-07 16:17:35
thanks for the reply, however I'm confused how I will make my next call to DrawElements.  In C it is:

      glDrawElements(GL_TRIANGLE_STRIP, 80, GL_UNSIGNED_INT, &Indices[0]);
glDrawElements(GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_INT, &Inidices[80]);
How am I supposed to pass in the new position of the indices array for the next call if all I'm passing is an array reference?  
My apologies for the newbie question.
5  Java Game APIs & Engines / JOGL Development / Re: glDrawElements compiler error on: 2004-08-06 22:30:20

private static int Indices[] = {1, 2, ...}
6  Java Game APIs & Engines / JOGL Development / glDrawElements compiler error on: 2004-08-06 19:30:36
I'm getting a complie error when using glDrawElements with an int index array like so:
gl.glDrawElements(GL.GL_TRIANGLE_STRIP, 80, GL.GL_UNSIGNED_INT, Indices[0]);

the compiler error is:
The method glDrawElements(int, int, int, boolean[]) in the type GL is not applicable for the arguements (int, int, int, int)
I know the int argument I've given is valid, so why the error?
I've searched the forum, but only found threads regarding runtime errors, which seem unrelated.
I'm using Eclipse on mac 10.3.4 with the latest jogl beta binaries, but I got the same error when I tested on win 2000.
Has anyone run into this or am I just doing something stupid?
thanks for any replies, rob
7  Java Game APIs & Engines / JOGL Development / game cleanup on: 2004-08-02 23:45:57
I'm working on a large swing app that has some light 2d graphics. I'm converting all the graphics to jogl.  the user creates instances of the game class from a menu, and a new gl canvas, listiener and animator are created with each game instance. Each instance is destroyed after the game finishes.  The game slows drastically after the first game is destroyed and a new game is created.
I'm looking for suggestions in what things need to be done to cleanup after jogl, short of killing the jvm.  for instance should I use the  glcanvas.removeGLEventListener() method, should I nullify the canvas?
any help is much appreciated.
8  Java Game APIs & Engines / JOGL Development / discover users vram on: 2004-07-03 20:36:24
Is there a way to poll a users machine to find out the amount of vram their video card has, or any other specs from their video card?

thanks, rob
9  Java Game APIs & Engines / JOGL Development / Re: Event Thread getting choked... on: 2004-07-03 19:53:09
does anybody know where I could get hold of this ExceptionHandler class?

I found these files in the jogl ports to the nehe demos inside the package common.  Here's the index to these jar files:

10  Java Game APIs & Engines / JOGL Development / Re: ...jogl.GLException: Unable to lock surface on: 2004-06-22 14:26:11
Make sure your window is visible before you call setBounds.  The canvas needs to be attached to the screen before you can work with it.

yes, that seems to work, although it is odd that this is not the case when the code is run on the mac.
11  Java Game APIs & Engines / JOGL Development / Re: ...jogl.GLException: Unable to lock surface on: 2004-06-21 17:31:17
I am having a similar problem and was wondering if anyone has come up with a solution to this.  I have updated with the nightly build and that didn't help.  The exception only occurs on my windows box.  The same application runs fine on the mac.  here is part of the exception trace: Unable to lock surface Unable to lock surface
at java.awt.Component.setBounds(

this comes as the result of a user pressing a button which creates a new instance of a Jwindow extended class which than adds a jogl canvas to its content pane.  the excetion occurs at this line:


thanks for any help
Pages: [1]
Dwinin (59 views)
2015-11-07 13:29:08

Rems19 (72 views)
2015-10-31 01:36:56

Rems19 (63 views)
2015-10-31 01:32:37

williamwoles (101 views)
2015-10-23 10:42:59

williamwoles (87 views)
2015-10-23 10:42:45

Jervac_ (102 views)
2015-10-18 23:29:12

DarkCart (128 views)
2015-10-16 00:58:11

KaiHH (112 views)
2015-10-11 14:10:14

KaiHH (149 views)
2015-10-11 13:26:18

BurntPizza (163 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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‑
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!