LWJGL Forum

Programming => OpenGL => Topic started by: Trudko on March 21, 2007, 21:01:03

Title: Exception in thread "main" java.lang.IllegalArgumentException: Number of remaini
Post by: Trudko on March 21, 2007, 21:01:03
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)
Title: Re: Exception in thread "main" java.lang.IllegalArgumentException: Number of rem
Post by: Matzon on March 21, 2007, 23:36:38
you need to flip or rewind your buffer.
You're intending to put 16 elements in a buffer that has 0 elements space left.
Title: Re: Exception in thread "main" java.lang.IllegalArgumentException: Number of remaini
Post by: Trudko on March 22, 2007, 05:45:58
I've done it look at my previous post. There is code.
Title: Re: Exception in thread "main" java.lang.IllegalArgumentException: Number of rem
Post by: Matzon on March 22, 2007, 08:19:35
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.
Title: Re: Exception in thread "main" java.lang.IllegalArgumentException: Number of remaini
Post by: Trudko on March 22, 2007, 13:33:49
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?...
Title: Re: Exception in thread "main" java.lang.IllegalArgumentException: Number of rem
Post by: Kova on March 22, 2007, 20:53:12
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.
Title: Re: Exception in thread "main" java.lang.IllegalArgumentException: Number of rem
Post by: Fool Running on March 26, 2007, 17:43:45
Try a buffer.rewind() instead of a buffer.flip(). Don't know if that would make any difference...