Archived

This topic is now archived and is closed to further replies.

Zeus_

A bitmap into memory?

Recommended Posts

Hi. Is this the right forum to ask how one might go about loading a bitmap into a _____ in order to map it? I left it blank because I wasn''t sure whether or not you load it into a multidimensional array and use a pointer, a single array, or what... Conclusion: I forgot how to load pictures into memory, and create something so that I can map them with (like a pointer?) zeus_

Share this post


Link to post
Share on other sites
glTexImage2D( GLenum target,
GLint level,
GLint internalFormat,
GLsizei width,
GLsizei height,
GLint border,
GLenum format,
GLenum type,
const GLvoid *texels )

As you can see by the last parameter you need a pointer to a spot in memory.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites
glTexImage2D( GLenum target,
GLint level,
GLint internalFormat,
GLsizei width,
GLsizei height,
GLint border,
GLenum format,
GLenum type,
const GLvoid *texels )

Thank you in Advance.

Let me see if I get this right:

target = filename
level = 3 (for R, G, and B)
internalFormat = ???
width = width
height = height
border = 0 (no border)
format = ??
type = ??
texels = pointer


Just the three up there with the question marks are the ones I dont get. Thanks.

zeus_

Share this post


Link to post
Share on other sites
You should look up the OpenGL Red Book or the OpenGL Super Bible to get a better idea of what you need to do. OpenGL doesn''t provide loaders. You, or someone else, needs to do all the work of getting your bitmap data into a format that can be fed into OpenGL. Take a look at nehe.gamedev.net. Lesson 5 or 6 has texture loading in it. It should be a start.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post


Link to post
Share on other sites