// --- 2D Draw flags (32 bits) ---
#define DRAW_GENERAL (0*3) // (3 bits)
#define DRAW_WINDOW (1*3) // (3 bits) redraw the windows
#define DRAW_BACK_GRND (2*3) // (3 bits) <inside ogl context> clear the window's background
#define DRAW_XOR_CLEAR (8*3+0) // (1 bits) <inside ogl context> clear the XOR data
#define DRAW_DB_OPENGL (3*3) // (3 bits) <inside ogl context> redraw the OpenGL protion for each element of the db
#define DRAW_DLL_OPENGL (4*3) // (3 bits) <inside ogl context> redraw the OpenGL portion for the dll
#define DRAW_DB_STENCIL (5*3) // (3 bits) <inside ogl context> do the stencil portion for each element of the db
#define DRAW_DLL_STENCIL (6*3) // (3 bits) <inside ogl context>
#define DRAW_HIGHLIGHT (7*3) // (3 bits) <inside ogl context> redraw the highlight around the element
#define DRAW_XOR_DRAW (8*3+1) // (1 bits) <inside ogl context> draw the XOR data
#define DRAW_FINAL (8*3+2) // (1 bits) <inside ogl context> last OpenGL drawing
#define DRAW_CURSOR (9*3+0) // (1 bits) <inside ogl context> redraw the cursor
#define DRAW_BACK_COLOR (9*3+1) // (1 bits) <inside ogl context> clear the local background color
#define DRAW_BACK_STENCIL (9*3+2) // (1 bits) <inside ogl context> clear the local background stencil
// --- 3D Draw flags (32 bits) ---
#define DRAW_3D_WINDOW (0*3+32) // (3 bits) Each step, before the clear
#define DRAW_3D_CAMERA (1*3+32) // (3 bits) Each step (value=Step)
#define DRAW_3D_LIGHT (2*3+32) // (3 bits) Each step (value=Step)
#define DRAW_3D_TRANSFO (3*3+32) // (3 bits) Each step (value=Step)
#define DRAW_3D_PRE (4*3+32) // (3 bits) First step only (value=Nb_Step)
#define DRAW_3D_DB (5*3+32) // (3 bits) Each step (value=Step)
#define DRAW_3D_GEOM (6*3+32) // (3 bits) Each step (value=Step)
#define DRAW_3D_DLL (7*3+32) // (3 bits) Each step (value=Step)
#define DRAW_3D_POST (8*3+32) // (3 bits) Last step only
#define DRAW_3D_END (9*3+32) // (3 bits) Each step (value=Step)
// ---------------------------------------------------------------------
#define REDRAW_MASK_GENERAL ((UInt64)0x07<<DRAW_GENERAL)
#define REDRAW_MASK_WINDOW ((UInt64)0x07<<DRAW_WINDOW)
#define REDRAW_MASK_BACK_GRND ((UInt64)0x07<<DRAW_BACK_GRND)
#define REDRAW_MASK_XOR_CLEAR ((UInt64)0x01<<DRAW_XOR_CLEAR)
#define REDRAW_MASK_DB_OPENGL ((UInt64)0x07<<DRAW_DB_OPENGL)
#define REDRAW_MASK_DLL_OPENGL ((UInt64)0x07<<DRAW_DLL_OPENGL)
#define REDRAW_MASK_DB_STENCIL ((UInt64)0x07<<DRAW_DB_STENCIL)
#define REDRAW_MASK_DLL_STENCIL ((UInt64)0x07<<DRAW_DLL_STENCIL)
#define REDRAW_MASK_HIGHLIGHT ((UInt64)0x07<<DRAW_HIGHLIGHT)
#define REDRAW_MASK_XOR_DRAW ((UInt64)0x01<<DRAW_XOR_DRAW)
#define REDRAW_MASK_FINAL ((UInt64)0x01<<DRAW_FINAL)
#define REDRAW_MASK_CURSOR ((UInt64)0x01<<DRAW_CURSOR)
#define REDRAW_MASK_BACK_COLOR ((UInt64)0x01<<DRAW_BACK_COLOR)
#define REDRAW_MASK_BACK_STENCIL ((UInt64)0x01<<DRAW_BACK_STENCIL)
#define REDRAW_MASK_3D_WINDOW ((UInt64)0x07<<DRAW_3D_WINDOW)
#define REDRAW_MASK_3D_CAMERA ((UInt64)0x07<<DRAW_3D_CAMERA)
#define REDRAW_MASK_3D_LIGHT ((UInt64)0x07<<DRAW_3D_LIGHT)
#define REDRAW_MASK_3D_TRANSFO ((UInt64)0x07<<DRAW_3D_TRANSFO)
#define REDRAW_MASK_3D_PRE ((UInt64)0x07<<DRAW_3D_PRE)
#define REDRAW_MASK_3D_DB ((UInt64)0x07<<DRAW_3D_DB)
#define REDRAW_MASK_3D_GEOM ((UInt64)0x07<<DRAW_3D_GEOM)
#define REDRAW_MASK_3D_DLL ((UInt64)0x07<<DRAW_3D_DLL)
#define REDRAW_MASK_3D_POST ((UInt64)0x07<<DRAW_3D_POST)
#define REDRAW_MASK_3D_END ((UInt64)0x07<<DRAW_3D_END)
// ---------------------------------------------------------------------
#define REDRAW_GENERAL ((UInt64)0x02<<DRAW_GENERAL) // = 0x 0000 0002
#define REDRAW_WINDOW ((UInt64)0x02<<DRAW_WINDOW) // = 0x 0000 0010
#define REDRAW_BACK_GRND ((UInt64)0x02<<DRAW_BACK_GRND) // = 0x 0000 0080
#define REDRAW_XOR_CLEAR ((UInt64)0x01<<DRAW_XOR_CLEAR) // = 0x 0100 0000
#define REDRAW_DB_OPENGL ((UInt64)0x02<<DRAW_DB_OPENGL) // = 0x 0000 0400
#define REDRAW_DLL_OPENGL ((UInt64)0x02<<DRAW_DLL_OPENGL) // = 0x 0000 2000
#define REDRAW_DB_STENCIL ((UInt64)0x02<<DRAW_DB_STENCIL) // = 0x 0001 0000
#define REDRAW_DLL_STENCIL ((UInt64)0x02<<DRAW_DLL_STENCIL) // = 0x 0008 0000
#define REDRAW_HIGHLIGHT ((UInt64)0x02<<DRAW_HIGHLIGHT) // = 0x 0040 0000
#define REDRAW_XOR_DRAW ((UInt64)0x01<<DRAW_XOR_DRAW) // = 0x 0200 0000
#define REDRAW_FINAL ((UInt64)0x01<<DRAW_FINAL) // = 0x 0400 0000
#define REDRAW_CURSOR ((UInt64)0x01<<DRAW_CURSOR) // = 0x 0800 0000
#define REDRAW_BACK_COLOR ((UInt64)0x01<<DRAW_BACK_COLOR) // = 0x 1000 0000
#define REDRAW_BACK_STENCIL ((UInt64)0x01<<DRAW_BACK_STENCIL) // = 0x 2000 0000
#define REDRAW_3D_WINDOW ((UInt64)0x02<<DRAW_3D_WINDOW)
#define REDRAW_3D_CAMERA ((UInt64)0x02<<DRAW_3D_CAMERA)
#define REDRAW_3D_LIGHT ((UInt64)0x02<<DRAW_3D_LIGHT)
#define REDRAW_3D_TRANSFO ((UInt64)0x02<<DRAW_3D_TRANSFO)
#define REDRAW_3D_PRE ((UInt64)0x02<<DRAW_3D_PRE)
#define REDRAW_3D_DB ((UInt64)0x02<<DRAW_3D_DB)
#define REDRAW_3D_GEOM ((UInt64)0x02<<DRAW_3D_GEOM)
#define REDRAW_3D_DLL ((UInt64)0x02<<DRAW_3D_DLL)
#define REDRAW_3D_POST ((UInt64)0x02<<DRAW_3D_POST)
#define REDRAW_3D_END ((UInt64)0x02<<DRAW_3D_END)
#define REDRAW_3D_START ((UInt64)(0x04000000000000000))
#define REDRAW_3D_LOOP ((UInt64)(0x08000000000000000))
// ---------------------------------------------------------------------
#define REDRAW_ALL_2D ((UInt64)(0x0000000000FFFFFFF))
#define REDRAW_ALL_3D ((UInt64)(0x0FFFFFFFF00000000))
#define REDRAW_ALL (REDRAW_ALL_2D | REDRAW_ALL_3D | REDRAW_BACK_COLOR|REDRAW_BACK_STENCIL)
#define REDRAW_GENERAL_AND_UP ((0x0FFFFFFFF<<DRAW_GENERAL) & REDRAW_ALL_2D)
#define REDRAW_WINDOW_AND_UP ((0x0FFFFFFFF<<DRAW_WINDOW) & REDRAW_ALL_2D)
#define REDRAW_DB_OPENGL_AND_UP ((0x0FFFFFFFF<<DRAW_DB_OPENGL) & REDRAW_ALL_2D)
#define REDRAW_CLEAR_2D (REDRAW_BACK_GRND|REDRAW_DB_OPENGL_AND_UP)
#define REDRAW_DELAY_ON ((UInt64)(0x00000000040000000))
#define REDRAW_DELAY_OFF ((UInt64)(0x00000000080000000))
|