Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (568)
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 Sound & OpenAL / JOAL or not? on: 2010-03-28 20:00:41
Hello.

I'm looking for a nice sound library for 2D and 3D sound, naturally i tought of JOAL. I've seen talk about JOAL being dead.

Is it on hold or are there some new fancy sound library that eventually will take over?

JOAL is more than enough for my needs so I will most likley go with it.

But will there be any updates on JOAL in the future?
2  Java Game APIs & Engines / JOGL Development / Re: Net Beans and JOGL2 plugin on: 2009-10-07 22:59:40
thanks
3  Java Game APIs & Engines / JOGL Development / Re: Net Beans and JOGL2 plugin on: 2009-10-07 21:53:32
Yeah, there are quite a few of those infesting google  persecutioncomplex

btw, are there any tutorials using the GL3?
Gl3 contains openGL 3.1 if I understod correctly?
1  
2  
GL3 gl = drawable.getGL().getGL3();
//gl.glMatrixMode(GL3.GL_PROJECTION); this don't exist inn the GL3 interface, same goes for the GL2GL3 interface


Is it meant to mix the GL2 and GL3 depending on what you to do, eg:
1  
2  
3  
4  
5  
6  
7  
 GL2 gl2 = drawable.getGL().getGL2();
 GL3 gl3 = drawable.getGL().getGL3();

 gl2.glMatrixMode(GL2.GL_PROJECTION);
 gl2.glLoadIdentity();

gl3.glBindBuffer(height, height);//random method avaibalbele with GL3

or is the GL3 syntaxs completly new, I've now that GL3 is supose to be a major change to the API, but still backwards compatible?

//HermanssoN
4  Java Game APIs & Engines / JOGL Development / Re: Net Beans and JOGL2 plugin on: 2009-10-07 20:04:08
I remebered follwong a tutorial getting JOGLE running using eclipse. The tutorial said to put jogl.jar + dll files in the Java SDK..stupid.
Anyways, I re-installed the Java SDK and evrything works fine now.
thank you for your help.
Must say that this plugin saves the programmer lots's of tidious set up environment work, Net Beans is the way to go when dealing with JOGL Smiley
5  Java Game APIs & Engines / JOGL Development / Re: Net Beans and JOGL2 plugin on: 2009-10-07 18:45:31
Actually before installing the beta plugin I installed etbeans-opengl-pack_0.5.5 at first. Found out that that it only contained JOGL 1. So I uninstalled Netbeans, re installeda  it and the added the newer plugin.
Does is set up a system variable or something, e.g reinstalling net beans wasn't enough??

//HermanssoN
6  Java Game APIs & Engines / JOGL Development / Net Beans and JOGL2 plugin on: 2009-10-07 18:00:32
Hello, just downloaded and installed latest neatbeans and the open gl pack plugin.
I created a new project with the JOGL template (simple) and got a bunch of errors, eg:
Quote
cannot find symbol
symbol  : method getGL2()


org.yourorghere.SimpleJOGL2 is not abstract and does not override abstract method displayChanged(javax.media.opengl.GLAutoDrawable,boolean,boolean) in javax.media.opengl.GLEventListener
public class SimpleJOGL2 implements GLEventListener {


cannot find symbol
symbol  : constructor GLCapabilities(javax.media.opengl.GLProfile)
location: class javax.media.opengl.GLCapabilities
GLCapabilities capabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2));


The missing implementation of displayChanged is not a problem, just add it. but the otehr errors are not as easy.

I know that the plugin for JOGL 2 (netbeans-opengl-pack_0.6_beta) is a work in progress but I assume that the start up framewrok should work automaticly.

I use:
 Windows XP
Net Beans 6.7.1 with the netbeans-opengl-pack_0.6_beta plugin
Iv'e used JOGL 1.1 before, not with Net Beans tough.

//HermanssoN
7  Java Game APIs & Engines / JInput / Re: Axis values always -1 prior to input on: 2009-10-06 18:54:21
You wouldn't happen to have the same problem with mouse input?
8  Java Game APIs & Engines / JInput / Re: Failed to poll device: Device is released?? on: 2009-10-06 18:52:59
Same story  Huh
It seems like I don't recive any event for mouse stop.
I tried  to switch to another mouse but no change there either. I got a steady -1 in x and y. :/
9  Java Game APIs & Engines / JInput / Re: Failed to poll device: Device is released?? on: 2009-10-06 14:43:54
Also worth mentioning is that if I use this loop when polling the mouse evry thing works perfectly:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
m_mouse.poll();
           
      m_mouseQueue = m_mouse.getEventQueue();
      Event event = new Event();
      while( m_mouseQueue.getNextEvent(event))
      {
         Component c = event.getComponent();
         float data = c.getPollData();
         if(data != 0.0f )
         {
            m_mouseDown.put(c.getIdentifier(), true);
           
                       
         }
         else
         {
           
            m_mouseDown.put(event.getComponent().getIdentifier(), false);
         }
               
      }
      m_deltaMouse.x = m_mouse.getX().getPollData();
      m_deltaMouse.y = m_mouse.getY().getPollData();

If I use this version delta mouse won't be set to 0.0f when mouse is still:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
m_mouse.poll();
           
      m_mouseQueue = m_mouse.getEventQueue();
      Event event = new Event();
      while( m_mouseQueue.getNextEvent(event))
      {
         Component c = event.getComponent();
         float data = c.getPollData();
         if(data != 0.0f )
         {
            m_mouseDown.put(c.getIdentifier(), true);
            m_deltaMouse.x = m_mouse.getX().getPollData();
            m_deltaMouse.y = m_mouse.getY().getPollData();
                       
         }
         else
         {
           
            m_mouseDown.put(event.getComponent().getIdentifier(), false);
            m_deltaMouse.x = 0.0f;
            m_deltaMouse.y = 0.0f;
         }
               
      }


I allso tryed to get all data from the event as you mentioned above, when pointing out that I was mixing the old polling with the newer  queue system, but the result is the same as the atempt above,:
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  
m_mouse.poll();
           
      m_mouseQueue = m_mouse.getEventQueue();
      Event event = new Event();
      while( m_mouseQueue.getNextEvent(event))
      {
         Component c = event.getComponent();
         float data = c.getPollData();
         if(data != 0.0f )
         {
            m_mouseDown.put(c.getIdentifier(), true);
           
            if( c.getIdentifier() == Identifier.Axis.X)
               m_deltaMouse.x = c.getPollData();  
           
            if( c.getIdentifier() == Identifier.Axis.Y)
            m_deltaMouse.y = c.getPollData();  
         }
         else
         {
            m_mouseDown.put(event.getComponent().getIdentifier(), false);
           
            if( c.getIdentifier() == Identifier.Axis.X)
               m_deltaMouse.x = 0.0f;  
           
            if( c.getIdentifier() == Identifier.Axis.Y)
            m_deltaMouse.y = 0.0f;  
           
         }
         
      }



10  Java Game APIs & Engines / JInput / Re: Failed to poll device: Device is released?? on: 2009-10-06 14:31:41
I found the error.

I used following before creatingmy controlls
1  
System.setProperty("jinput.plugins", "net.java.games.input.DirectInputEnvironmentPlugin");

If I remove that no erros occure.
11  Java Game APIs & Engines / JInput / Re: Axis values always -1 prior to input on: 2009-10-05 19:32:33
oh, I totaly iverted the meaning of Dead Zone Tongue dead zone is the amount of thrust the controll can take with out registeting the input.
Anyways, what I mean is that I had to compensate for the false inut that the conotroll gave off by default, most likly becaus it was old, like the ancient Sidewinder yo mentioned.
12  Java Game APIs & Engines / JInput / Re: Axis values always -1 prior to input on: 2009-10-05 19:21:01
Could it be deadzone value??
I've never used other stuff than keyboard and mouse with JInput, I have how ever used it in a C++ app. In my case the game pad always returned like 0.2 so my character would spin with out me using the controll. I know that JInput has a getDeadZone(). by prior to input you mean before you  actualy use the controll, the you get god values?
13  Java Game APIs & Engines / JInput / Re: Failed to poll device: Device is released?? on: 2009-10-05 18:57:27
I didn't realize that it was a class in the JInput API, I tought it was an executable.

anyways, I don't understand how to use it, I tryed this:
1  
2  
3  
4  
5  
public static void main( String[]args)
{
      System.setProperty("jinput.plugins", "net.java.games.util.plugins.test.PluginTest");  
      PluginTest.main(args);
}


I got this message:
1  
2  
3  
4  
5  
6  
java.io.FileNotFoundException: Plugin directory test_plugins not found.
   at net.java.games.util.plugins.Plugins.scanPlugins(Plugins.java:82)
   at net.java.games.util.plugins.Plugins.<init>(Plugins.java:76)
   at net.java.games.util.plugins.test.PluginTest.<init>(PluginTest.java:92)
   at net.java.games.util.plugins.test.PluginTest.main(PluginTest.java:119)
   at Application.main(Application.java:56)
14  Java Game APIs & Engines / JInput / Re: Failed to poll device: Device is released?? on: 2009-10-05 18:28:07
I'm faitly new to Java and JINput, how do I run it.
I got the jinput-test folder.
15  Java Game APIs & Engines / JInput / Re: Failed to poll device: Device is released?? on: 2009-10-05 18:13:19
Oh we posted at the same time Smiley
I fixed the double  m_deltaMouse.y = x. Very clumsy of me Sad
but the eror message still is spammed?

well eclipse is running of course, Windows media player and Google Chrome.

polling like this makes no differance:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
m_mouse.poll();
           
      m_mouseQueue = m_mouse.getEventQueue();
      Event event = new Event();
      while( m_mouseQueue.getNextEvent(event))
      {
         Component c = event.getComponent();
         float data = c.getPollData();
         if(data != 0.0f )
         {
            m_mouseDown.put(c.getIdentifier(), true);
            m_deltaMouse.x = m_mouse.getX().getPollData();
            m_deltaMouse.y = m_mouse.getY().getPollData();
                       
         }
         else
         {
            m_mouseDown.put(event.getComponent().getIdentifier(), false);
         }
               
      }

16  Java Game APIs & Engines / JInput / Re: Failed to poll device: Device is released?? on: 2009-10-05 18:10:12
Ok I made some more tests:

the pooling now looks like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
m_mouse.poll();
           
      m_mouseQueue = m_mouse.getEventQueue();
      Event event = new Event();
      while( m_mouseQueue.getNextEvent(event))
      {
         Component c = event.getComponent();
         float data = c.getPollData();
         if(data != 0.0f )
         {
            m_mouseDown.put(c.getIdentifier(), true);
           
                       
         }
         else
         {
            m_mouseDown.put(event.getComponent().getIdentifier(), false);
                     }
               
      }
      m_deltaMouse.x = m_mouse.getX().getPollData();
      m_deltaMouse.y = m_mouse.getY().getPollData();

No bigg change:

the test app now looks like this:
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  
 JFrame f = new JFrame("This is a test");
       int sizeX = 400;
       int sizeY = 400;
       f.setSize(sizeX, sizeY);
     
       Container content = f.getContentPane();
       
       content.setBackground(Color.white);
       f.addWindowListener(new ExitListener());
       f.setVisible(true);
       
       
       while( true )
       {
          SharkInput.getInstance().capture();
          if( SharkInput.getInstance().getKeyboard().isKeyDown(Identifier.Key.Q))
          {
             System.exit(0);
             break;
          }
          float dx = SharkInput.getInstance().getMouse().getDelta().x;
          float dy = SharkInput.getInstance().getMouse().getDelta().y;
          if(dx  != 0.0f || dy  != 0.0f)
          {
             sizeX += dx;
             sizeY += dy;
             
             f.setSize(sizeX,sizeY);
          }
                   
       }
     
   }


The window should resize after my mouse movement and it does. But I still get the : Failed to poll device: Device is released.
Is it normal to get that? cause it seems to work.
And I guess using eclipse ouput don't give me the correct readning, most likley to many update per second. The out put will be filled instantly.
17  Java Game APIs & Engines / JInput / Failed to poll device: Device is released?? on: 2009-10-05 17:40:01
Hello, I'm trying to implement Mouse input. I've brought up the topic in another thread when asking questions about the keyboard. The reason I made a whole new thread is caus Iv'e got the error:
1  
Failed to poll device: Device is released

I'm trying to get the mouse movement using this loop:
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  
m_mouse.poll();
           
      m_mouseQueue = m_mouse.getEventQueue();
      Event event = new Event();
      while( m_mouseQueue.getNextEvent(event))
      {
         Component c = event.getComponent();
         float data = c.getPollData();
         if(data != 0.0f )
         {
                                //boolean hash map
           m_mouseDown.put(c.getIdentifier(), true);
            //deadZone is always 0.0...
                               m_deltaMouse.x = m_mouse.getX().getPollData();
            m_deltaMouse.x = m_mouse.getY().getPollData();
                       
         }
         else
         {
            m_mouseDown.put(event.getComponent().getIdentifier(), false);
            m_deltaMouse.x = 0.0f;
            m_deltaMouse.x = 0.0f;
         }
               
      }


in my main loop I print the values to the output console in Eclipse and get:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
Failed to poll device: Device is released
Failed to poll device: Device is released
delta mouse x : 0.0
delta mouse y : 0.0
Failed to poll device: Device is released
Failed to poll device: Device is released
delta mouse x : 0.0
delta mouse y : 0.0
Failed to poll device: Device is released
Failed to poll device: Device is released
delta mouse x : 0.0
and so on...


It seems like JInput looses and regains contact wit my mouse??

I'm using windows xp, and the mouse is a Razer Krait
18  Java Game APIs & Engines / JInput / Re: EventQueue on key released?(ANSWERD), simple Keyboard class example posted on: 2009-10-04 19:25:42
I also have a question about mouse input.

I can't seem to get the correct relative mouse position.

if I use event queue for the mouse it almost works, but when I hold my mouse still I still get realtive movemnt of atleast 1.0f;

if I use this approatch:
1  
2  
3  
m_mouse.poll();
m_deltaMouse.x = m_mouse.getX().getPollData()
m_deltaMouse.y = m_mouse.getY().getPollData()

the values are constant 0.0 in both X and Y.

I use windows xp.

my test app looks like this:
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  
public static void main( String[]args)
   {
     
       JFrame f = new JFrame("This is a test");
       f.setSize(1024, 768);
     
       Container content = f.getContentPane();
       content.setBackground(Color.white);
       f.addWindowListener(new ExitListener());
       f.setVisible(true);
       
       while( true )
       {
          Input.getInstance().capture();
          //Keyboard works fine
               if( Input.getInstance().getKeyboard().isKeyDown(Identifier.Key.Q))
          {
             System.exit(0);
             break;
          }
                 //event mode work's poor, "imidate" mode don't work at all"
         System.out.println("delta mouse x : "+Input.getInstance().getMouse().getDelta().x );
          System.out.println("delta mouse y : "+Input.getInstance().getMouse().getDelta().y );
           
                 //Mouse has no dead zone....
         System.out.println("\ndead zone x : "+Input.getInstance().getMouse().getDeadZone().x );
          System.out.println("\ndead zone y : "+Input.getInstance().getMouse().getDeadZone().y );
       }
     
   }

}
 class ExitListener extends WindowAdapter {
     public void windowClosing(WindowEvent event)
     {
       System.exit(0);
     }
     
   }


btw: I don't check mouse and keyboard poll in the same loop, does the getEventQueue() "steal events", feels likt that's not the case  Huh
19  Java Game APIs & Engines / JInput / Re: EventQueue on key released? on: 2009-10-04 14:03:10
Thnx.

I will make up for my laziness and post my resultning keyboad class  Roll Eyes
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  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
package Input;

import java.util.HashMap;

import net.java.games.input.Component;
import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;
import net.java.games.input.Event;
import net.java.games.input.EventQueue;
import net.java.games.input.Keyboard;
import net.java.games.input.Component.Identifier;
import net.java.games.input.Component.Identifier.Key;
import net.java.games.input.Controller.Type;

public class CKeyboard
{
   Keyboard   m_keyboard;
   EventQueue  m_keyboardQueue;
   HashMap<Identifier, Boolean> m_keyDown;
   public CKeyboard()
   {
     
      Init();
   }
   private void Init()
   {
      Controller[] inputDevices = ControllerEnvironment.getDefaultEnvironment().getControllers();
      m_keyboard = null;
      for( Controller c : inputDevices)
      {
         if( c.getType() == Type.KEYBOARD)
         {
            m_keyboard = (Keyboard)c;
            break;
         }
      }
      if( m_keyboard != null)
      {
         
         m_keyDown = new HashMap<Identifier, Boolean>();
         for( Component c : m_keyboard.getComponents())
            m_keyDown.put(c.getIdentifier(), false);
         
      }
   }
   public void capture()
   {
       if( m_keyboard == null )
         return;
     
      m_keyboard.poll();
      m_keyboardQueue = m_keyboard.getEventQueue();
      Event event = new Event();
      while( m_keyboardQueue.getNextEvent(event))
      {
         float data = event.getComponent().getPollData();
         if(data != 0.0f )
         {
            m_keyDown.put(event.getComponent().getIdentifier(), true);
         }
         else
         {
            m_keyDown.put(event.getComponent().getIdentifier(), false);
         }
      }
   }
   public boolean isKeyDown( Key k)
   {
      return m_keyDown.get(k);
   }
}


I made a quick test and it seems to work fine.
I haven't worked with HasMaps before, they are quite nice Smiley
20  Java Game APIs & Engines / JOGL Development / Re: load matrix [][] ?? on: 2009-10-04 14:00:29
Thnx
21  Java Game APIs & Engines / JInput / EventQueue on key released?(ANSWERD), simple Keyboard class example posted on: 2009-10-04 09:55:16
Hello.

Does JInput send an event when a key is released??

basicly I wan't to know if this check is valid:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
m_keyboard.poll();
      m_keyboardQueue = m_keyboard.getEventQueue();
      Event event = new Event();
      while( m_keyboardQueue.getNextEvent(event))
      {
         float data = event.getComponent().getPollData();
         if(data != 0.0f )
         {
            //Key is down, this check will work for sure


         }
         else
         {
            //Key was released, does this work??
        }
      }

22  Java Game APIs & Engines / JOGL Development / load matrix [][] ?? on: 2009-10-03 14:04:03
Hello.
I'm wondering if I can load a float array, float[][], to open GL using glLoadMatrixf ??
if that's not possible I supose I just could create a method that transforms it to a normal float [], that would't affect the performance, would it?

//HermanssoN
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.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (20 views)
2014-09-24 16:12:06

Grunnt (46 views)
2014-09-23 14:38:19

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

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

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

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

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

BurntPizza (54 views)
2014-09-19 03:14:18
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!