Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (686)
Games in Android Showcase (197)
games submitted by our members
Games in WIP (758)
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] 2
1  Java Game APIs & Engines / JOGL Development / Re: JOGL2 status on: 2009-06-05 06:49:43
thanks, I see that - will check it out.

Is there a timetabled official release date ?
2  Java Game APIs & Engines / JOGL Development / Re: getting a deadlock with a JOGL context on: 2009-06-01 10:49:32
version 1.3, from the current release build on the JOGL website,
   Draft    kbr on Thursday, May 22, 2008 at 11:54:58 PM          JSR-231 1.1.1 binaries for Windows/x86

Hadn't heard of JOGL 2 - where can I get the binaries from, is there a stable release build, and is it (hopefully) backward-compatible ?


3  Java Game APIs & Engines / JOGL Development / getting a deadlock with a JOGL context on: 2009-05-31 11:56:04

I'm getting a bit of a funny deadlock issue with an application I'm building which uses JOGL together with Swing and AWT.

I have a class which extends Thread which is my repaint Thread.  It has an ArrayList of JFrames (including the frame with the JOGL canvas in it) and another ArrayList of classes extending from an extension of JFrame used for all my Swing/AWT frames.  There is a synchronized add() method to each arraylist, and the run() method periodically calls a synchronized private method which calls repaint() on all the panels and display() on the GL canvas (the rest of the run loop is not synchronized).  I'm not using an Animator class.

This all works fine until the user presses a button which causes the Event Dispatch Thread to call the add() method on the extended JFrames arraylist, when it deadlocks.  If I profile the app, I can see that it is the Event Dispatch Thread that is waiting on the monitor, and never seems to get into the add() method. 

Removing the 'synchronized' from either the add() method or the repaint block lets the programme run, but I've solved it a bit more robustly by wrapping the call to GLCanvas.display()  in a SwingUtilities.invokeLater(new Runnable(){}); block (ie call it from the Event Dispatch Thread after the event queue is cleared).

Just wondering if anyone can shed light on why this is doing it, and whether my solution is a good one ?  Does the GLCanvas.display() method keep the monitor on the object calling it somehow, even after it's returned ?


4  Game Development / Performance Tuning / Re: Any optimisations on Math.log() and Math.exp() ? on: 2009-01-31 10:20:29
Hi there, thanks for the response.

Actually so far in the build, the speed of the programme is holding up very well, there's plenty of time left in each cycle, so I don't think calling the Math functions is causing me any performance problems.  I'll leave them in for now, for the accuracy they give.

Of course I might come back if they do start to be too intensive down the road.

5  Game Development / Performance Tuning / Re: Any optimisations on Math.log() and Math.exp() ? on: 2009-01-17 20:07:01

Could I use JNI into that C module, or is that just silly ?
6  Game Development / Performance Tuning / Any optimisations on Math.log() and Math.exp() ? on: 2009-01-17 19:00:38

I'm writing a program which will need to call Math.log() and Math.exp() quite a bit, and knowing that these are pretty intensive functions, was wondering if anyone has written any accurate faster math optimisations of them ?

Also Math.sqrt(), I'm aware of some bitwise operation routines which are faster on some JVMs, but it seems more recent JVMs are pretty well optimised in Math.sqrt() already ?

7  Java Game APIs & Engines / JOGL Development / Cg in an applet via JNLPAppletLauncher ? on: 2009-01-13 16:58:59
I've seen a few old posts on this from a couple of years ago, but I was wondering if the situation has changed...

I've written an applet that uses JOGL and Cg.  The applet deploys via JNLPAppletLauncher and runs properly on my laptop since it is able to find the pre-installed Cg dll's on the hard drive, but if I try to run the applet on another machine without Cg pre-installed, then the applet is unable to load Cg.  JOGL deploys properly on both machines (the applet defaults to not using Cg if it's not available).

The applet launcher obviously makes some kind of attempt to launch Cg here (edited log):
VALIDATE: jogl.dll
VALIDATE: jogl_awt.dll
VALIDATE: jogl_cg.dll
EXTRACT: jogl.dll(jogl)
EXTRACT: jogl_awt.dll(jogl_awt)
EXTRACT: jogl_cg.dll(jogl_cg)
VALIDATE: gluegen-rt.dll
EXTRACT: gluegen-rt.dll(gluegen-rt)
    loading: C:\DOCUME~1\Admin\LOCALS~1\Temp\jnlp-applet\jln6444612101995085350\jln5741450139073562519\jogl.dll
    loading: C:\DOCUME~1\Admin\LOCALS~1\Temp\jnlp-applet\jln6444612101995085350\jln5741450139073562519\jogl_awt.dll
    loading: C:\DOCUME~1\Admin\LOCALS~1\Temp\jnlp-applet\jln6444612101995085350\jln5741450139073562519\jogl_cg.dll
java.lang.UnsatisfiedLinkError: C:\Documents and Settings\Admin\Local Settings\Temp\jnlp-applet\jln6444612101995085350\jln5741450139073562519\jogl_cg.dll: Can't find dependent libraries

The dependent libraries it's missing are cg.dll and cggl.dll which, from further up in the log, look like they didn't load.

Is there a .jnlp file which can load all of the Cg dll's ?

The applet is here

8  Java Game APIs & Engines / JOGL Development / Re: question on textures, alpha values and lighting on: 2009-01-13 15:10:37
Finally got round to looking at this - that was pretty useful, thank very much.

had a good play around -  gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_COMBINE_RGB, GL.GL_ADD); was the closest to what I wanted, since it could display the stickers in their proper colour, but add on the shininess on top. 

I still couldn't get the stickers to have the right diffuse material properties that I wanted though.

Instead I've written a pixel shader program in Cg to do it - it reads the incoming texel alpha value and sets the material property differently depending on whether the alpha is 0 or 1.

It works, but I have a few Cg problems though, which I've posted on the nVidea site (here and here if there are any Cg experts who fancy a look)
9  Java Game APIs & Engines / JOGL Development / Re: question on textures, alpha values and lighting on: 2008-12-21 09:57:52
thanks, I'll check that out (I'm about to go on holiday though, so won't be for a couple of weeks  Grin )
10  Java Game APIs & Engines / JOGL Development / Re: question on textures, alpha values and lighting on: 2008-12-18 18:04:51
yeah.  I presume I'll need to draw a separate quad for each sticker so that I can give it a separate material, which a bit of a pain with the way it's written, but maybe if I'm bored I'll do it
11  Java Game APIs & Engines / JOGL Development / Re: question on textures, alpha values and lighting on: 2008-12-18 13:57:10
nah, tried all the alternatives:

- Modulate - the gaps between stickers are transparent, and the stickers themselves still have their colour but have applied material on top (so appear black most of the time, but show a little bit of their colour if you can angle it just right to get some reflected specular light)

- Replace - gaps are transparent, stickers just show their own colour (ie can only see the texture), no lighting effect

- Blend - same as Modulate but the specular colour reflected is (1,1,1)-sticker colour

- no call to textureEnv - same as Modulate

I've tried it with an alternative texture, where the non-sticker parts are black instead of alpha=0 - with Modulate, the gaps between the stickers render properly, but as above, the stickers don't, they are black most of the time, and show colour only when reflecting specular

I guess what I need is for the alpha=0 parts of the texture to have one applied material, and the alpha=1 parts to have a different applied material - is that even possible ?



12  Java Game APIs & Engines / JOGL Development / question on textures, alpha values and lighting on: 2008-12-18 11:44:06

I'm continuing to work on my Rubik's cube JOGL-learning project, and am putting in lighting to make it look more interesting.

In order to get specular highlights off the black edges of the cubelets (they are slightly rounded cubes), I have given each cubelet the following material properties:

Kd 0.039216 0.039216 0.039216
Ka 0.000000 0.000000 0.000000
Ks 0.850000 0.850000 0.850000
Ke 0.000000 0.000000 0.000000
Ns 30

I then bind a texture over the top of them - the texture has solid blocks of colour with rounded edges for the stickers, and alpha=0 areas elsewhere.  I bind them together like this:

        gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA);

I am lighting the scene with a diffuse and specular light above, to the left and behind the camera and a secondary light above right and behind.

It looks like this, which I'm quite pleased with:

My question though is this:

How can I get the different faces of the cube to render in different shades as well, depending on their angle to the diffuse lights, eg in this example the blue face should be rendering darker.  If I turn the texturing off but leave everything else the same, the different faces do render in different shades properly.

I guess I'm asking how can I shade the texture colours ?

(a lot of work for rendering a cheap plastic toy !)
13  Java Game APIs & Engines / JOGL Development / Re: Mouse pointer flickering using JOGL on: 2008-12-11 21:12:30
Maybe I should just disable the custom cursor for OSX

which leads me to another problem, trying to find out if it's OSX or not.

Using a statement like


gives a security access violation

1 access denied (java.util.PropertyPermission mrj.version read)

as does System.getenv().  It'll be because the applet itself is an unsigned sub-applet running within a signed jnlpappletlauncher applet. 

Seems silly to restrict the info on the operating system, since I could easily have the applet send an http request to a cgi script on my server, which can read the os, and could then send something back - but that seems to be rather overkill just for setting a cursor...

Any bright ideas how I can check the OS from within my applet ?

<sound of head repeatedly hitting desk>

14  Java Game APIs & Engines / JOGL Development / Re: Mouse pointer flickering using JOGL on: 2008-12-11 19:57:49
gah  Cry

Maybe I should just disable the custom cursor for OSX


By the way - just a random thought from me on the mutiple tab problem for a JOGL applet (and I might be talking total garbage, so feel free to ignore) -

Isn't the GL object you get from calling GLAutoDrawable.getGL() a single-instance object, so if you have the same applet running in two tabs of the same browser, then you have one jvm, two instances of the applet class, both messing with the state of a single instance of the GL, so everything screws up ?

or... not ?

15  Java Game APIs & Engines / JOGL Development / Re: Mouse pointer flickering using JOGL on: 2008-12-11 14:54:18
ahh - you're on Mac OSX...  I couldn't reproduce the problems with Safari on Windows.

I guess the cursor reappearing is the os overriding my setting of the cursor to invisible when there's a mouse event.  I've uploaded a work-around which will re-load the invisible cursor after every mouse button event - hopefully that fixes it ?

It seems there are known problems with JOGL in Applets under OSX, discussed here.  Out of interest are you able to view these JOGL applets (not mine) without the same problems ?

Edit:  just googled the Android thing - sounds like hard work - will do it if someone wants to pay me Wink

16  Java Game APIs & Engines / JOGL Development / Re: Mouse pointer flickering using JOGL on: 2008-12-11 10:24:27
thanks for the feedback Peter,

Yeah, actually my code for trapping the mouse events to determine whether or not to draw the cursor was a little lazy, and I'd noticed a similar related bug myself last night.  Have tightened it up now, so hopefully should look  bit better ?

Regarding the two cursor problem - that may be due to supported cursor sizes in Safari, so I've put in checking for the getBestCursorSize(), and also made my invisible cursor gif a 16x16 rather than 1x1 now, so maybe that helps ?

Don't like the sounds of the CPU maxed out though - do you have any more details of what happened there ?

Not too concerned about the multiple tab problem - anyone who's not testing the game, but has a rubik's cube open in more than one tab deserves all they get  Grin 

I have had similar problems with other applets I've written in the past though - I'm guessing it's to do with one jvm with multiple instances of the applet all accessing the same static and single-instance variables.



17  Java Game APIs & Engines / JOGL Development / Re: Mouse pointer flickering using JOGL on: 2008-12-10 20:38:00
fixed it - now has the cursors as textured quads, - no flickering and now the correct size

had a nightmare getting a texture with black, white and transparent areas to render onto a transparent quad and display everything correctly, but it does now


18  Java Game APIs & Engines / JOGL Development / Re: Mouse pointer flickering using JOGL on: 2008-12-10 10:26:55
I've got cursor flickering/wrong size on two machines, both Firefox and IE, in XP.  I guess it's to do with specific graphics cards - mine are probably rubbish

When you say you're using custum cursors, are you creating textures of the cursor image and rendering it with jogl, or are you using Java's cursor support?

Yeah - was thinking that.  I'm using the standard Java cursor support at the moment, setCursor() and createCustomCursor(), but I will have a go at drawing a textured quad for a cursor instead and making the standard cursor invisible, that should at least fix the flickering, and sizing if I can get i right.  Bear with me though, I'm a JOGL noob.

Couldn't reproduce the applet showing on multiple FF tabs error, but have fixed a couple of things to do with navigating away and back to the applet now though.

19  Java Game APIs & Engines / JOGL Development / Re: Mouse pointer flickering using JOGL on: 2008-12-09 20:51:12
here's the programme to show you what I mean, it's a Rubik's Cube running as an applet:

Ignore the contents on the webpage round it, that's all WIP.

drag the mouse or use the arrow keys to spin the cube, click/right click on a face to spin it clockwise/anti-clockwise

J key jumbles it, ESC peels all the stickers off and puts it back as new.

See how the cursors flicker and are much too big ?  They are direct grabs of regular cursors, and so JOGL is growing them for some reason

20  Java Game APIs & Engines / JOGL Development / Mouse pointer flickering using JOGL on: 2008-12-09 08:46:53

I'm writing a simple game as a learning project for using JOGL, and have a problem with the mouse pointer - when the pointer is over the canvas, it flickers.  It looks like it's either only being drawn on one of the page buffers, or is only being drawn when it moves, or something like that.

I do want to use the pointer in the game, and want to use the standard pointers (the pointer and the hand) rather than create a custom pointer.

Everything else is working fine - it draws beautifully, recognises the mouse and keyboard events etc.

How can I stop the flickering ?


Edit: just tried it with custom cursors instead - I get the same flickering, but also the cursors are then drawn noticeably larger than actual size

21  Games Center / Showcase / Re: ApoStarz and ApoPrism on: 2008-11-12 09:25:32
yep, that's better.

Had my 6 and 7 year-old kids playing it yesterday evening, they loved it !
22  Games Center / Showcase / Re: ApoStarz and ApoPrism on: 2008-11-10 14:49:01
actually I did think the hint gave too much away - how about it tells you of only one misplaced object and where it should be, per hint, and only say 3 hints per level ?
23  Games Center / WIP games, tools & toy projects / Re: Battlezone !! - need Beta testing please ! on: 2008-11-10 11:37:23
Finally got it working in an applet, here:

The webstart and download links are on there too, plus links to my other games.

The Hi-Score table shared by the applet and webstart is a global one, so your scores will be saved for the rest of the world to try to beat - get on there quick before someone spanks it out of sight.

(The download app doesn't access the global hiscore, since it's a competition build, and rules say a) executable and b) no internet connectivity)


24  Games Center / Showcase / Re: ApoStarz and ApoPrism on: 2008-11-10 08:35:37
I like the prism one, managed to waste 2 hours of family time yesterday afternoon on it !
25  Discussions / General Discussions / Re: having JPanel in a JApplet problems on: 2008-11-08 11:53:27
sussed my problem - I'd got a line somewhere in the Main class in the init of the applet where I'd set JApplet applet=new Main()  and was then calling Main.applet.repaint()  so it was calling repaint on some random instantiation of the applet class that wasn't the applet on the screen.

changing that first line to JApplet applet=this; fixes it perfectly.

Onto double-buffering now, it looks horrible at the moment !
26  Discussions / General Discussions / Re: having JPanel in a JApplet problems on: 2008-11-08 11:19:47
hmm, you're absolutely right  !

Funny thing though, I'd put in a println statement in the while loop of the run() method, and that prints whether you use start() or run(), but if I put the same println in the paint method of the panel, then that only gets called with start()

Anyway, sadly that's not the cause of my problem in my game, I was using start() there anyway, and I know the game thread is running there - need to do some more thinking

Thanks though   Grin
27  Games Center / WIP games, tools & toy projects / Re: Battlezone !! - need Beta testing please ! on: 2008-11-08 10:44:38
Thanks for the great comments, chaps !!

Can you play the game in a double joystick configuration?

Absolutely you could, the key layouts are supposed to emulate that, but...  ermm...  I don't have two joysticks to program it with !
28  Discussions / General Discussions / having JPanel in a JApplet problems on: 2008-11-07 18:30:01
Can someone please help me out here - I'm obviously doing something stupid, but can't think what and am going round in circles.

This is a simple applet (actually more of a craplet) that should show a red screen, but doesn't.  It's a simplified version of something bigger that equally doesn't work.

The applet class:

import javax.swing.*;
import java.awt.*;

public class MyApplet extends JApplet implements Runnable {
    MyPanel myPanel;
    public void init(){
        myPanel=new MyPanel();
        new Thread(this).run();
    public void run(){
            try{Thread.sleep(50);}catch(Exception e){}

and the panel class:

import java.awt.*;
import javax.swing.*;

public class MyPanel extends JPanel {

    public void paint(Graphics g){
        Graphics2D g2d=(Graphics2D)g;
        g2d.fillRect(0, 0, this.getWidth(), this.getHeight());

Any ideas ?

29  Games Center / WIP games, tools & toy projects / Re: Battlezone !! - need Beta testing please ! on: 2008-11-07 13:28:22
here's a webstart link:

30  Games Center / WIP games, tools & toy projects / Re: Battlezone !! - need Beta testing please ! on: 2008-11-05 16:56:46
haha, thanks very much, I'm blushing.

Not played around with JNLP before, but I'll give it a shot when I get a chance.  I have a couple of previous games as applets (see sig), so not sure why I'm struggling with this one, but anyway, I'll get something sussed soon.
Pages: [1] 2
roseslayer (383 views)
2016-08-06 11:43:29

roseslayer (351 views)
2016-08-06 09:43:11

xTheGamerCodes (427 views)
2016-08-04 15:40:59

xTheGamerCodes (418 views)
2016-08-04 15:40:24

orrenravid (770 views)
2016-07-16 03:57:23

theagentd (845 views)
2016-07-11 14:28:54

Hydroque (936 views)
2016-07-06 05:56:57

Hydroque (977 views)
2016-07-03 08:52:54

GrandCastle (788 views)
2016-07-01 09:13:47

GrandCastle (634 views)
2016-07-01 09:09:45
Rendering resources
by Roquen
2016-08-08 05:55:21

Rendering resources
by Roquen
2016-08-08 05:52:42

Rendering resources
by Roquen
2016-08-08 05:50:38

Rendering resources
by Roquen
2016-08-08 05:49:53

Rendering resources
by Roquen
2016-08-08 05:32:39

Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42 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!