Show Posts
|
|
Pages: [1]
|
|
1
|
Java Game APIs & Engines / Java Sound & OpenAL / JOAL or not?
|
on: 2010-03-28 22: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?
|
|
|
|
|
3
|
Java Game APIs & Engines / JOGL Development / Re: Net Beans and JOGL2 plugin
|
on: 2009-10-07 23:53:32
|
Yeah, there are quite a few of those infesting google  btw, are there any tutorials using the GL3? Gl3 contains openGL 3.1 if I understod correctly? 1 2
| GL3 gl = drawable.getGL().getGL3();
|
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); |
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 22: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 
|
|
|
|
|
5
|
Java Game APIs & Engines / JOGL Development / Re: Net Beans and JOGL2 plugin
|
on: 2009-10-07 20: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 20: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: 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
|
|
|
|
|
9
|
Java Game APIs & Engines / JInput / Re: Failed to poll device: Device is released??
|
on: 2009-10-06 16: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; } } |
|
|
|
|
|
11
|
Java Game APIs & Engines / JInput / Re: Axis values always -1 prior to input
|
on: 2009-10-05 21:32:33
|
oh, I totaly iverted the meaning of Dead Zone  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 21: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 20: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) |
|
|
|
|
|
15
|
Java Game APIs & Engines / JInput / Re: Failed to poll device: Device is released??
|
on: 2009-10-05 20:13:19
|
Oh we posted at the same time  I fixed the double m_deltaMouse.y = x. Very clumsy of me  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 20: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 19: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 ) { m_mouseDown.put(c.getIdentifier(), true); 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 21: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(); if( Input.getInstance().getKeyboard().isKeyDown(Identifier.Key.Q)) { System.exit(0); break; } System.out.println("delta mouse x : "+Input.getInstance().getMouse().getDelta().x ); System.out.println("delta mouse y : "+Input.getInstance().getMouse().getDelta().y ); 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 
|
|
|
|
|
19
|
Java Game APIs & Engines / JInput / Re: EventQueue on key released?
|
on: 2009-10-04 16:03:10
|
Thnx. I will make up for my laziness and post my resultning keyboad class  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 
|
|
|
|
|
22
|
Java Game APIs & Engines / JOGL Development / load matrix [][] ??
|
on: 2009-10-03 16: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
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|