typedef struct { GLdouble x, y, z; } CAGD_POINT;
enum { CAGD_SEGMENT_UNUSED = 0, CAGD_SEGMENT_POINT, CAGD_SEGMENT_TEXT, CAGD_SEGMENT_POLYLINE };
enum { CAGD_LBUTTONDOWN = 0, CAGD_LBUTTONUP, CAGD_MBUTTONDOWN, CAGD_MBUTTONUP, CAGD_RBUTTONDOWN, CAGD_RBUTTONUP, CAGD_MOUSEMOVE, CAGD_TIMER, CAGD_MENU, CAGD_LOADFILE, CAGD_SAVEFILE, CAGD_LAST };
typedef void (*CAGD_CALLBACK)(int, int, PVOID);
enum { CAGD_LOAD = WM_USER, CAGD_SAVE, CAGD_EXIT, CAGD_ORTHO, CAGD_PERSP, CAGD_CUE, CAGD_SENSLESS, CAGD_SENSMORE, CAGD_FUZZLESS, CAGD_FUZZMORE, CAGD_RESET, CAGD_HELP, CAGD_USER /* use this one to create your own control */ };
void cagdBegin(PCSTR title, int width, int height);
title | text for window's caption; |
width | width of window in pixels (CW_DEFAULT can be used); |
height | height of window in pixels (CW_DEFAULT can be used); |
void cagdMainLoop();
HWND cagdGetWindow();
HMODULE cagdGetModule();
hMenu | handle of menu to append; |
name | title of menu; |
hMenu | handle of menu to remove; |
WORD cagdPostMenu(HMENU hMenu, int x, int y);
hMenu | handle of menu to post; |
x, y | where to post the menu (window's coordinates); |
void cagdSetHelpText(PCSTR text);
text | text shown in help dialog. |
BOOL cagdShowHelp();
void cagdRotate(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
angle | the angle of rotation, in degrees. |
x, y, z | the x, y, and z coordinates of a vector, respectively. |
void cagdTranslate(GLdouble, GLdouble, GLdouble);
x, y, z | the x, y, and z coordinates of a vector, respectively. |
void cagdScale(GLdouble, GLdouble, GLdouble);
x, y, z | the x, y, and z scale factors respectively. |
void cagdReset();
WORD cagdGetView();
CAGD_ORTHO | orthogonal projection |
CAGD_PERSP | perspective projection |
void cagdSetView(WORD which);
CAGD_ORTHO | orthogonal projection |
CAGD_PERSP | perspective projection |
BOOL cagdGetDepthCue();
void cagdSetDepthCue(BOOL enable);
enable | the depth cue mode enable when true. |
BOOL cagdToObject(int x, int y, CAGD_POINT where[2]);
x, y | the x, y, window coordinates respectively. |
where | the pair of object coordinates. |
BOOL cagdToWindow(CAGD_POINT *where, int *x, int *y);
where | the pointer to object coordinates. |
x, y | the pointers to x, y, window coordinates respectively. |
void cagdSetColor(BYTE r, BYTE g, BYTE b);
r, g, b | the RGB color. |
void cagdGetColor(BYTE *r, BYTE *g, BYTE *b);
r, g, b | the RGB color. |
BOOL cagdSetSegmentColor(UINT id, BYTE r, BYTE g, BYTE b);
id | the segment identificator. |
r, g, b | the RGB color. |
BOOL cagdGetSegmentColor(UINT id, BYTE r*, BYTE g*, BYTE b*);
id | the segment identificator. |
r, g, b | the pointers to RGB color components. |
BOOL cagdShowSegment(UINT id);
id | the segment identificator. |
BOOL cagdHideSegment(UINT id);
id | the segment identificator. |
BOOL cagdIsSegmentVisible(UINT id);
id | the segment identificator. |
BOOL cagdFreeSegment(UINT id);
id | the segment identificator. |
void cagdFreeAllSegments();
UINT cagdGetSegmentType(UINT id)
id | the segment identificator. |
CAGD_SEGMENT_POINT |
CAGD_SEGMENT_TEXT |
CAGD_SEGMENT_POLYLINE |
UINT cagdGetSegmentLength(UINT id);
id | the segment identificator. |
CAGD_SEGMENT_POINT | 1 point |
CAGD_SEGMENT_TEXT | number of characters |
CAGD_SEGMENT_POLYLINE | number of verteces |
BOOL cagdGetSegmentLocation(UINT id, CAGD_POINT *where);
id | the segment identificator. |
where | the array to store location |