PDA

View Full Version : Mouse control for images!



pran1
03-12-2004, 03:50 AM
Hi just wondering whether it is possible to have two different mouse pointers for two different images. I am trying to read in tow different images and want to have a mouse pointer for each image.

int main( int argc, char *argv[])
{

int w1, w2;
glutInitDisplayMode( GLUT_RGB |GLUT_DOUBLE| GLUT_STEREO);
BitmapBits1 = LoadDIBitmap("earth.bmp", &BitmapInfo1);
BitmapBits2 = LoadDIBitmap("pic.bmp", &BitmapInfo2);
glutInitWindowSize((int)BitmapInfo1->bmiHeader.biWidth,
(int)BitmapInfo1->bmiHeader.biHeight);
glutInitWindowPosition(250,250);
glutCreateWindow("Stereo Image Viewer");
glutReshapeFunc(Resize);
glutDisplayFunc(Redraw);


if(BitmapInfo1)
{

// changes the cursor image of the cuurent window

}
else
{
// mouse pointer for the second file
glutSetCursor (GLUT_CURSOR_HELP);
glutMouseFunc(Handler1);

}


glutMainLoop();
return (0);
}

If I do this then the mouse pointer is only displayed for the first image and if I take the if statement out then the mouse pointer is displayed for the second image.

I would appreciate any help please.

Many Thanks
pran