PDA

View Full Version : Easy background image method?



drummerboy_2002
02-22-2002, 12:19 PM
I'm using MSVC++ and OpenGL, and I'm trying to put a set background image in my window. Is there an easy way to do this without slapping a texture on a poly?

nexusone
02-22-2002, 01:01 PM
No! that is the way I would do it.


Originally posted by drummerboy_2002:
I'm using MSVC++ and OpenGL, and I'm trying to put a set background image in my window. Is there an easy way to do this without slapping a texture on a poly?



[This message has been edited by nexusone (edited 02-22-2002).]

DFrey
02-22-2002, 01:03 PM
Using the textured quad is likely going to be the best solution. Otherwise uploading a bitmap to the framebuffer can be comparatively expensive.

drummerboy_2002
02-22-2002, 03:04 PM
Ignoring the extra expense, how would I go about loading a bitmap into the frame buffer. I ask because the I haven't decided whether to use Ortho or Perspective and am constantly switching between the two. I assume the textured poly would just give me more things to adjust in the switch.

BTW, the only tools I have at the moment is GLUT.

[This message has been edited by drummerboy_2002 (edited 02-22-2002).]

DFrey
02-22-2002, 03:42 PM
You use glDrawPixels to upload a rectangle of pixels (i.e. raw bitmap).

JML
02-25-2002, 12:25 AM
Originally posted by drummerboy_2002:
Ignoring the extra expense, how would I go about loading a bitmap into the frame buffer. I ask because the I haven't decided whether to use Ortho or Perspective and am constantly switching between the two. I assume the textured poly would just give me more things to adjust in the switch.


Drummerboy,

You do not have to choose between perspective and orthographic projection. You can use both!

Just make sure you know what projection you need when your drawing each part of your scene. For instance, my rendering loop typically looks like this:

push projection matrix
set orthographic projection
draw background at z=max and depthTest( GL_ALWAYS), automatically clearing depth buffer
pop projection matrix
draw other interesting stuff
push projection matrix
set orthographic projection
draw console text/score/fps and other stuff
pop projection matrix

HTH

Jean-Marc.

drummerboy_2002
02-26-2002, 09:17 AM
Ah, very helpfull. I didn't even think to try that.
Thanks