hi ,can anyone tell me how to change the color of the mouse pointer while working with graphics in c.i think it will require the use of interrupts
This is a discussion on mouse programming within the A Brief History of Cprogramming.com forums, part of the Community Boards category; hi ,can anyone tell me how to change the color of the mouse pointer while working with graphics in c.i ...
hi ,can anyone tell me how to change the color of the mouse pointer while working with graphics in c.i think it will require the use of interrupts
www.brackeen.com
Go to the VGA tutorial on the site. It has some mouse stuff.
when i do my mousing, i don't use the hw cursor, instead, i just use my own since using most hw cursors [tied to an interrupt] don't allow you to do tricks like animation and they are limited to particular video modes... so, i recommend you do use interrupts for your other mousing variables, [int 33h...] and use your own cursor setup...
hasafraggin shizigishin oppashigger...
Excellent doubleanti. He is right. For mouse cursors you should use your own graphics. The hardware cursor is fine for applications, but usually not for games or other types of programming.
There is not a function in the standard MS/Logitech mouse driver for changing the color of the mouse pointer. However, some drivers provide more (sometimes less) support for various functions. But the standard functions 00h through 09h do not handle mouse cursor color.
Just use sub-function 03h to retrieve the coords of the mouse and place your own graphic at those coords. If double-buffering just 'put' your mouse graphic in the buffer at those coords. This is done after all other operations (drawing, rendering, etc) are complete. When you copy the buffer to vidmem the mouse cursor will be on top of all of the graphics. If you are not double-buffering, use bit masks to define your mouse cursor.
I think the order of logical ops is:
- AND the mouse cursor mask with the screen image
- XOR the mouse cursor data with the screen image
You must have ampersands before the regs in the call to int86().Code:union REGS regs; regs.x.ax=0x03; int86(0x33,regs,regs) int mousex=regs.cx; //regs.cx>>1 for 320 width int mousey=regs.dx; //call your function to put the image at mousex,mousey
For some reason, this board messes up the ampersands which prevents me from using them correctly.
If you want to change your hardware mouse cursor, use sub-function 09h and the appropriate bit masks. Logical operations are taken care of by the interrupt handler.
Hmmm no ampersands? I didn't know that...There is probably a way.
&
&lets see if any of those work.Code:&