View Full Version : need help

11-09-2002, 12:36 AM
I'm making a side scroller, and need to load a bitmap(doesn't matter what kind of:bmp,tga,tiff,png,pcx,raw,etc) but not in the way they done it in nehe tutorials.I.e. I don't want to texture map the bitmap , I just want every point of bitmap to correspond to a pixel on the screen in full screen mode.

Black Knight
11-09-2002, 02:37 AM
Ortho Mode????THen you will have 800x600 pixels on the screeen and you can use glVertex2i(0,0);

To put a image O_o

11-10-2002, 12:09 AM
No, I am reffering to something like that:
consider the screen with absolute coordinates
(0,0) to (800,600) and a bitmap with 100x100 size.Can I use a code like:
for(int i = 0; i < 100; i++)
for(int j = 0; j < 100; j++) {
c = read_pixel_from_bitmap();
put_pixel(i, j, c);
} ?
If I've could to use texture mapping I've considered it but I must use bitmaps whose width and height are not powers of 2.
Thanks for help!

11-10-2002, 09:41 AM
glDrawPixels and glBitmap should be, what you need. Can't explain, never used them, sorry.

Well, texture mapping, I've heard, is faster and if your bitmap isn't ^2, scale it and just draw a portion of it on screen. You can as well add junk data to get the appropriate size.

11-10-2002, 10:17 AM
Yes it can be done, but if I scale the bitmap I am loosing quality.I guess i need more readings.

11-10-2002, 11:11 AM
You can still use textures even if the source images are not powers of 2. Simply either use one of the texture rectangle extensions or pad the source image to make the dimensions powers of 2.