Segmentation fault using OpenGL

Andre Bleau bleau@igb.umontreal.ca
Mon Mar 24 20:26:00 GMT 2003


Tron Thomas wrote:

>Here is the code:
>...
>    ::glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, nWidth, nHeight, 0, GL_RGBA,
>        GL_UNSIGNED_BYTE, pData);

Here is the bug:

 From glTexImage2D doc:

>void glTexImage2D(
>   GLenum target,
>   GLint level,
>   GLint components,
>   GLsizei width,
>   GLsizei height,
>   GLint border,
>   GLenum format,
>   GLenum type,
>   const GLvoid *pixels
>);
>
>Parameters
>
>target
>The target texture. Must be GL_TEXTURE_2D.
>
>level
>The level-of-detail number. Level 0 is the base image level. Level n is 
>the nth mipmap reduction image.
>
>components
>The number of color components in the texture. Must be 1, 2, 3, or 4.

So components cannot be GL_RGBA, because, from /usr/include/w32api/GL/gl.h:
>#define GL_RGBA                                 0x1908

How such code could survive when compiled with Borland's or M$'s compiler 
(as you claimed) is beyond my understanding, but frankly, I doubt it does.


André Bleau, Cygwin's OpenGL package maintainer.

email: bleau at igb dot umontreal dot ca
(Fight SPAM: encode your email-address)

Please address all questions and problem reports about Cygwin's OpenGL 
package to cygwin@cygwin.com .  


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list