LWJGL
May 23, 2012, 02:44:07 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.8.3 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: GL13.glCompressedTexImage2D issue  (Read 803 times)
abcdef
Newbie
*
Posts: 27


« on: October 06, 2011, 16:09:07 »

Hi

When running the below line of code I get the following error

Code:
GL13.glCompressedTexImage2D(GL11.GL_TEXTURE_2D, 0, EXTTextureCompressionS3TC.GL_COMPRESSED_RGB_S3TC_DXT1_EXT, width, height, 0, data);


Code:
org.lwjgl.opengl.OpenGLException: Invalid value (1281)
at org.lwjgl.opengl.Util.checkGLError(Util.java:59)
at org.lwjgl.opengl.GL13.glCompressedTexImage2D(GL13.java:163)

Does anyone know what the lwjgl error means? Which value does it think is invalid?

I wanted to add a size parameter but there wasn't one available with byte buffer as a parameter so I used the method shown
Logged
Fool Running
Nerdus Imperius
*****
Posts: 648


« Reply #1 on: October 07, 2011, 05:35:37 »

The size is implied from the remaining() method on the data buffer. Make sure you flip() the data buffer after you fill it with data and make sure your width and height are correct.

From the OpenGL spec:
Quote
GL_INVALID_VALUE is generated if imageSize is not consistent with the format, dimensions, and contents of the specified compressed image data.
Logged

Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option Grin
abcdef
Newbie
*
Posts: 27


« Reply #2 on: October 07, 2011, 07:02:00 »

Thanks, I'd fixed it not soon after I posted but I didn't understand the error too much (I was loading mipmap data and had a bug, I normally rewind all my buffers as I ensure the size is correct to begin with rather than flip but thats a large reason for most buffer issues). I thought it might have been a lwjgl specific error so wanted to understand it for future reference.

Thanks for the help, wasn't a lwjgl error in the end but now I know to check the open gl error guides if I get a similar thing
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!