Jump to content

View more

View more

Image of the Day

Triangles!  
(Mostly)
#jimmyandthepulsatingmass #screenshotsaturday #screenshot #rpg #rpgmaker https://t.co/6Kch8UgOcw
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

glTexImage2D gives 'invalid value' error

2: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 gimp   Members   

142
Like
Likes
Like

Posted 08 October 2001 - 12:00 AM

I''ve been having some problems with getting some of my tga images to be be created as textures. I naturally though there was something wrong with my code so I created a hard coded call to the api and that failed too: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 640, 128, 0, GL_RGB, GL_UNSIGNED_BYTE, a_Image.GetData()); My card supports 2048x2048 textures. Size of my image data array is 640*128*3 bytes. The funny thing is, when you call gluBuild2DMipmaps with the same data(args differ a little) the texture creation works fine. Which leads me to two possible conclusions: 1) gluBuild2DMipmaps is smarter and fixed some error I''m making. 2) The difference in args is the key. 2 seems more plausable so I check and rechecked the args. they look good to me... Any thoughts much appreciated... Many thanks Chris Brodie http:\\fourth.flipcode.com

#2 MButchers   Members   

123
Like
Likes
Like

Posted 08 October 2001 - 01:06 AM

Hi there,

the problem is you are passing a rectangular ( not square )
image, all opengl textures need to be to the power of 2 and
square ( although i believe there are extensions to support
rectangular textures ).

The reason why it works with gluBuild2DMipmaps is that
this scales the image so it is square ( from what I can
gather from the red book ).

Hope it helps

Mark

#3 MENTAL   Members   

383
Like
Likes
Like

Posted 09 October 2001 - 11:39 PM

hmm... i never knew they textures had to be square. afaik, all they had to have is a height and a width that is a power of 2.

MENTAL




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.