A bitmap into memory?

Started by
2 comments, last by Zeus_ 22 years, 5 months ago
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_
Advertisement
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
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
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_
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
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson

This topic is closed to new replies.

Advertisement