PDA

View Full Version : Image mouse control!



pran1
03-12-2004, 03:39 AM
Hi! I am trying to display two images simultaneously and was wondering if it possible to have a separate mouse pointers for each image and if yes then which function do I need to use. I would appreciate any help!!!!!!!!!

Thanks
pran

pran1
03-12-2004, 04:19 AM
Hi I have tried to do this but then the cursor is always for the first file.


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(BitmapBits1)
{

// changes the cursor image of the cuurent window
glutSetCursor (GLUT_CURSOR_CYCLE);
glutMouseFunc(Handler);
}
else
{
// mouse pointer for the second file
glutSetCursor (GLUT_CURSOR_HELP);
glutMouseFunc(Handler1);

}

and if I take the if statement out then it displays for the second file only..

does anyone know how to do it.

Thanks
pran

nexusone
03-12-2004, 12:43 PM
Should not the cursor change code not be in the display routine???




[This message has been edited by nexusone (edited 03-12-2004).]

endash
03-12-2004, 12:58 PM
How many windows are you using and how are you drawing into them? Once you've let glut take over, I don't think you can change the mouse function. But you could have a smart mouse function, so that shouldn't matter.

PS
Lay of the exclamation points.

pran1
03-14-2004, 01:42 AM
well what is a smart mouse function..???? and how can i make one ??

p.s- I am using one window do display both images by using quad buffering. And want to have different mouse pointers so that I know which image I am in.

Thanks
Pran

[This message has been edited by pran1 (edited 03-14-2004).]

pran1
03-14-2004, 01:54 AM
Even if I put the mouse function in the display functgion it just displays for the second image.

nexusone
03-14-2004, 05:41 AM
You can e-mail me your code and I can see what I can do, just remember to include the image files to be loaded.



Originally posted by pran1:
Even if I put the mouse function in the display functgion it just displays for the second image.

pran1
03-15-2004, 01:07 AM
PLEASE CHECK YOUR EMAIL i HAVE EMAILED YOU THE CODE WITH THE IMAGE FILES.

THANKS
PRAN


Originally posted by nexusone:
You can e-mail me your code and I can see what I can do, just remember to include the image files to be loaded.

mikael_aronsson
03-15-2004, 04:04 AM
if(BitmapBits1) ??????

Isn't this one always going to be true ?

nexusone
03-15-2004, 04:48 AM
I will check my e-mail when I get home from work, expect it to about 10 to 12 hours from time of this post before I will reply back.



Originally posted by pran1:
PLEASE CHECK YOUR EMAIL i HAVE EMAILED YOU THE CODE WITH THE IMAGE FILES.

THANKS
PRAN

pran1
03-15-2004, 08:17 AM
ya but I have removed if(BitmapBits1) and it still dosent work seems like one function overwrites the other...

pran