Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
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 / OpenGL Development / Multitexturing Problems :/ [SOLVED] on: 2006-05-07 16:37:48
edit: Solved It!  Roll Eyes

I got some weird stuff going on when trying to use multitextures.
For example this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
String extensions;
extensions = GL11.glGetString(GL11.GL_EXTENSIONS);
     
if( extensions.indexOf("GL_ARB_multitexture") != -1 && extensions.indexOf("GL_EXT_texture_env_combine") != -1 ) {
   IntBuffer temp = ByteBuffer.allocateDirect(64).order(ByteOrder.nativeOrder()).asIntBuffer();
   GL11.glGetInteger(GL13.GL_MAX_TEXTURE_UNITS, temp);
   temp.get(maxTexelUnits);
   for(int i=0; i<maxTexelUnits.length; i++) {
      System.out.print(maxTexelUnits[i] +", ");
   }
   return true;
}

Outputs, 16 zeros :/

Doesn't my graphics card support multitexturing?? It's a Sapphire X800GTO2.
2  Game Development / Newbie & Debugging Questions / Re: Abstract but not abstract? on: 2005-10-23 12:57:34
Yea, you guys are right, it returns a DirectByteBuffer object.
3  Game Development / Newbie & Debugging Questions / Abstract but not abstract? on: 2005-10-23 11:59:31
I was looking for information about the java.nio.ByteBuffer class and noticed that it has a lot of abstract methods. What confuses me is that you can create a ByteBuffer object by calling the static ByteBuffer.allocate or ByteBuffer.allocateDirect methods, and then use the abstract methods on this object. Erhm... how is that possible?

For example:
1  
2  
3  
4  
ByteBuffer bb = ByteBuffer.allocateDirect(4); 
bb.putInt(10); // ByteBuffer.putInt(int) is an abstract method, still I can use it :/

System.out.println(bb.getInt(0)); // calling yet another abstract method =|


Here's a link to the ByteBuffer reference: http://java.sun.com/j2se/1.5.0/docs/api/java/nio/ByteBuffer.html
4  Java Game APIs & Engines / JOGL Development / Re: JOGL is slow? on: 2005-10-21 14:01:25
Quote
Have you tried LWJGL already, if so, did you have the same jerky-ness? Can you output the framerate?

I did it now, and it works great!
I guess I will have to use LWJGL instead then.
5  Java Game APIs & Engines / JOGL Development / Re: JOGL is slow? on: 2005-10-21 12:43:30
Quote
Hi, try this..

System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));


That gave me this results:

GL_VENDOR: ATI Technologies Inc.
GL_RENDERER: RADEON Xpress 200G Series SW TCL x86/MMX/3DNow!/SSE2
GL_VERSION: 1.4.4707 WinXP Release
6  Java Game APIs & Engines / JOGL Development / Re: JOGL is slow? on: 2005-10-21 08:53:17
Quote
Did you remove glFlush() & glFinish() and try with the ATI?

Is the ATI driver dropping you into software rendering mode?

Yes I removed the glFlush() & glFinish(), actually I didn't have them in my source from the beginning. But as I searched this forum I found a reply that said you should use these two methods, so I did, though I never done it before :/

And no I never checked if it dropped into software rendering mode, I don't know how to :/
7  Java Game APIs & Engines / JOGL Development / Re: JOGL is slow? on: 2005-10-20 20:48:48
WEEE!! I solved it   Cheesy

I was running my system with the onboard graphics card which is an ATI XPRESS 200, but I have a Nvidia 6600GT. I didn't have the 6600GT installed because it was giving me troubles while playing games, made the computer crash, so I removed it . But now I've installed it again and the jerky stuff that was going on while moving my mouse over the scene has now dissapeared.

So it seems that JOGL has problems with ATI cards, or at least mine :/ Are there any official notes on this?
8  Java Game APIs & Engines / JOGL Development / Re: JOGL is slow? on: 2005-10-20 19:28:34
I found some class called FPSAnimator which I tried with my code instead of the normal Animator and there where no difference, if there was it was very hard to see.

Also after closing some applications which I had in the background while testing, the animation looks pretty good, not perfect, but uhm... better.. anyways the real big problem is when I move my mouse over the window, then the animation gets really jerky. Any solutions for that?
9  Java Game APIs & Engines / JOGL Development / JOGL is slow? on: 2005-10-20 18:12:37
I decided last night to learn som java and JOGL, i am originally a c++ programmer so I havent really put much effort in reading about java, i guessed that I'd learn as I play along.

Anyways, so I made my first JOGL applications, it's a simple triangle that rotates around it's Y-axis. And I use the Animator class to handle the animation.
The problem is that the animation is really jerky and the CPU is up at around 98% of use. Err... So what am I doing wrong?

edit: I just noticed that the animation gets even more jerky if I move my mouse over the window alot :/

Here's the source:
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  
import java.awt.*;
import java.awt.event.*;
import net.java.games.jogl.*;

class GLFrame extends Frame implements GLEventListener
{
   protected Animator glAnimator;
   private int yrot = 0;

   public GLFrame()
   {
      super("JOGL Frame");
      setSize(320, 240);
   
      GLCanvas glCanvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities());
      glCanvas.addGLEventListener(this);
      add(glCanvas);

      glAnimator = new Animator(glCanvas);
     
      addWindowListener(new WindowAdapter(){
         public void windowClosing(WindowEvent e){
            glAnimator.stop();
            System.exit(0);
         }
      });

      setVisible(true);
      glAnimator.start();
   }

   public void init(GLDrawable drawable)
   {
      GL gl = drawable.getGL();
      gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
      gl.glClearDepth(1.0f);
      gl.glEnable(GL.GL_DEPTH_FUNC);
   }

   public void reshape(GLDrawable drawable, int i, int x, int width, int height)
   {
      GL gl = drawable.getGL();
      GLU glu = drawable.getGLU();
     
      gl.glViewport(0, 0, width, height);
      gl.glMatrixMode(GL.GL_PROJECTION);
      gl.glLoadIdentity();
      glu.gluPerspective(45.0f, (float)width/(float)height, 0.1f, 1000.0f);
      gl.glMatrixMode(GL.GL_MODELVIEW);
   }

   public void display(GLDrawable drawable)
   {
      yrot++;
      if( yrot > 360 ){ yrot = 0; }  

      GL gl = drawable.getGL();
      gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
      gl.glLoadIdentity();
      gl.glTranslatef(0.0f, 0.0f, -5.0f);

      gl.glRotatef(yrot, 0.0f, 1.0f, 0.0f);

      gl.glBegin(GL.GL_TRIANGLES);
      gl.glVertex3f( 0.0f, 1.0f, 0.0f);
      gl.glVertex3f(-1.0f,-1.0f, 0.0f);
      gl.glVertex3f( 1.0f,-1.0f, 0.0f);
      gl.glEnd();

      gl.glFlush();
      gl.glFinish();
   }

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


   public static void main(String[] args)
   {
      new GLFrame();
   }
}
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.

rwatson462 (35 views)
2014-12-15 09:26:44

Mr.CodeIt (26 views)
2014-12-14 19:50:38

BurntPizza (53 views)
2014-12-09 22:41:13

BurntPizza (86 views)
2014-12-08 04:46:31

JscottyBieshaar (48 views)
2014-12-05 12:39:02

SHC (62 views)
2014-12-03 16:27:13

CopyableCougar4 (64 views)
2014-11-29 21:32:03

toopeicgaming1999 (126 views)
2014-11-26 15:22:04

toopeicgaming1999 (116 views)
2014-11-26 15:20:36

toopeicgaming1999 (34 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

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