Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (562)
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
hello.
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
-rob.

the code TestCase.java is linked here:
http://www.robtherich.org/TestCase.java
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,
rob
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:

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


with this java code:

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

1  
2  
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:
1  
2  
3  
4  
5  
6  
7  
IntBuffer slc;
indexBuffer.position(0);
slc = indexBuffer.slice();
gl.glDrawElements(GL.GL_TRIANGLE_STRIP, 80, GL.GL_UNSIGNED_INT, slc);
indexBuffer.position(80);
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:

1  
2  
      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
ints.

1  
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:
1  
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.
-rob
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:
http://pepijn.fab4.be/nehe/index.html

-rob
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.
thanks
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:

net.java.games.jogl.GLException: Unable to lock surface
net.java.games.jogl.GLException: Unable to lock surface
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.lockSurface(WindowsOnscreenGLContext.java:155)
at net.java.games.jogl.impl.windows.WindowsOnscreenGLContext.makeCurrent(WindowsOnscreenGLContext.java:107)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:232)
at net.java.games.jogl.GLCanvas.reshape(GLCanvas.java:97)
at java.awt.Component.setBounds(Component.java:1664)


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:

canvas.setBounds(0,0,width,height);

thanks for any help
-rob
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.

radar3301 (11 views)
2014-09-21 23:33:17

BurntPizza (28 views)
2014-09-21 02:42:18

BurntPizza (18 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (27 views)
2014-09-20 20:14:06

BurntPizza (29 views)
2014-09-19 03:14:18

Dwinin (46 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!