Exception in thread "main" java.lang.IllegalArgumentException: Number of remaini

Started by Trudko, March 21, 2007, 21:01:03

Previous topic - Next topic

Trudko

I'm getting this exception...(for more info look at my previous topic http://lwjgl.org/forum/index.php/topic,2247.0.html)
Exception in thread "main" java.lang.IllegalArgumentException: Number of remaining buffer elements is 0, must be at least 16
   at org.lwjgl.BufferChecks.throwBufferSizeException(BufferChecks.java:184)
   at org.lwjgl.BufferChecks.checkBufferSize(BufferChecks.java:199)
   at org.lwjgl.BufferChecks.checkBuffer(BufferChecks.java:224)
   at org.lwjgl.opengl.GL11.glMultMatrix(GL11.java:2153)

Matzon

you need to flip or rewind your buffer.
You're intending to put 16 elements in a buffer that has 0 elements space left.

Trudko


Matzon

well, you've done it wrong then ...
you might want to break your application down to the basic problem and then post that. Its basically impossible to help your with those small fragments of code.

Trudko

You think that I'am doing something before it ?hmm Have any idea what could be wrong?I'am doing simple game. Btw please correct me if Iam wrong but this exception is thrown because the floatbuffer is full because of glmultimatrix yes?But I used flip method so?...

Kova

how about you write an app where you do just that? A minimum requirements for your problem code to work. See if it works... if it doesn't, you may post whole source probably and it will be easier to see what is wrong.

Fool Running

Try a buffer.rewind() instead of a buffer.flip(). Don't know if that would make any difference...
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D