View Full Version : background bmp image moves as both player move plz

11-08-2010, 10:21 AM
I m making 2d game ive done it 50% now I am wanting to move background image which is bmp image when both player move to left or right so bakgroun image also move as u see in the fighting game liks street fighter.
So I set the worldwindow w=(0 to 800) h=(0 to 600) and the background image is ( 1600)x (600) view port is default to screen window (0 x800) x (0x600) so at start i want to draw the center of image which will be 600 to 1400 and when player move the background image move depend on both player movement so how it is possible i m using GLDrawPixel() for pixel drwaing of an image. plase quick reply

second question :
Is there any method that will draw pixel from start to End because there is not any feature in glDrawPixel

11-08-2010, 11:27 AM
In Simple word my question is that can any body tell that if i set glraserpos(x,y) function the value of x negative then it didnot draw a picture can any body tell me that why? it is happening and how to resolve iit

11-08-2010, 03:19 PM
This definitely sounds like a case where it would be better to use a texture mapped quad in the background, rather than glDrawPixels. Put your background image on a large quad and move it using glTranslate. That way you won't have to use glRasterPos. It would probably run faster that way too. I've heard it said many times on this forum that glDrawPixels is slow. Good luck.