Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Bitmaps In OpenGL


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 mmarvi   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 January 2000 - 09:29 AM

Does anyone have any code or links for a program that can display a bitmap as a texture in OpenGL?

Sponsor:

#2 node_5r   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 January 2000 - 10:48 AM

hey,

did you try www.opengl.org That is the place to go for opengl hope this site helps!

later
node_5r

#3 Wraith   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 January 2000 - 10:59 AM

This code snippet uses the glaux library to load a bitmap and then uses the bitmap data to create a texture object. For more info see NeHe's excellent tutorials at
http://www.demonews.com/hosted/nehe/opengl.htm

AUX_RGBImageRec *texture;
GLuint glTextureData;
texture = auxDIBImageLoad(filename);
if (!texture)
return FALSE;

// Create Textures
glGenTextures(1, glTextureData);

// Create nearest filtered texture:
glBindTexture(GL_TEXTURE_2D, glTextureData);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

glTexImage2D(GL_TEXTURE_2D, 0, 3, m_xSize, m_ySize, 0, GL_RGB, GL_UNSIGNED_BYTE, texture->data);


Edited by - Wraith on 1/23/00 5:00:33 PM




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.



PARTNERS