Show Posts
|
|
Pages: [1]
|
|
1
|
Java Game APIs & Engines / OpenGL Development / Multitexturing Problems :/ [SOLVED]
|
on: 2006-05-07 18:37:48
|
edit: Solved It!  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.
|
|
|
|
|
5
|
Java Game APIs & Engines / JOGL Development / Re: JOGL is slow?
|
on: 2005-10-21 14:43:30
|
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 10:53:17
|
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 22:48:48
|
WEEE!! I solved it  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 21: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 20: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(); } } |
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|