Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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 / JOGL Development / Re: No NURBS support in JoGL??? on: 2004-05-18 00:18:19
Ah I see, makes sense  Sad

Thanks Ken.
2  Java Game APIs & Engines / JOGL Development / Re: No NURBS support in JoGL??? on: 2004-05-17 20:57:06
I agree: I was expecting a similar API as the GLU tesselator port.

As time permits, I'll have a look at JoGL code to create such framework. But porting GLU code to Java seems a daunting task. Maybe the best would be to wrap the native code?
3  Java Game APIs & Engines / JOGL Development / Re: No NURBS support in JoGL??? on: 2004-05-14 16:57:00
Ah that's bad...

Is it planned to support NURBS (and maybe other mssing GLU features) in the next release of JoGL?

Thanks.
4  Java Game APIs & Engines / JOGL Development / No NURBS support in JoGL??? on: 2004-05-14 02:47:33
Dear All,

while I can find a GLUnurbs object, it seems there is no other NURBS method available in JoGL.

Am I correct or could someone tell me how to use NURBS with JoGL?

Thanks,

mike
5  Java Game APIs & Engines / Java Sound & OpenAL / Streaming problem on WinXP on: 2004-01-19 16:58:00
Dear All,

I am using the latest Joal code from CVS and the latest OpenAL SDK (not the one on their CVS server).

I am streaming buffers to Joal using a variant of Tutorial 8 on DevNet (from which JoAL tutorials are based).

I noticed that JoAL/OpenAL got preempted quite easily, as the author noted. However, when Windows Media Player is started with some sound and then paused, there is no pre-emption anymore. I believe this indicates a bug in the initialization of JoAL/OpenAL.

To initialize JoAL/OpenAL, I simply use ALut.alutInit(); which initializes DirectSound. I tried with DirectSound3D by expanding alutInit() but anyway, the problem remains.

Does anyone knows a better to initialize OpenAL? or a fix for this issue?

Thanks,

Mike
6  Java Game APIs & Engines / Java Sound & OpenAL / Re: Joal tutorial crashes on: 2004-01-13 17:57:26
OK I found the problem.
This was not related to JoAL but to an old joal.jar in Eclipse classpath.

Sorry for bothering you.

Mike
7  Java Game APIs & Engines / Java Sound & OpenAL / Re: Joal tutorial crashes on: 2004-01-13 16:32:12
That might help:
when I trace the issue on a DOS box, the DLL creates the device in openNativeDevice(), the java object it returns has address: a0c384.
When DLL's createNativeContext() is called, in the DOS box, the device address is different. On Eclipse IDE, the address is the same.

So strangely enough: when createNativeContext() is given the same Java device object address, it crashes. When the address is different, it works.

Mike
8  Java Game APIs & Engines / Java Sound & OpenAL / Re: Joal tutorial crashes on: 2004-01-13 15:48:58
Dear All,

I downloaded the tutorials and JoAL yesterday (and the latest OpenAL SDK), recompiled everything, pass the tests (in the SDK and JoAL) but the tutorial are crashing and I have the same error output as listed in previous emails.

But what is odd is that if I run the samples from a DOS box, then they work. If I run them from an IDE, then they crash. I am on WinXP, I don't use EAX, use Eclipse IDE.

I tried to trace the issue. The problem seems to be in Java_net_java_games_joal_ALCImpl_createContextNative when it calls alcCreateContext(). That's where the JVM crashes.

In lesson 1, on a DOS box, it crashes when I quit in ALut.aluExit() because in the first call, alc is null! Weird indeed as all other lessons work fine but only from a DOS box.

Thanks for your help,

Mike
9  Java Game APIs & Engines / JOGL Development / Picking problem? on: 2003-08-15 19:34:59
Dear All,

While debugging some picking code, I decided to try the picksquare sample in OpenGL red book.

The code doesn't work and I'm not sure why, can anyone help? Huh

Thanks,

Here is the sample ported to JOGL:

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  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
155  
156  
157  
158  
159  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
import java.awt.Frame;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import net.java.games.jogl.Animator;
import net.java.games.jogl.GL;
import net.java.games.jogl.GLCanvas;
import net.java.games.jogl.GLCapabilities;
import net.java.games.jogl.GLDrawable;
import net.java.games.jogl.GLDrawableFactory;
import net.java.games.jogl.GLEventListener;
import net.java.games.jogl.GLU;

public class PickSquare {
     
      public static void main(String[] args) {
        Frame frame = new Frame("PickSquare Demo");
        GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());

        canvas.addGLEventListener(new PickSquareSample());
        frame.add(canvas);
        frame.setSize(300, 300);
        final Animator animator = new Animator(canvas);
        frame.addWindowListener(new WindowAdapter() {
              public void windowClosing(WindowEvent e) {
                  animator.stop();
                  System.exit(0);
              }
            });
        frame.show();
        animator.start();
      }
     
      static class PickSquareSample implements GLEventListener, MouseListener {
     
            GL myGL;
            GLU myGLU;
     
            private int board[][] = new int[3][3]; /* amount of color for each square */
     
            private void init () {
                  int i, j;
                  for (i = 0; i < 3; i++) {
                        for (j = 0; j < 3; j++) {
                        board [i][j] = 0;
                        }
                  }
                  myGL.glClearColor (0.0f, 0.0f, 0.0f, 0.0f);
            }
     
            private void drawSquares (int mode) {
                  int i, j;
                  for (i = 0; i < 3; i++) {
                        if (mode == GL.GL_SELECT) {
                              myGL.glLoadName (i);
                        }
                        for (j = 0; j < 3; j ++) {
                              if (mode == GL.GL_SELECT) {
                                    myGL.glPushName (j);
                              }
                              myGL.glColor3f ((float)(i/3.0),(float)(j/3.0),(float)(board[i][j]/3.0));
                              myGL.glRecti (i, j, i+1, j+1);
                              if (mode == GL.GL_SELECT) {
                                    myGL.glPopName ();
                              }
                        }
                  }
            }
     
            private void processHits (int hits, int buffer []) {
                  int i, j;
                  int ii = 0, jj = 0, names, ptr;
           
                  System.out.println ("hits = " + hits);
                  ptr = 0;
                  for (i = 0; i < hits; i++) {        /*  for each hit  */
                        names = buffer [ptr];
                        System.out.println (" number of names for hit = " + names); ptr++;
                        System.out.print ("  z1 is " + buffer [ptr] + ";"); ptr++;
                        System.out.println (" z2 is " + buffer [ptr]); ptr++;
                        System.out.print ("   the name is ");
                        for (j = 0; j < names; j++) {   /*  for each name */
                              System.out.print (buffer [ptr] + " ");
                              if (j == 0) { /*  set row and column */
                                    ii = buffer [ptr];
                              } else {
                                    jj = buffer [ptr];
                              }
                              ptr++;
                        }
                        System.out.println ();
                        board [ii][jj] = (board [ii][jj] + 1) % 3;
                  }
            }
     
            private static final int BUFSIZE = 512;
     
            private void pickSquares (MouseEvent e) {
                  int selectBuf [] = new int [BUFSIZE];
                  int hits;
                  int viewport [] = new int [4];
                  int x, y;
           
                  x = e.getX ();
                  y = e.getY ();
                 
                  myGL.glGetIntegerv (GL.GL_VIEWPORT, viewport);
                 
                  myGL.glSelectBuffer (BUFSIZE, selectBuf);
                  myGL.glRenderMode (GL.GL_SELECT);
           
                  myGL.glInitNames ();
                  myGL.glPushName (-1);
           
                  myGL.glMatrixMode (GL.GL_PROJECTION);
                  myGL.glPushMatrix ();
                  myGL.glLoadIdentity ();
                 
                  /*  create 5x5 pixel picking region near cursor location        */
                  myGLU.gluPickMatrix((double)x,(double)(viewport[3]-y),5.0,5.0,viewport);
                  myGLU.gluOrtho2D (0.0, 3.0, 0.0, 3.0);
                  drawSquares (GL.GL_SELECT);
                  myGL.glPopMatrix ();
                  myGL.glFlush ();
           
                  hits = myGL.glRenderMode (GL.GL_RENDER);
                  processHits (hits, selectBuf);
            }
     
            public void mousePressed(MouseEvent e) {
                  // process which button by myself
                  if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == MouseEvent.BUTTON1_MASK) { // left
                        pickSquares (e);
                        //display(null);
                        e.consume ();
                  }
            }
     
            public void display (GLDrawable d) {
                  myGL.glClear (GL.GL_COLOR_BUFFER_BIT);
                  drawSquares (GL.GL_RENDER);
                  myGL.glFlush ();
            }
     
            public void reshape(GLDrawable drawable, int x, int y, int w, int h) {
                  myGL.glViewport (0, 0, w, h);
                  myGL.glMatrixMode (GL.GL_PROJECTION);
                  myGL.glLoadIdentity ();
                  myGLU.gluOrtho2D (0.0, 3.0, 0.0, 3.0);
                  myGL.glMatrixMode (GL.GL_MODELVIEW);
                  myGL.glLoadIdentity ();
            }
     
            public void init (GLDrawable drawable) {
                  myGL=drawable.getGL();
                  myGLU=drawable.getGLU();
                  drawable.addMouseListener(this);
                 
                  init ();
            }

            // unimplemented interface methods
            public void displayChanged(GLDrawable arg0, boolean arg1, boolean arg2) {}
            public void mouseClicked(MouseEvent e) {}
            public void mouseEntered(MouseEvent arg0) {}
            public void mouseExited(MouseEvent arg0) {}
            public void mouseReleased(MouseEvent arg0) {}
      }
}
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.

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

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

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

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (57 views)
2014-10-14 00:39:48

TehJavaDev (58 views)
2014-10-14 00:35:47

TehJavaDev (48 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
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!