panning pixmaps

I have a pixmap (or in windows terminology, a colored ‘bitmap’). I want to be able to pan the image to view different areas of it. I started to use glRaster2f(), but when the lower left hand corner of the image is off screen the image is not drawn. Alas there is no glBitmap() function to correct this. Is there a function that can do what I need or do I need to write a function to manipulate the bitmap bits themselves? Thanks,

-Geo

Best way to pan a bitmap would be to apply it as a texture to a quad.

Just move the quad around the window to pan it.

Originally posted by GeoHoffman:
[b]I have a pixmap (or in windows terminology, a colored ‘bitmap’). I want to be able to pan the image to view different areas of it. I started to use glRaster2f(), but when the lower left hand corner of the image is off screen the image is not drawn. Alas there is no glBitmap() function to correct this. Is there a function that can do what I need or do I need to write a function to manipulate the bitmap bits themselves? Thanks,

-Geo[/b]

Thank you for your reply. What am I doing wrong in this code? All I see is a white square:

void RenderScene1(void)
{

//set up viewport and the projection matrix. clear screen

glViewport(20,80,500,500);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0,500,0,500,100,-100);
glEnable(GL_SCISSOR_TEST);
glScissor(20,80,500,500);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

//check for input and calculate new positions for scene objects
getInput();


//render the background
glTexImage2D(GL_TEXTURE_2D, 0, 3, MainBitmapInfo->bmiHeader.biWidth,  
			 MainBitmapInfo->bmiHeader.biHeight,
			 0,
			 GL_BGR_EXT,
			 GL_UNSIGNED_BYTE, 
			 MainBitmap); 

// glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S, GL_CLAMP );
// glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T, GL_CLAMP );

glBegin(GL_QUADS);
	glVertex3f(0,0,0);
	glVertex3f(0,500,0);
	glVertex3f(500,500,0);
	glVertex3f(500,0,0);
	glVertex3f(0,0,0);
glEnd();

Have you enable textures? glEnable( GL_TEXTURE_2D );

also did you use glBindTexture( GL_TEXTURE_2D, texture_id );

Should also set the mag and min filter with glTexParameter. The default minification filter is to use mipmaps, which you aren’t doing here.

I did call glEnable(GL_TEXTURE_2D); prior to this code. But I did not call the glBindTexture() function. I will try that.

The only problem that I forsee with using textures is that I believe the dimensions of textures all must be powers of 2. This is fine for smaller images but when they get bigger they REALLY grow fast and can waste alot of space. Also, does anyone know if there is a limit to the size of a texture. Am I correct to assume that textures are kept in memory on the video card when supported? Thank you all for your replies.