The "Draw_Cursor()" function is used to draw (and erase) cursors.
The function call a number of OpenGL drawing functions to draw the shape of the cursor on the screen. OpenGL will use XOR operation to draw the cursor on the images. The same function will be called with the same parameters when sliceO want to remove the cursor. Even though X and Y are provided, you do not need them, when your function is called, the drawing matrix has already centered OpenGL on the position where you will draw the cursor. You do need scale and ratio to adjust the matrix to the correct size for your cursor.
Syntax
extern "C" __declspec(dllexport) int Draw_Cursor(
int up_down,
int brush,
int x, int y,
float scale,
float ratio
)
Parameters
up_down
Is an image of the 3 mouse button states. The lower byte contain a code giving the mouse button action (off, on, pressed or double clicked). The next byte give the state of each of the 3 keys as on or off. The different values for the variable are:
KEY_DBLCLK 3
KEY_PRESS 2
KEY_ON 1
KEY_OFF 0
MOUSE_KEY_LEFT 0x010
MOUSE_KEY_MIDDLE 0x020
MOUSE_KEY_RIGHT 0x040
So, for example, if you click on the left mouse button, the value of up_down will be (KEY_PRESS | MOUSE_KEY_LEFT). When you release the button the value will be KEY_OFF.
brush
Is the Size (in pixel) of the brush diameter.
x, y
Horizontal (x) and vertical (y) position of the cursor within the current window. (0,0 at bottom left).
scale
Is the pixel scaling factor. A pixel of the image can use many pixels of the screen.
ratio
Is the screen pixel aspect ration.
Return value
The function returns "0" if an error occurred, "1" otherwise.
Remarks
The Draw_Cursor() function is only called if your DLL specify a Mode not a Tool.
Requirements
Header:
sliceO_include.hpp
Library:
sliceO_Structures.lib
Example
See also