Skip to main content
gamedev.net
🔒 Locked

A bitmap into memory?

Started by Zeus_ Oct 23, 2001 at 6:38 PM 2 replies 400+ views
Original Post
Zeus_
Zeus_
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_
GKW
GKW
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
Zeus_
Zeus_
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_
GKW
GKW
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

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.