Interesting But Problematic WM_MOUSEMOVE Issues

MrChips

Joined Oct 2, 2009
30,824
But i dont think you yet described how you would render the graphic on screen when the mouse moves. It has to be in real time and the mouse pointer has to remain right over the part that is changed by the move.
The cursor is defined in pixels. You do not zoom the cursor since the size is fixed regardless of zoom feature. Cursors are usually drawn as sprites using bitblt operations, i.e. it is layered on top of any foreground and background images. It really depends on what graphics capabilities and support comes with your hardware.

Cursors in my graphics programs are generally of two styles only, an arrowhead and cross-hairs. For these I chose to use line vectors drawn in XOR mode. With this mode my cursors can traverse the screen and I don't have to worry about destroying the underlying images in foreground or background.
 

MrChips

Joined Oct 2, 2009
30,824
And I am not an advocate of adding complexity to make make a program run as fast as possible so the cpu is sitting in its idle loop 99% of the time.

My theory is that, given the platform you are targeting, use the simplest code that will give you good enough performance.

I actually started my PC CAD program using integers representing mils as the units. The code became way to difficult when doing things like intersections, so I switched to floating point simplifying the code. I saw absolutely no change in responsiveness.

I am tempted to do some benchmarks. I don’t think fixed point has any performance advantage over float on modern x86 processors.

Bob
We are too spoiled by oodles of memory and super fast CPUs and we still beg for more.

My first CAD program I wrote in ASM for a Data General Nova computer. In the first version all object data and drawing commands were stored as straight text. The performance was not super great. Then I converted to binary and I was very happy with the performance. I ported the program over to Apple Macintosh all written in Pascal at the time.
 

Thread Starter

MrAl

Joined Jun 17, 2014
11,496
The cursor is defined in pixels. You do not zoom the cursor since the size is fixed regardless of zoom feature. Cursors are usually drawn as sprites using bitblt operations, i.e. it is layered on top of any foreground and background images. It really depends on what graphics capabilities and support comes with your hardware.

Cursors in my graphics programs are generally of two styles only, an arrowhead and cross-hairs. For these I chose to use line vectors drawn in XOR mode. With this mode my cursors can traverse the screen and I don't have to worry about destroying the underlying images in foreground or background.
Oh normally the system draws the cursor i dont usually do that i guess because i never had too. All i do in programs i make myself is change the icon used to represent the cursor which really can be just about anything or one of the predefined types on the system. For example, small arrowhead, large arrowhead, crosshairs, or even something that looks like a pencil or pen. Oh one i do draw for blend operations it changes from an arrowhead (system drawn) to a square (drawn) but that's it.

But do you mean draw the cursor too for everything including just regular mouse moves? I dont usually have to do that but that's an interesting idea if that is what you mean.
 

Thread Starter

MrAl

Joined Jun 17, 2014
11,496
We are too spoiled by oodles of memory and super fast CPUs and we still beg for more.

My first CAD program I wrote in ASM for a Data General Nova computer. In the first version all object data and drawing commands were stored as straight text. The performance was not super great. Then I converted to binary and I was very happy with the performance. I ported the program over to Apple Macintosh all written in Pascal at the time.
Wow that takes me back. The last time i even saw the word "Pascal" for anything was probably 10 years ago. Before that i had to use some of that back in college for a computer science class, and way way back i had a computer that was very limited in software and i wanted to be able to program in Pascal so i had to create a Pascal-like language. But i wonder if anyone uses that language anymore.
 
Top