Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Sharing Context between GLJPanels  (Read 5548 times)
0 Members and 1 Guest are viewing this topic.
Offline leopold.frey

Senior Newbie





« Posted 2006-03-09 17:54:14 »

Hi,

I read almost all the posts about gljpanel, init, display lists, context but didn't find an answer to my question.

I'm just trying to draw different sound waveforms in a GLJPanel (the waveform is chosen in a JTree and then drawn in the GLJPanel, in the same frame).
This works fine but I want to optimise with display lists, and later I will need different GLJPanels to run at the same time, so I need context sharing too.

I read it is normal that the init method is called quite often.
So I'm trying to share the context of my GLJPanel, but I don't understand how to do it.

Following the TestContextSharing in the demos, I can see it works for GLCanvas, but I didn't get this example to work with GLJPanels.

GLContext.getcurrent() is null.
myGLJPanel.getContext() is null too.
myGLJPanel.createContext(GLContext.getCurrent()) ?

Can someone explain me how to do it please ?
If someone manage to get TestContextSharing working with GLJPanel, it would be great, something to start from !

Thanks a lot

Léo

(Mac Os X, jogl 07/03/06)
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #1 - Posted 2006-03-09 23:04:32 »

Yes, there are some issues in this area because of the lazy creation of the pbuffer or other internal context associated with the GLJPanel. One workaround would be to make a small 1x1 pbuffer and make both GLJPanels share with that. Another would be to defer the instantiation of your other GLJPanel until the first one has been shown, though I understand this could be a real pain. Please feel free to file a bug with the Issue Tracker on the JOGL home page about this.
Offline leopold.frey

Senior Newbie





« Reply #2 - Posted 2006-03-10 01:05:49 »

Hi,

thanks for your response

the fact is that I don't know how to share context ! I doesn't seem to work.
For the moment I just want my GLJpanel not to clear its display lists each time the init method is called.

I tried creating a dummy GLCanvas and creating my GLJpanel this way :

      dumCanvas = new GLCanvas();
      glp = new GLJPanel(new GLCapabilities(), new DefaultGLCapabilitiesChooser(), dumCanvas.getContext());

Display lists always vanish after a call to init().

Following your response I tried to create a GLPBuffer and share its context with my GLJpanel (for instance, I need only one) this way :

      GLPbuffer glpb = GLDrawableFactory.getFactory().createGLPbuffer(new GLCapabilities(), new DefaultGLCapabilitiesChooser(), 1, 1, GLContext.getCurrent());
      glp = new GLJPanel(new GLCapabilities(), new DefaultGLCapabilitiesChooser(), glpb.getContext());

Same result.

Can you please be more precise on how to share context ?

Thanks

Léo
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #3 - Posted 2006-03-10 01:25:27 »

Following your response I tried to create a GLPBuffer and share its context with my GLJpanel (for instance, I need only one) this way :

      GLPbuffer glpb = GLDrawableFactory.getFactory().createGLPbuffer(new GLCapabilities(), new DefaultGLCapabilitiesChooser(), 1, 1, GLContext.getCurrent());
      glp = new GLJPanel(new GLCapabilities(), new DefaultGLCapabilitiesChooser(), glpb.getContext());

You don't need the call to GLContext.getCurrent() when creating the GLPbuffer but that should work. Your init() method will still get called multiple times, but the fact that the pbuffer shares display lists with your GLJPanel should mean that you can just refer to the display list names from the last call to init(). Could you check this again? If things are still not working, could you post a test case?
Offline leopold.frey

Senior Newbie





« Reply #4 - Posted 2006-03-10 10:37:22 »

Quote
You don't need the call to GLContext.getCurrent() when creating the GLPbuffer but that should work.

So what do I have to do to generate the GLPbuffer ?

this doesn't work :

      GLPbuffer glpb = GLDrawableFactory.getFactory().createGLPbuffer(new GLCapabilities(), new DefaultGLCapabilitiesChooser(), 1, 1, GLContext.getCurrent());
      glp = new GLJPanel(new GLCapabilities(), new DefaultGLCapabilitiesChooser(), glpb.getContext());

and this neither :

      glpb = GLDrawableFactory.getFactory().createGLPbuffer(new GLCapabilities(), new DefaultGLCapabilitiesChooser(), 1, 1, null);
      glp = new GLJPanel(null,null,glpb.getContext());

So ?

Quote
If things are still not working, could you post a test case?

I'll try to make something simple ASAP.

Thanks

Léo
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #5 - Posted 2006-03-10 16:59:39 »

Either of those two lines should be correct.

Please write up a test case.
Offline leopold.frey

Senior Newbie





« Reply #6 - Posted 2006-03-10 23:39:03 »

HI,

first thanks for your help

Sorry it's a bit complicated and I'm french so my english is a bit ~.

I'm writing a little test but as you can see in the following thread http://www.java-gaming.org/forums/index.php?topic=12784.0
I'm running mac os 10.4.5 and I've got another problem (but maybe it is the same problem !) :
I can't resize a window containing a GLJPanel.

Until now I haven't noticed this in my soft (though i noticed it in the demos)
because I implemented a different resize method.
With my method there isn't problems while resizing the window (because the window isn't resized until the user released the mouse button)
but maybe this method produces the bug I'm trying to describe you (context sharing), I don't know maybe it erases something

With the following code you can test both bugs.
It creates 5 random display lists.
The user can choose which one he wants to see.
There are two resize methods (which can be changed via the MODE variable)
    * The default one is a home-made window resize method (the window isn't resized until the user released the mouse button)
    * The other one is the default system window resize method (it doesn't work here, I've got an endless spinning wheel)
Each time the user choose a number in the combo, a different list is shown and the window in randomly resized.
The black button on the right is the home-made resize button.

From time to time (both with the automatic resize method and the home-made resize button) the init method is called and my display lists vanish.

With the second resize method (MODE = RESIZE_ENABLED) i can't resize the window manually
but with the random resize I can see that when the init method is called display lists vanish.

Hope it's clear
Hope you can reproduce this
Hope there's a solution

Léo

______________________________
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  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
192  
193  
194  
195  
196  
197  
198  
199  
200  
201  
202  
203  
204  
205  
206  
207  
208  
209  
210  
211  
212  
213  
214  
215  
216  
217  
218  
219  
220  
221  
222  
223  
224  
225  
226  
227  
228  
229  
230  
231  
232  
233  
234  
235  
236  
237  
238  
239  
240  
241  
242  
243  
244  
245  
246  
247  
248  
249  
250  
251  
252  
253  
254  
255  
256  
257  
258  
259  
260  
261  
262  
263  
264  
265  
266  
267  
268  
269  
270  
271  
272  
273  
274  
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Random;
import javax.media.opengl.DefaultGLCapabilitiesChooser;
import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLJPanel;
import javax.media.opengl.GLPbuffer;
import javax.media.opengl.glu.GLU;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class TestSharingGLJPanel extends JPanel implements GLEventListener, ItemListener
{
   // resize mode variables
  private final static int RESIZE_DISABLED = 0;
   private final static int RESIZE_ENABLED = 1;
   private int MODE = RESIZE_DISABLED; // CHANGE THE MODE TO SEE THE DIFFERENT BEHAVIOURS
  private JButton resizeBox;
   public int sizW = 400;
   public int sizH = 400;
   private int dTX, dTY;
   private Cursor curs;

   private int width;
   private int height;
   private int margin = 2;
   private float max = 100;

   // display lists variables
  private int listID = 0;
   private int listToDisplay = 1;

   private JFrame frame;

   // opengl variables
  private GLU glu = new GLU();
   private GL gl;
   private GLJPanel glp;
   private GLPbuffer glpb;

   public static void main(String[] args)
   {
      new TestSharingGLJPanel();
   }

   public TestSharingGLJPanel()
   {
      // create a dummy GLPBuffer for context sharing
     glpb = GLDrawableFactory.getFactory().createGLPbuffer(new GLCapabilities(), new DefaultGLCapabilitiesChooser(), 1, 1, null);
      // create the GLJPanel with the GLContext of the GLPBuffer
     glp = new GLJPanel(null, null, glpb.getContext());
      glp.addGLEventListener(this);

      // GUI
     setLayout(new GridLayout(1, 1));
      add(glp);

      // Combox box for choosing the list to display
     JComboBox combo = new JComboBox(new Integer[] { new Integer(1), new Integer(2), new Integer(3), new Integer(4), new Integer(5) });
      combo.addItemListener(this);
     
      // the "force build lists" button
     JButton forceBuild = new JButton("Build Lists");
      forceBuild.addActionListener(new ActionListener()
      {
         public void actionPerformed(ActionEvent e)
         {
            // this will force lists to be build once more in the display method
           listID = 0;
            glp.display();
         }
      });

      // the frame containing all
     frame = new JFrame("This is just a test !");
     
      // adds the GLJPanel
     frame.getContentPane().setLayout(new BorderLayout());
      frame.getContentPane().add(this, BorderLayout.CENTER);
     
      // panel containing the combo box, the "build lists" button and the resize box)
     JPanel southPanel = new JPanel();
      southPanel.setLayout(new BorderLayout());
      southPanel.add(combo, BorderLayout.CENTER);
      southPanel.add(forceBuild,BorderLayout.WEST);
      // resize mode
     switch(MODE)
      {
      case RESIZE_ENABLED :
         frame.setResizable(true);
         break;
      case RESIZE_DISABLED :
         frame.setResizable(false);
         addResizeBox(combo, southPanel);
         break;
      }
     
      frame.getContentPane().add(southPanel, BorderLayout.SOUTH);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      frame.setSize(sizW, sizH);
      frame.setLocationRelativeTo(null);
      frame.setVisible(true);
     
   }

   // A non-system resize box
  private void addResizeBox(JComboBox combo, JPanel southPanel)
   {
      resizeBox = new JButton();
      resizeBox.setBorder(BorderFactory.createRaisedBevelBorder());
      resizeBox.setBackground(Color.DARK_GRAY);//.createLineBorder(Color.BLACK));
     resizeBox.setSize(new Dimension(14, 14));
      resizeBox.setPreferredSize(new Dimension(14, 14));
      resizeBox.setMaximumSize(new Dimension(14, 14));
      resizeBox.setMaximumSize(new Dimension(14, 14));
      resizeBox.setMargin(new Insets(0, 0, 0, 0));
      resizeBox.setVisible(true);
      resizeBox.setEnabled(true);
      resizeBox.setVerticalAlignment(JButton.BOTTOM);
      resizeBox.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
     
      // the window will not be resized until the mouse button has been released
     resizeBox.addMouseListener(new MouseAdapter()
      {
         public void mousePressed(MouseEvent e)
         {
            dTX = e.getX();
            dTY = e.getY();
            curs = getCursor();
            resizeBox.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
         }

         public void mouseReleased(MouseEvent e)
         {
            sizW += (e.getX() - dTX);
            sizH += (e.getY() - dTY);
            resizeBox.setCursor(curs);
            frame.setSize(sizW,sizH);
         }
      });
      southPanel.add(resizeBox, BorderLayout.EAST);
   }

   // when the combo chosen item change
  public void itemStateChanged(ItemEvent e)
   {
      if (e.getStateChange() == ItemEvent.SELECTED)
         try
         {
            listToDisplay = ((Integer) e.getItem()).intValue();

            // automatically resize the window
           Random rand = new Random();
            int k = (int)(rand.nextFloat() * 200) - 100;
            frame.setSize(frame.getWidth()+k,frame.getHeight()+k);
           
            glp.display();
         }
         catch (ClassCastException ex)
         {
         }
   }

   public void init(GLAutoDrawable drawable)
   {
      System.out.println("init");
      gl = drawable.getGL();
      gl.glShadeModel(GL.GL_SMOOTH);
      gl.glClearColor(1,1,1,1);
      gl.glPointSize(5);
      gl.glViewport(0, 0, (int) width, (int) height);
      gl.glEnable(GL.GL_POINT_SMOOTH);
      gl.glEnable(GL.GL_BLEND);
      gl.glPolygonMode(GL.GL_FRONT, GL.GL_FILL);
      gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
      gl.glMatrixMode(GL.GL_PROJECTION);
   }

   // class for building random lists (in my soft of course those list aren't random)
  public void buildLists()
   {
      listID = gl.glGenLists(5);
      float stepSize = 10;
      Random rand = new Random();
      for (int i = listID; i < listID + 5; i++)
      {
         System.out.println("creating list : " + i);
         gl.glNewList(i, GL.GL_COMPILE);
            gl.glColor4f(0, 0, 0, 1);
            gl.glLineWidth(1);
            gl.glBegin(GL.GL_LINE_STRIP);
               for (int j = 0; j <= stepSize; j++)
               {
                  gl.glVertex2f(j * 10, rand.nextFloat() * 100);
               }
            gl.glEnd();
         gl.glEndList();
      }
   }

   public void display(GLAutoDrawable drawable)
   {
      gl = drawable.getGL();
      gl.glClear(GL.GL_COLOR_BUFFER_BIT);
      gl.glLoadIdentity();
      glu.gluOrtho2D(0, max, 0, 100 + 2 * margin);
      drawMargins(gl);
     
      // flag for creating new lists if they've been destroyed and if the user clicks on "Build Lists"
     if (listID == 0)
      {
         System.out.println("init list");
         buildLists();
      }

      // displaying the random lists
     if (listToDisplay > 0 && listToDisplay <= 5)
      {
         System.out.println("calling list : " + listToDisplay);
         gl.glCallList(listToDisplay);
      }
     
      gl.glFlush();
   }

   private void drawMargins(GL gl)
   {
      gl.glColor4f(0.5f,0.5f,0.5f,0.5f);
      gl.glBegin(GL.GL_POLYGON);
         gl.glVertex2f(0, 100 + margin);
         gl.glVertex2f(max, 100 + margin);
         gl.glVertex2f(max, 100 + 2 * margin);
         gl.glVertex2f(0, 100 + 2 * margin);
      gl.glEnd();
      gl.glBegin(GL.GL_LINES);
         gl.glVertex2f(0, 50 + margin);
         gl.glVertex2f(max, 50 + margin);
      gl.glEnd();
      gl.glBegin(GL.GL_POLYGON);
         gl.glVertex2f(0, 0);
         gl.glVertex2f(max, 0);
         gl.glVertex2f(max, margin);
         gl.glVertex2f(0, margin);
      gl.glEnd();
   }

   public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
   {
      this.width = width;
      this.height = height;
      glu.gluOrtho2D(0, max, 0, 100 + 2 * margin);
   }

   public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
   {
   }
}

Offline leopold.frey

Senior Newbie





« Reply #7 - Posted 2006-03-11 01:59:11 »

I just tried my test on my PC (until now I tested on a powerbook)

So on windows XP, java 1.5.0_06, NVIDIA Geforce MX 400
except for the endless spinning wheel on window resize,
I've got the same behaviour (display lists vanish after a call to the init method).

So...

Any solution ?

Thanks

Léo
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #8 - Posted 2006-03-11 23:45:51 »

OK, sorry about this. In order to force the pbuffer to actually create an OpenGL context you have to try to render into it at least once. This means that if you add a call to glpb.display() immediately after creating it then your example will work as expected. We can't really hide this in the implementation, I think, because otherwise it will be difficult to propagate the init() callback out to the end user.

I don't know what's happening with the resizing issues on OS X yet.
Offline leopold.frey

Senior Newbie





« Reply #9 - Posted 2006-03-12 01:26:09 »

Hi

Quote
In order to force the pbuffer to actually create an OpenGL context you have to try to render into it at least once. This means that if you add a call to glpb.display() immediately after creating it then your example will work as expected.

It works great. Thanks.

Quote
I don't know what's happening with the resizing issues on OS X yet.

Are you able to reproduce it ?

Léo
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #10 - Posted 2006-03-12 04:49:36 »

Are you able to reproduce it ?

I wasn't able to see any problems with my home machine (running 10.3.9) but will try again on my office Mac on Monday, which is running 10.4.5.
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #11 - Posted 2006-03-19 01:48:36 »

The hang upon resizing of GLJPanels on OS X has been fixed. Sorry for taking so long to track this down. The fix will be present in the nightly builds dated 3/19 or later.
Offline leopold.frey

Senior Newbie





« Reply #12 - Posted 2006-04-03 12:39:20 »

Thanks,
sorry for the delay, I was working on something else waiting for this to be fixed.
I'll test it asap.
Thanks again.

Léo
Offline leopold.frey

Senior Newbie





« Reply #13 - Posted 2006-04-03 13:28:17 »

Ok it works tough resizing is a bit slow.
Thanks

Léo
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #14 - Posted 2006-04-03 21:23:04 »

GLJPanels are pretty abysmally slow on OS X even with high-end hardware. However, in Apple's release of Mustang the Java2D/JOGL bridge should be enabled on that platform which should solve all of the speed issues.
Offline leopold.frey

Senior Newbie





« Reply #15 - Posted 2006-06-26 15:00:38 »

Hi

I finally got all working well on my powerbook G4 1.67GHz (ATI  ATY,RV360M11 AGP 64 Mo) Mac OS 10.4.6 Java 1.5.0_06
I've got 5 windows with GLJPanel doing 2D drawing (one 3D) simultaneously and sharing context.

Now I'm testing this app on a G5 2*2.23GHz (GeForce 6600 PCI 256 Mo) Mac OS 10.4.6 Java 1.5.0_06
and it doesn't work at all
it's very very slow, even with only one window open.

While trying to find the problem I tried the jogl demos.
It seems that this G5 doesn't like GLJpanels at all, all demos work fine except the JRefract demos (with Jogl/Swing interoperability)
For example the JGear demo runs @ 2.96fps without transparency on the G5 while on my pbook it runs @ 32fps.

Quote
GLJPanels are pretty abysmally slow on OS X even with high-end hardware.

Is this what you're talking about ?

Quote
However, in Apple's release of Mustang the Java2D/JOGL bridge should be enabled on that platform which should solve all of the speed issues.

I saw today that apple released a first version of mustang, do you think it can solves this problem ?

Thanks

Léo
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #16 - Posted 2006-06-26 15:22:49 »

Yes, the extremely slow frame rates with GLJPanels on hardware like G5s is what I'm talking about. There isn't a workaround for this at the moment. Apple is still working on implementing the OpenGL pipeline for Java2D to the best of my knowledge; once it's in place it should only take a couple of weeks to get the Java2D/JOGL bridge working on that platform. Note that Apple doesn't currently have a Mustang build for PowerPC though.
Offline leopold.frey

Senior Newbie





« Reply #17 - Posted 2006-06-26 15:52:21 »

It's a pity.
Tested on another G5 with a nVidia GeForce FX 5200 AGP 64Mo (os 10.4.6 java 1.5.0_06) and
 on an iBook with a nVidia GeForce FX Go 5200 AGP 64Mo (os 10.4.6 java 1.5.0_06).
Better but still unusable.
It seems that nVidia rendering is terrible ! (not only slow but also triangles with holes and no clearing of the window before drawing.
Maybe it's a nVidia problem more than a jogl or osX one ?

Quote
Note that Apple doesn't currently have a Mustang build for PowerPC though.

Quote from Apple Developper Connection (https://connect.apple.com/) :

Quote
Java SE 6.0 Release 1 Developer Preview 3

Java SE 6 Release 1 is based on JDK 1.6.0_b82 and brings enhanced functionality to the Java SE platform on Mac OS X v10.4 Tiger. The preview supports both Intel-based and PowerPC-based Macintosh computers and is not removable. Please see the release notes for more information. This is Developer Preview 3 of Java SE 6.0 Release 1 for Mac OS X Tiger.

But maybe I misunderstood something.

Thanks

Léo
Offline leopold.frey

Senior Newbie





« Reply #18 - Posted 2006-06-26 17:53:29 »

Another test on a imac G5 1.9GHz ATI RV370 PCI-E 128Mo Mac os 10.4.6 Java 1.5.0_06
Works great.

I never believed I'd say that but today I love ATI.

Léo
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #19 - Posted 2006-06-26 18:13:58 »

Thanks for pointing out the PowerPC port of Mustang for OS X. The last time I checked was DP1 which was Intel-only.

I think the problem is probably more Apple's driver implementation for NVidia hardware on OS X. I would suggest you subscribe to the mac-opengl or another Apple mailing list and post there about these performance issues with NVidia hardware. Since the GLJPanel by default only really uses very generic operations like glReadPixels and BufferedImage rendering I think there must be some low-level performance issues in Apple's NVidia drivers.
Offline leopold.frey

Senior Newbie





« Reply #20 - Posted 2006-06-27 13:47:08 »

Hi Ken,

First, thanks for your quick answers.

Second I removed all GLJPanel and replaced them with GLCanvas.
It's amazing how fast it runs now. GLJPanel where useful only for text labels and some JComboBox, because I didn't found how to write text except with the GLU.HELVETICA which isn't really nice (by the way if you know a "simple" method for drawing "nice-looking" text). I'll find a workaround easily since the performance is much much much much better now.

Now on nVidia drivers I still have troubles, it runs as fast as on ATI cards but it's like something is missing.
Thin lines doesn't seem to be drawn when GL_LINE_SMOOTH is disabled but not all the time and triangles aren't really filled.
Do you see something that could cause this ?

see examples :

http://leopold.frey.free.fr/render/ATI_1.jpg
http://leopold.frey.free.fr/render/nVidia_1.jpg
http://leopold.frey.free.fr/render/ATI_2.jpg
http://leopold.frey.free.fr/render/nVidia_2.jpg
http://leopold.frey.free.fr/render/ATI_3.jpg
http://leopold.frey.free.fr/render/nVidia_3.jpg
http://leopold.frey.free.fr/render/ATI_4.jpg
http://leopold.frey.free.fr/render/nVidia_4.jpg

Maybe it's just an option to set on nVidia cards ?

Thanks

Léo
Offline leopold.frey

Senior Newbie





« Reply #21 - Posted 2006-06-27 14:57:55 »

Another test :

I commented all gl.glDisable(GL.GL_LINE_SMOOTH)
in my code (on certain parts I use smoothing, on other I don't)
and It works as expected :

Thin lines now appear but are ugly (cause I don't want those to be smoothed)
And the triangle problem isn't solved.

Disabling the GL_POLYGON_SMOOTH crashes not the app but the computer which is very rare on os X (always for computer with nVidia cards).

I noticed that on nVidia computers when the app is launching (big app, long time) the computer seems to be blocked (mouse pointer doesn't respond nor the os), once GLCanvas are first drawn everything goes back to normal.

Léo
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #22 - Posted 2006-06-27 17:04:45 »

I haven't tried using antialiased polygons and lines but I think your best bet is to use the GLCapabilities to turn on full-scene antialiasing, e.g. setSampleBuffers(true); setNumSamples(4); Doing a quick search for GL_LINE_SMOOTH seems to indicate that that isn't well supported by various drivers.

You should register for Apple's Developer Program and report the machine crashes you're seeing. No user level program should be able to do that.
Offline leopold.frey

Senior Newbie





« Reply #23 - Posted 2006-06-27 18:45:43 »

I'll try ASAP.

I'm not very qualified and used to deal with graphic cards.

Thanks

I'll let you know
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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 (15 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (34 views)
2014-08-16 06:45:27

Tekkerue (32 views)
2014-08-16 06:22:17

Tekkerue (20 views)
2014-08-16 06:20:21

Tekkerue (30 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (43 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
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!