Show Posts
|
|
Pages: [1] 2 3 4
|
|
2
|
Java Game APIs & Engines / OpenGL Development / Re: AWTGLCanvas using in Swing
|
on: 2005-04-06 19:59:34
|
|
Hi again ,
strange things going on there:
When i change the glClearColor to a Random Color the background will change randomly, but the Gears will not drawn ....
Anyone know how to setup GL again ? It should be done in componentResize ..but it do now work for me, maybe someone has an example ..
Sorry for flooding the board, Jens
|
|
|
|
|
3
|
Java Game APIs & Engines / OpenGL Development / Re: AWTGLCanvas using in Swing
|
on: 2005-04-06 14:54:15
|
I Tested a bit more whats wrong, for me it seems that i lost the Draw Context when removing the Canvas, but im not able to restore it, the API Doc to makeCurrent in AWTGLVCanvas: makeCurrent
public void makeCurrent() throws LWJGLException
Make the canvas' context current. It is highly recommended that the context is only made current inside the AWT thread (for example in an overridden paint()).
Throws: LWJGLException
Looked at the LWJGL Sources paint(Graphics g) is declared as final,and seems to do what i tried ..setting the GL Context again,so i was not able to overwrite it ... Also i implemented componentShown(...) and componentRemoved(...)..this Methods will not invoked when my canvas should show up again. The Shown Method should be called when adding the Canavs again, maybe a bug (But not responsible for my prob. )  Anyone can help ? thx, jens
|
|
|
|
|
4
|
Java Game APIs & Engines / OpenGL Development / Re: AWTGLCanvas using in Swing
|
on: 2005-04-05 14:02:26
|
Ok, there is the Code that do the Switch between both Views when user hits a Button: 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 72 73 74 75 76 77 78 79 80 81 82
| public class PlaylistSpectrumPanel extends JPanel implements Toogleable { private static Logger log = Logger.getLogger(PlaylistSpectrumPanel.class);
private final SpectrumPanel spectrumPanel; private final Playlist playlistPanel;
private boolean isSpectrumShown = true;
private ServerPanel serverPanel = new ServerPanel(new ServerTable());
private JComponent lastFileView = null;
private final AWTCanvasTest awtCanvas;
public PlaylistSpectrumPanel(AWTCanvasTest awtCanvas, SpectrumPanel spectrumPanel, Playlist playlistPanel) { super(); this.spectrumPanel = spectrumPanel; this.playlistPanel = playlistPanel; this.awtCanvas = awtCanvas; setLayout(new BorderLayout()); add(awtCanvas, BorderLayout.CENTER); lastFileView = playlistPanel;
System.out.println("awtCanvas.getPreferredSize():" + awtCanvas.getPreferredSize());
}
public void toogle() { toogleSpectrum(); }
private final void toogleSpectrum() { if (isSpectrumShown) { remove(awtCanvas); add(lastFileView, BorderLayout.CENTER); awtCanvas.donotShow(); } else { remove(lastFileView); switchView(); add(awtCanvas, BorderLayout.CENTER); awtCanvas.showAgain(); }
isSpectrumShown = isSpectrumShown ? false : true; revalidate(); updateUI(); }
private final void switchView() { if (lastFileView.equals(playlistPanel)) { lastFileView = serverPanel; } else { lastFileView = playlistPanel; } System.out.println("New View:" + lastFileView); }
} |
Actual the SpectumPanel isnt used by this example, AWTCanvasTest is the GLGear Test from LWJGL Examples (the heavyweight canvas), with this extension: 1 2 3 4 5 6 7 8 9 10 11 12
| public void showAgain() { canvas0.setVisible(true); canvas0.addNotify(); } public void donotShow() { canvas0.setVisible(false); canvas0.removeNotify(); } |
|
|
|
|
|
5
|
Java Game APIs & Engines / OpenGL Development / AWTGLCanvas using in Swing
|
on: 2005-04-05 13:03:07
|
Hi, i allready included a well working version of the AWTGears Demo as a Test in my Swing App. Looking at the CPU Usage i like it very much  Now i would like to include it more in my new Project, but i have trouble with that AWT/Swing mixing in this case: I displayed a AWTGLCanvas, later the user clicks on a button and the Canvas will disapear(removed from JPanel), when the user clicks again the canvas will be added again to the JPanel, i also see that the Thread is running and outs the FPS each 5 Seconds but i cannot see any Gears again, the Panel remains black.Can someone give me a hint what to do ? May i have to save the GL Context ? Stay Tuned, Jens
|
|
|
|
|
7
|
Java Game APIs & Engines / OpenGL Development / Re: midi or other background music alternative
|
on: 2004-11-03 11:36:21
|
Playing a Midi isn't hard at all: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| try { Sequence midi = MidiSystem.getSequence(new File("Blue_Monday.mid")); Sequencer player = MidiSystem.getSequencer();
player.open(); player.setSequence(midi); player.start(); } catch (IOException e) { e.printStackTrace(); } catch(InvalidMidiDataException e) { e.printStackTrace(); } catch(MidiUnavailableException e) { e.printStackTrace(); } } |
I do not tested it under 5.0 but it runs fine under 1.4.2. Stay Tuned, Jens
|
|
|
|
|
9
|
Java Game APIs & Engines / Java Sound & OpenAL / Re: Pop at the end of playback
|
on: 2004-10-22 15:26:04
|
|
Well, as we cannot look into winamp's sourcecode, im quite sure that winamp will do a fadeout by itself. At least winamp 0's the last byte it plays - this is not hearable even in a samplerate of 8KHZ. I do not know why you flood the forum with you code, simple write a small testcase for your needs - and judge for yourself.
Stay Tuned, Jens
|
|
|
|
|
14
|
Java Game APIs & Engines / OpenGL Development / FMOD Spectum
|
on: 2004-09-30 06:06:07
|
Hi, i made some tests to get the spectrum of a mp3, it seems to work first. But the values containing in the returned Buffer did not range form 0-1.0f as written in the FMOD API . Im taking about : 1
| public FloatBuffer FSOUND_DSP_GetSpectrum() |
Did someone also get this "wrong" floats back ? I build the lastest avaible files from CVS! - jens
|
|
|
|
|
19
|
Java Game APIs & Engines / OpenGL Development / Re: FMOD SoundStream errors with Webstart
|
on: 2004-09-24 01:44:44
|
Grrrr, today i made my first runnable webstart fmod player for win, it was successfully tested by a friend without the nasty copy the dll into /bin dir trick. All native code was stored in a single jar including fmod.dll. I also added 1
| <property key="java.library.path" value="."/> |
into the .jnlp file, and all was good  Well, after that i expanded my ant script to get also the linux version out of it. Then i added the linux resources into the .jnlp. After that Murphy came up again and i get again this java.lang.UnsatisfiedLinkError: no lwjgl-fmod3 in java.library.path error. Why the heck ? Last to say i build the lwjgl jar's out of the CVS (updated last hour). I know it was running also by a friend of mine, did someone had an idea what's wong ? - jens
|
|
|
|
|
21
|
Java Game APIs & Engines / OpenGL Development / Re: FMOD SoundStream errors with Webstart
|
on: 2004-09-16 15:48:26
|
|
I know most of this problematic, i allready made some test, but the String returned from getResource(ref) points to a URL containing "c:/blaba.jar!/your/inner/path/music.mp3" and Fmod cannot load this, as it use its internal load mechanism (note the:! ). I also tried to load it through Buffers, and it did'nt work yet, i will soon dig more into that. Basicly all you have to do is a Threaded reading and stuff that into the Buffer passing it to FMOD. Please note that not all your questions can answered there fmod.org forums may also some good info.
- jens
|
|
|
|
|
24
|
Java Game APIs & Engines / OpenGL Development / [Blending] glBlendEquation Constants ?
|
on: 2004-08-20 13:09:08
|
Hello, again i looked in the Red Book and wondered about missing something in LWJGL: 1
| GL14.glBlendEquation (GLXX.GL_FUNC_ADD); |
But why the heck are these Constants defined in ARBImaging and GL_FUNC_SUBTRACT_EXT ? I there a reason for this extension class ? (please explain  ) For me it should be in GL14 defined !! Nice Weekend & Stay Tuned, - jens
|
|
|
|
|
30
|
Java Game APIs & Engines / OpenGL Development / [Material] Shiniess using 4 float values ?
|
on: 2004-08-02 22:45:31
|
Hello, i wonder about using the GL_SHININESS property. The "OpenGL Programming Guide" brings examples using only ONE float value! Using a FloatBuffer in LWJGL produce a IllegalArgumentException if only one float wrapped, 4 floats seems to work. What i'am doing wrong or haven't understand ?  Many thanks, -Jens
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|