Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (515)
Games in Android Showcase (122)
games submitted by our members
Games in WIP (577)
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 3
1  Java Game APIs & Engines / JOGL Development / JOGL Cross platform question on: 2005-02-26 06:02:41
I have written an application using jogl.  The program makes numerous use of the navite jogl libraries (on Linux) and to be honest, works pretty damned well.

I friend of mine is running OSF unix on a Dec Alpha system and he sais: "he'd love a copy of my program".  But there are no libraries for this platform (only windows, linux and mac)

If the libraries are not available does anybody know of a  straightforward way of taking out all the opengl calls and switching to pure java calls so that I could create a seperate (slower) version just for my friend? - for example; I have used gldrawpixels quite a lot to draw pixels to a specific area of a canvas.  Am I correct in saying that using the java repaint() method I would always have to repaint the whole canvas ?

Hope this doesn't sound like a dumb post ... my feeling is that I should say:  "sorry, you can't have a version until you start using Linux" and that is what I expect will happen but I'd just like to clarify this before I break the news to him.

Any advise on this issue would be greatly appreciated.

Regards,

Sally
2  Java Game APIs & Engines / JOGL Development / Re: JOGL Release Information on: 2005-01-21 17:17:08
Could somebody tell me if it is possible to get hold of the source code rather than the precompiled binaries?  

I'm only asking because I am using Linux and my jogl app does not work on certain versions of Linux.  If I had the source code I could attempt to re-compile the libraries for these versions of LInux.






3  Java Game APIs & Engines / JOGL Development / Re: Drawing Text to a canvas on: 2005-01-18 16:13:20
Thank you for your help.  However, with your original code the graphics failed to render after displaying the text.  I stripped out some of the lines to leave it like this:

1  
2  
3  
4  
5  
 
    gl.glColor3f(1.0f, 1.0f, 0f);
    gl.glRasterPos2f(0f, .5f); // <-- position of text
    glut.glutBitmapString(gl, GLUT.BITMAP_HELVETICA_12, "Hello World");
 


and then it seemed to work perfectly.

Just wondered what those other lines were about as it works without it.  What am I missing here Tongue

Txs

Sally  Smiley
4  Java Game APIs & Engines / JOGL Development / Drawing Text to a canvas on: 2005-01-15 11:29:45
Hi, I am writing a jogl application and would like to display worlds and letters on the glcanvas.  Can anybody tell me how I'd go about writing "hello world" (a really original example  Grin )onto a glcanvas at specified co-ordinates ?

Tks

Sally
5  Java Game APIs & Engines / JOGL Development / Re: blinking cursor - advise please? on: 2004-12-09 05:23:59
I'm still living in the dark ages and using 1.4 I'm afraid.   Cheesy  But txs anyway.  I shall have a look for the FPSAnimator.  
6  Java Game APIs & Engines / JOGL Development / Re: blinking cursor - advise please? on: 2004-12-08 17:52:39
Is there a way of slowing an animator down?  It seems crazy if the animator is drawing a cursor as fast at the cpu will allow when all I want is an on/off blink at about once per second.

Would it be more efficient to blink the cursor from a Thread using with a Thread.sleep(500) after each call to display() ??

Regards,

Sal
7  Java Game APIs & Engines / JOGL Development / Re: blinking cursor - advise please? on: 2004-12-07 15:13:16
Thank you very much for that.  Looks like a useful link too.

My program is actually coming along quite well now and it has been a great learning experience as I was new to opengl (and graphics programming in general)before I started.  

Thanks for your help.
Wink
8  Java Game APIs & Engines / JOGL Development / Re: blinking cursor - advise please? on: 2004-12-07 11:21:01
Hi,

I would now like to blink my cursor against the background.  In other words, I want my rectangular image (cursor) to blink (still under the control of an animator) by changing the transparency of the cursor, so that the user can still see the original image which is underneath the cursor.

I am asuming there is a way to change the transparency of a small rectangle but I'm not sure how to go about it as I have never used transparency before.

Any help appreciated.

Txs

Sally  Smiley
9  Java Game APIs & Engines / JOGL Development / Re: Keylistener problem on: 2004-12-07 11:10:34
That's interesting.  Oddly enough the isControlDown has now, miraculously started to work for me.  You may think I'm crazy because I have made absolutely no changes since it started to work and have no idea why it was not working last week but it is working now.

Weird  Huh
10  Java Game APIs & Engines / JOGL Development / Keylistener problem on: 2004-12-01 13:02:19
Hi,

I have added a keylistener to my glcanvas.  The keylistener does pick up basic key presses, but the keyevent.isControlDown() method does not work (isAltDown does work, however).  I'm not sure if this problem is specific to the operating system (I'm using Red Hat Linux).  

I want the user to use ctrl key combinations to draw specific results on the glcanvas.

So, does anybody know if there is a way of trapping for ctrl key combinations (ie ctrl-m means user has pressed m key whilst holding ctrl key down) without using keyevent.isControlDown() method ?

Regards,

Sally
11  Java Game APIs & Engines / JOGL Development / Re: blinking cursor - advise please? on: 2004-11-08 08:54:02
Thanks, I'll try that.

Regards,

Sally
12  Java Game APIs & Engines / JOGL Development / Re: blinking cursor - advise please? on: 2004-11-07 18:27:33
HELP.  My timer is locking up my program. Angry

Hi,  I figure I need to run the cursor color changing from a timer.  Had written a Cursor class which controls the positioning of my cursor on the screen etc and calls glcanvas.display() when necessary.  Have added a new class called CursorBlink, as follows which takes Cursor as an arguament (and is called by Cursor).


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
class CursorBlink extends TimerTask 
{
  Cursor cursor = null;
// constructor
public CursorBlink (Cursor cursor)
{
  this.cursor = cursor;
}

  public void run()
  {
    // changes cursor color and calls glcanvas.display();
    cursor.changecolor();  
  }

}


and from the Cursor class the CursorBlink is initialized as follows:

1  
2  
Timer timer = new Timer();
timer.scheduleAtFixedRate(new CursorBlink(), 1, 500);


The cursor does blink ok, and I can even move it around the screen using the arrow keys but then after about 30 seconds the cursor stops blinking (just staying on one colour) and the whole program freezes.  

Hope this all makes sense.  It'd be a bit big to send the whole code but I hope the snippets will suggest to someone as to what's going wrong.

Any help appreciated.

Tx

Sally
13  Java Game APIs & Engines / JOGL Development / blinking cursor - advise please? on: 2004-11-04 17:53:46
Hi, I hope this isn't a stupid question but  I am writing an application which uses a rectangular cursor to scroll around data on the glcanvas.  At present, I am simply using glRecti  to draw a rectangle at specific co-ordinates.  However, it has been suggested by a guy that he would like to see a "blinking" cursor, thus making it easier to spot on the screen - that seems like a reasonable request as most cursors do seem to blink.  But could this turn out to be a pain to implement for such a small issue?  

My initial impression was be to use a thread, containing a timer but I wondered whether there would be any messy synchronization issues as the user moved the cursor around the screen (whilst the same cursor was being blinked from another thread) and I just wondered if there was some opengl method to switch a color on and off in the form of a small, rectangular cursor.

Any tips or advice appreciated,

Sally
14  Java Game APIs & Engines / JOGL Development / Re: PopupMenu on GlCanvas on: 2004-11-01 18:13:45
Thanks very much for that.  You're absolutely right.  Glad that's working now.   Smiley
15  Java Game APIs & Engines / JOGL Development / Re: PopupMenu on GlCanvas on: 2004-11-01 04:39:15
Hi, many thanks for your reply.  A super small app which demonstrates the problem is below.  Right clicking on the canvas will display 3 cartoon character names.  Don't know whether the bug(feature?) would be the same on another os, because I've only tried it on linux.  Please let me know. The right click menu only seems to come up when I right click near the bottom edge of the canvas. Any help appreciated.

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  
import java.awt.*; 
import java.awt.event.*;
import javax.swing.*;
import net.java.games.jogl.*;
 
public class PopupTest extends JFrame implements MouseListener, GLEventListener
{
GLCanvas canvas = null;
JPopupMenu popupMenu = new JPopupMenu("my menu");
public static final Dimension PREFERRED_FRAME_SIZE = new Dimension (400, 400);
  public PopupTest()
  {
    JPopupMenu.setDefaultLightWeightPopupEnabled(false);
    GLCapabilities capabilities = new GLCapabilities();
    canvas = GLDrawableFactory.getFactory().createGLCanvas(capabilities);
    this.getContentPane().add (canvas, BorderLayout.CENTER);
    this.getContentPane().add(canvas);
    canvas.addGLEventListener(this);
    canvas.addMouseListener(this);
    // add test items to the popup menu
    popupMenu.add(new JMenuItem("Micky Mouse"));
    popupMenu.add(new JMenuItem("Donald Duck"));
    popupMenu.add(new JMenuItem("Scooby Doo"));
    //needed to make the menus display over GLCanvas
 
  }
 
  public Dimension getPreferredSize ()
  {
    return PREFERRED_FRAME_SIZE;
  }
 
  public static void main(String[] args)
  {
    PopupTest put = new PopupTest();
    put.pack();
    put.setVisible(true);
  }
 
  public void mouseExited(MouseEvent me) {}
  public void mouseEntered(MouseEvent me) {}
  public void mouseClicked(MouseEvent me) {}
 
  public void mouseReleased(MouseEvent me)
  {
    if (me.isPopupTrigger() )
    {
 popupMenu.show(me.getComponent(), me.getX(), me.getY());
    }
  }
 
  public void mousePressed(MouseEvent me)
  {
    if (me.isPopupTrigger())
    {
 popupMenu.show(me.getComponent(), me.getX(), me.getY());
    }
  }
 
  public void displayChanged (GLDrawable drawable,boolean mc, boolean dc){}
 
  public void init (GLDrawable drawable)
  {
    GL gl = drawable.getGL();
    gl.glClearColor( 1.0f, 1.0f, 1.0f, 1.0f ); //white
    gl.glClear (GL.GL_COLOR_BUFFER_BIT);
  }
 
  public void reshape (GLDrawable drawable, int x, int y, int width, int height)
  {}
  public void display (GLDrawable drawable)
  {}
}
16  Java Game APIs & Engines / JOGL Development / Re: Is this a JOGL bug ??? on: 2004-10-28 20:12:53
I was already aware of the heavyweight and lightweight issue and the fix being to use  
1  
JPopupMenu.setDefaultLightWeightPopupEnabled(false); 

The line is already in my posted code Wink
I have successfully implemented a JMenu by using this line (I actually got that answer a while back from this forum).  But, I am using a JPopupmenu and I believe the problem I am seeing is different.  If you run my code (assuming you get the same problem on your system) you will see that the popupmenu does actually draw over the glcanvas (proving that the setDefaultLightWeightPopupEnabled fix does work) but, as I said, only near the bottom and right edges of the glcanvas.  Haven't got a clue why this happens but it sure a'int right.  If anybody has a fix and/or explanation then I would grateful.

The example program from my last post simply brings up a jframe with a blank glcanvas.  Right clicking on the canvas should bring up a menu containing 3 cartoon characters at the point where you click.  But, for me, it only works near the bottom and right edges of the canvas. Cry

Regards,

Sally

17  Java Game APIs & Engines / JOGL Development / Is this a JOGL bug ??? on: 2004-10-28 11:16:23
Hi, after experimenting with putting a right click menu on top of an opengl canvas (glcanvas) I realised that the menu actuall does come up, but only if you right click near the bottom or near the left edge of the canvas.  It works normally if I use a GLJPanel.  The code below is a simple, cut down example which illustrates the problem. Has anybody got any suggestions as to how I might get around this feature as I need to get a menu to appear at the point  where the user right clicks.  I am using jogl under Linux, by the way (have not tested whether it works properly or not under windows).

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  
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import net.java.games.jogl.*;

public class PopupTest extends JFrame implements MouseListener, GLEventListener
{
GLCanvas canvas = null;
JPopupMenu popupMenu = new JPopupMenu("my menu");
public static final Dimension PREFERRED_FRAME_SIZE = new Dimension (400, 400);
  public PopupTest()
  {
    JPopupMenu.setDefaultLightWeightPopupEnabled(false);
    GLCapabilities capabilities = new GLCapabilities();
    canvas = GLDrawableFactory.getFactory().createGLCanvas(capabilities);
    this.getContentPane().add (canvas, BorderLayout.CENTER);
    this.getContentPane().add(canvas);
    canvas.addGLEventListener(this);
    canvas.addMouseListener(this);
    // add test items to the popup menu
    popupMenu.add(new JMenuItem("Micky Mouse"));
    popupMenu.add(new JMenuItem("Donald Duck"));
    popupMenu.add(new JMenuItem("Scooby Doo"));
    //needed to make the menus display over the GLCanva

  }

  public Dimension getPreferredSize ()
  {
    return PREFERRED_FRAME_SIZE;
  }

  public static void main(String[] args)
  {
    PopupTest put = new PopupTest();
    put.pack();
    put.setVisible(true);
  }

  public void mouseExited(MouseEvent me) {}
  public void mouseEntered(MouseEvent me) {}
  public void mouseClicked(MouseEvent me) {}

  public void mouseReleased(MouseEvent me)
  {
    if (me.isPopupTrigger() )
    {
      popupMenu.show(me.getComponent(), me.getX(), me.getY());
    }
  }

  public void mousePressed(MouseEvent me)
  {
    if (me.isPopupTrigger())
    {
      popupMenu.show(me.getComponent(), me.getX(), me.getY());
    }
  }

  public void displayChanged (GLDrawable drawable,boolean mc, boolean dc){}

  public void init (GLDrawable drawable)
  {
    GL gl = drawable.getGL();
    gl.glClearColor( 1.0f, 1.0f, 1.0f, 1.0f ); //white
    gl.glClear (GL.GL_COLOR_BUFFER_BIT);
  }

  public void reshape (GLDrawable drawable, int x, int y, int width, int height)
  {}
  public void display (GLDrawable drawable)
  {}
}
18  Java Game APIs & Engines / JOGL Development / PopupMenu on GlCanvas on: 2004-10-27 15:18:54
Hi, I am trying to get a popup menu to appear over a glcanvas when the user hits the right mouse button.

I have tried the JPopupmenu but this does not appear over the glcanvas even after setting :
1  
JPopupMenu.setDefaultLightWeightPopupEnabled(false);


Have also tried the awt PopupMenu but every time I click on the glcanvas I get a null pointer exception telling me that the parent (the glcanvas?) is null (and yet it can't be null else I wouldn't be able to use it for the rest of the application would I). I have enclosed the code for where the null pointer exception occurs below (it is line 6 which does it Shocked )

1  
2  
3  
4  
5  
6  
7  
8  
// gives null pointer exception
public void mousePressed(MouseEvent e)
{
  if (  e.isPopupTrigger() )      
  {
    gui.popupMenu.show(e.getComponent(), e.getX(), e.getY());  // line 6
  }
}


Any tips/code (preferably) or advice on getting a popupmenu to appear at the point where a user right clicks on a glcanvas would be greatly appreciated.

Many thanks

Sally
19  Java Game APIs & Engines / JOGL Development / Re: keyevent question on: 2004-10-08 14:56:23
Just for interest, I stumbled upon a good way of fixing this problem myself with only 3 lines of code in the keyPressed method (it's got to be better than using threads and timers  Cheesy. ... and it DOES work.  I can't believe I could not find this easy fix in any forums or from any search engines.

1  
2  
3  
4  
5  
6  
7  
8  
9  
  public void keyPressed(KeyEvent e)
  {
    // gets the next key press in the event queue - if it is "null" then the current KeyEvent is the last in the queue
      KeyEvent nextPress = (KeyEvent) Toolkit.getDefaultToolkit().getSystemEventQueue().peekEvent(KeyEvent.KEY_PRESSED);
    if (nextPress != null)
      return;
      // else process key event
   }
       
20  Java Game APIs & Engines / JOGL Development / Re: Problems running on Linux on: 2004-08-23 16:27:21
Oh sorry, I forgot to mention ... I am running this using Red Hat Linux 8.0.

Wink

Sally
21  Java Game APIs & Engines / JOGL Development / Problems running on Linux on: 2004-08-23 16:25:54
Hi,

I am running a simple JOGL application using JOGL.  My card is a nvidia gforce 4.  When I run the application I get the following exceptions (below) before the program runs. Does anybody know what all this means? Andi is it serious?  While the application is running, I type "top" to see what processes are grabbing cpu and java gives about 87%.  My other java applications do not get anywhere near this figure when I run them and type top.  Is it normal for a jogl application to grab a lot of cpu usage?

Tks,

Sally

java.awt.AWTException: cannot open XIM
       at sun.awt.motif.X11InputMethod.<init>(X11InputMethod.java:147)
       at sun.awt.motif.X11InputMethodDescriptor.createInputMethod(X11InputMethodDescriptor.java:76)
       at sun.awt.im.InputContext.getInputMethodInstance(InputContext.java:734)
       at sun.awt.im.InputContext.getInputMethod(InputContext.java:684)
       at sun.awt.im.InputContext.dispatchEvent(InputContext.java:210)
       at sun.awt.im.InputMethodContext.dispatchEvent(InputMethodContext.java:180)
       at java.awt.Component.dispatchEventImpl(Component.java:3476)
       at java.awt.Container.dispatchEventImpl(Container.java:1437)
       at java.awt.Component.dispatchEvent(Component.java:3367)
       at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1700)
       at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:700)
       at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:403)
       at java.awt.Component.dispatchEventImpl(Component.java:3396)
       at java.awt.Container.dispatchEventImpl(Container.java:1437)
       at java.awt.Component.dispatchEvent(Component.java:3367)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
       at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
       at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
       at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)

22  Java Game APIs & Engines / JOGL Development / Re: 64x64 limit problem on: 2004-07-24 07:13:03
Quote


There are still things you can do to improve performance using immediate mode.
1) Do you need textures? If the rectangles are single colored, then you can use vertex colors instead.


I'd rather use images or textures but hey ... when you're desperate I'll make do with rectangular colors if I have to Cheesy   I have actually tried solving the problem with vertex rectangles before and they gave about the same speed as gldrawpixels (too slow).

Quote
Or generate a texture that is uploaded once per frame and drawn with one quad that covers the screen.

If I understand you correctly - there would need to be several million combinations of screen texture depending on where the 2 tiles are within the grid so this couldn't be an option.

Quote
2) Use Triangle strips or quad strips.

Don't know much about these ... do you think these would give me more speed than drawing vertex rectangles???

Quote

3) Generate one big texture that contains one of the sprites tiled across it. The texture is drawn first using one quad covering the screen. Then you draw sprite nr 2 where it is needed. Basicly swapping gl calls for overdraw.
 

Not sure  how I'd go about implementing it but I'd like to give it a try before I give up completely.  Does anybody know where I could find an example of how to implement a system like this?

Many thanks for your reply,

Sally
23  Java Game APIs & Engines / JOGL Development / Re: 64x64 limit problem on: 2004-07-23 14:24:30
Interesting. Smiley  I wonder why the error did not comp up when I ran the JOGLBasics demo though (from the "Jumping into JOGL" page) on the Geforce 4 card.  Why would it only be  Vertex Arrays that cause the error and only on this machine?  To say: "I'm confused" would be the biggest understatement of the decade  Grin

Either way ... it seems I cannot use either my Matrox G450 card or my friend's Nvidia Geforce 4 card to have any success with my application.  

I think I'll try using Motif Tongue

Thank you to everybody who has taken the trouble to reply though. Smiley

Regards,

Sally

24  Java Game APIs & Engines / JOGL Development / Re: 64x64 limit problem on: 2004-07-23 12:48:38
Thanks for that info.  It's best to know these things in advance.

Just to compond my misery Sad I just tired to run the tiles demo on a friend's machine (Red Hat Linux 8 os) which uses an Nvidia geforce 4 card.  The frame came up but I received the following (none of it makes much sense to me).   So presumably the Nvidia geforce 4 is not very compliant either Huh

Any clues Huh

Regards,

Sal

java.awt.AWTException: cannot open XIM
       at sun.awt.motif.X11InputMethod.<init>(X11InputMethod.java:147)
       at sun.awt.motif.X11InputMethodDescriptor.createInputMethod(X11InputMethodDescriptor.java:76)
       at sun.awt.im.InputContext.getInputMethodInstance(InputContext.java:734)
       at sun.awt.im.InputContext.getInputMethod(InputContext.java:684)
       at sun.awt.im.InputContext.dispatchEvent(InputContext.java:210)
       at sun.awt.im.InputMethodContext.dispatchEvent(InputMethodContext.java:180)
       at java.awt.Component.dispatchEventImpl(Component.java:3476)
       at java.awt.Container.dispatchEventImpl(Container.java:1437)
       at java.awt.Window.dispatchEventImpl(Window.java:1566)
       at java.awt.Component.dispatchEvent(Component.java:3367)
       at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
       at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy
25  Java Game APIs & Engines / JOGL Development / Re: 64x64 limit problem on: 2004-07-23 08:03:09
Thanks for that info.

You were right ... the VBO extension isin't available.

I'm a bit confused ... I am using Red Hat Linux 7.2 and a Matrox G450 which the documentation sais does have OpenGL support, however my installastion is about 3 years old.  Do you think it would just be a question of downloading the latest Matrox G450 drivers for Linux or does it mean that my physical card would never support VBOs under Linux?

Thanks

Sally

26  Java Game APIs & Engines / JOGL Development / Re: 64x64 limit problem on: 2004-07-22 07:04:18
Quote
I've updated the demo to include a simple example (run with tiledemo2.cmd) of using vertex arrays to achieve better fillrate. There's a new class called TileGrid which is a grid based representation of tiles. The grid can be modified dynamically - i.e. the tile images can be changed at each grid location separately.

PS. On my Amilo P4-HT 2.6GHz, ATI Radeon 9600 Mobility the following is printed out:

"10000 20x20 tile grids rendered in 1313ms, which makes 7000 grids/s and 2800000 tiles/s"


Thanks for the new demo.  Although my results were far from impressive on my 1Ghz Intel Pentium III, Matrox G450 - the program stood still for about 10 minutes before giving:

10000 20x20 tile grids rendered in 325425ms, which makes 0 grids/s and 0 tiles/s
10000 20x20 tile grids rendered in 325325, which makes 0 grids/s and 0 tiles/s

Do these results mean I'm not going to get my 20fps? :-/

Regards,

Sally
27  Java Game APIs & Engines / JOGL Development / Re: 64x64 limit problem on: 2004-07-21 11:14:02
Quote


Ok, roughly, what kind of  frame rates are you after? Even the most unoptimal way of drawing the tiles(showcased in the demo) would result in ~4 frames/s for your setup (11000 / 2800). I think this figure could be quite easily raised to 10 or 20 fps. Are the tiles changed arbitrarily or are there somekind of patterns or rules in the process? Also, what kind of scheme are using for the keyboard input?

Cheers


I think I would be happy with 20fps, but 30 would be better. To give you a bit more detail about what I'm doing: the program is a bit analyser.  The data (1s and 0s represented by the 2 tiles) are read in and stored in an array.  If the user sets a rasterwidth of 70 then the 1s and 0s in the array would be displayed wrapping around over 70 columns.  So when the user presses the . key (also the > key on a qwerty keyboard) the rasterwidth would increase by 1 making all the bits wrap around 71 columns.  If the user presses the , (or < key) the rasterwidth would decrease by 1 giving 70 again.  Each time the appropriate key is pressed all the tiles are re-read in from the array and appear to be shuffled around on the canvas.  If the user kept their hand on , key, for instance the rasterwidth should slikly move down to 1 column (going through each rasterwidth from 70 - 1 on the way of course).  Interesting patterns can be spotted by the human eye over various widths which give frame lenghts of some types of data.  

For my keyboard input I have just used an awt.Event KeyListener.

Regards,

Sally
28  Java Game APIs & Engines / JOGL Development / Re: 64x64 limit problem on: 2004-07-20 15:26:34
Quote
Why not use batch commands ? Put quads into big array and draw it at once. Currently you are testing performance of JNI binding/opengl driver, not that of the GPU itself.



Yes, I understand what you mean.  I shall give that a whirl.

Thanks

Sally
29  Java Game APIs & Engines / JOGL Development / Re: 64x64 limit problem on: 2004-07-20 15:01:13
It's more like a grid display, I guess.  All I'm trying to do at the moment is draw 8x16 rectangles just like your demo.  I use 2 seperate tiles (from 2 png files of the same size), (tileone and tiletwo). Supposing I had 40 rows of these images and 70 columns, I would have 2800 images on my glcanvas (some of them would be tileone and some tiletwo).  When the user presses a . key, the whole screen is redrawn and where some grid areas were tileone, they now become tiletwo and visa versa.  When the user keeps his/her finger on the . key, the canvas should change constantly and at a reasonable rate (it's an analysys tool and the user's eye is looking for raster patterns) and whilst the program does work correctly, the changing of the display is slow and jerky with the techniques I have tried so far.  If I could only get this to work at a decent rate I would be a very, very happy lady. Roll Eyes

I am really very new to graphics programming and opengl etc although I have done a fair bit of Java programming (mainly for fun and learning) when I was at school.

Thanks for your help.

Sally



30  Java Game APIs & Engines / JOGL Development / Re: 64x64 limit problem on: 2004-07-20 13:09:01
Have tried using your 3 classes, Tile, Texture and TextureIO.  My 8x16 png images render at roughly 17000 tiles per second (both modes) and it is simple to position the images at their correct size and at any location on the glcanvas.  Thank you for that.   Kiss

But using my original gldrawpixels method I am getting about 34500 images per second (over twice as fast as the textured quad methods) - this is still too slow - that's why I attempted writing textured quads in the first place(hoping to speed up my application). Cry

My original testing of textured quads (a day or so before I got your code), I appeared to be getting about 175000 tiles per second (blindingly fast for what I want) but did not know how to control the size or location. Tongue

The code which gave me a wonderful 175000 tiles per second is below.  The figures are all arbitary and were just a way of getting the quads to come out within a loop.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
gl.glBegin(GL.GL_QUADS);
for (int i = 0; i< 7000; i++)  // send it round in large loop
{
   gl.glTextCood2f(0.0f, 0.0f); gl.glVertex2f(x+(5*i),
      x + (5* i));
   gl.glTextCood2f(1.0f, 0.0f); gl.glVertex2f(x+(5*i),
      x + (5* i));
   gl.glTextCood2f(1.0f, 1.0f); gl.glVertex2f(x+(5*i),
      x + (5* i));
   gl.glTextCood2f(0.0f, 1.0f); gl.glVertex2f(x+(5*i),
      x + (5* i));
}

}


Any ideas ?

Regards,

Sally
Pages: [1] 2 3
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (30 views)
2014-10-27 03:28:38

TehJavaDev (26 views)
2014-10-27 03:27:51

DarkCart (39 views)
2014-10-26 19:37:11

Luminem (21 views)
2014-10-26 10:17:50

Luminem (25 views)
2014-10-26 10:14:04

theagentd (31 views)
2014-10-25 15:46:29

Longarmx (61 views)
2014-10-17 03:59:02

Norakomi (57 views)
2014-10-16 15:22:06

Norakomi (46 views)
2014-10-16 15:20:20

lcass (43 views)
2014-10-15 16:18:58
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!