📄 dlldef.h
字号:
#ifndef _DLL_DEF_H__
#define _DLL_DEF_H__
//#define
// This class is exported from the GLDLL.dll
#include "GL/gl.h"
#include "GL/glu.h"
#include "GL/glaux.h"
#include "GL/glut.h"
#define VIEWMODE1 0
#define VIEWMODE2 1
#define VIEWMODE3 2
#define KeyRS 0
#define KeyUP 1
#define KeyDOWN 2
#define KeyLEFT 3
#define KeyRIGHT 4
#define X_DIRECTION 0
#define Y_DIRECTION 1
#define F_FONT 1
#define S_FONT 2
#define H_FONT 3
#define K_FONT 4
#define HZ_SIZE_16 16
#define HZ_SIZE_24 24
#define FCENTER 1
#define FLEFT 2
#define FRIGHT 3
#define FTOP 4
#define FBOTTOM 5
#ifdef _cplusplus
extern "C"
{
#endif
int InitGLWnd (HDC hdc,int viewmode,int width,int height,float angle,int scene);
int InitGLWnd1 (HDC hdc,int scene);
int InitGLWnd2 (int viewmode,int width,int height,float angle,int scene);
int DeInitWnd(int scene);
int Set2DTexture(char *texturefile);
void SetPointWidth(float width);
void SetLineWidth(float width);
int BeginGL(HDC hdc,int scene);
int EndGL(HDC hdc);
void EnableLight();
void DisableLight();
void BeginTranslate(float x,float y,float z);
void EndTranslateOrRotate();
// to add here
typedef struct VECTOR
{
GLfloat x;
GLfloat y;
GLfloat z;
}VECTOR;
typedef struct POINT3F
{
GLfloat x;
GLfloat y;
GLfloat z;
}POINT3F;
typedef struct RGB
{
GLubyte r;
GLubyte g;
GLubyte b;
}RGB;
typedef struct DIRECT
{
GLfloat alpha;
GLfloat beta;
}DIRECT;
typedef struct STRING
{
unsigned char *buffer;
int width;
int height;
}STRING;
void LoadHZCharacter24(int font, STRING *buffer, char *string);
void LoadHZCharacter16(STRING *buffer, char *string);
int SetAngle1(float angle,VECTOR vector);
int SetAngle2(float angle,VECTOR vector);
float GetAngle1();
float GetAngle2();
AUX_RGBImageRec *LoadBMPImage(char *filename);
int InitAngle();
int BeginDraw(POINT3F p, DIRECT direction, float Sita);
int DrawBMPFile(float x, float y, float z, AUX_RGBImageRec *BmpImage);
int DrawHZCharacter(float x, float y, float z, int h_align_mode, int v_align_mode,
STRING buffer, RGB color);
int DrawBitmapCharacter(float x, float y, float z, void *font, char *string, RGB color);
int DrawLine(POINT3F p1, POINT3F p2, RGB color);
int DrawColorLine(POINT3F p1, POINT3F p2, RGB color1, RGB color2);
int DrawColorPolygon(POINT3F *p, int pointnum, RGB *color);
int DrawCurve(POINT3F *p, int pointnum, RGB color);
int DrawCircle(POINT3F p,DIRECT direction,float Radius,RGB color,int slices);
int DrawColorCurve(POINT3F *p, int pointnum, RGB *color);
int DrawBall(float radius,RGB color,GLubyte alpha,int slices,int stacks,int style,bool TEXTURE);
int DrawBalls(POINT3F *p,int ballnum,float radius,RGB color);
int DrawCylinder(float baseRadius,float topRadius, RGB color,GLubyte alpha,
float height,float slices,int stacks,int style,bool TEXTURE);
int DrawDisk(float innerRadius,float outerRadius,RGB color ,
GLubyte alpha,float slices,int loops,int style,bool TEXTURE);
int DrawTriange(POINT3F p1,RGB color1,POINT3F p2,RGB color2,POINT3F p3,RGB color3,int alpha);
int DrawQuads(POINT3F p1,POINT3F p2,POINT3F p3,POINT3F p4,RGB color,int alpha);
int DrawSurface(POINT3F *p,int maxi,int maxj,RGB color);
int DrawSurface1(POINT3F *p, int maxsita, int maxr, RGB color, BOOL option_sita, int option_r);
int DrawColorSurface(POINT3F *p,int maxi,int maxj,RGB *color,GLubyte alpha);
int DrawPoints(POINT3F *p,int pointnum,RGB *color);
int EndDraw();
int CDrawHZCharacter(float x, float y, float z, int h_align_mode, int v_align_mode,
STRING buffer, RGB color);
int CDrawBitmapCharacter(float x, float y, float z, void *font, char *string, RGB color);
int CDrawStrokeCharacter(float x, float y, float z, void *font, char *string, RGB color, float size);
int CDrawLine(POINT3F p1, POINT3F p2, RGB color);
int CDrawColorLine(POINT3F p1, POINT3F p2, RGB color1, RGB color2);
int CDrawColorPolygon(POINT3F *p, int pointnum, RGB *color);
int CDrawCurve(POINT3F *p, int pointnum, RGB color);
int CDrawColorCurve(POINT3F *p, int pointnum, RGB *color);
int CDrawBall(POINT3F p,DIRECT angle,float angle_Sita,float radius,RGB color,GLubyte alpha,int slices,int stacks,int style,bool TEXTURE);
int CDrawBalls(POINT3F *p,int ballnum,float radius,RGB color);
int CDrawTriange(POINT3F p1,RGB color1,POINT3F p2,RGB color2,POINT3F p3,RGB color3);
int CDrawQuads(POINT3F p1,POINT3F p2,POINT3F p3,POINT3F p4,RGB color,int alpha);
int CDrawSurface(POINT3F *p,int maxi,int maxj,RGB color);
int CDrawSurface1(POINT3F *p, int maxsita, int maxr, RGB color, BOOL option_sita, int option_r);
int CDrawColorSurface(POINT3F *p,int maxi,int maxj,RGB *color,GLubyte alpha);
int CDrawNetSurface(POINT3F *p,int maxi,int maxj,RGB FillColor,RGB color);
int CDrawWireSurface(POINT3F *p,int maxi,int maxj,RGB FillColor,RGB color,int option);
int CDrawRSCurface(POINT3F p, DIRECT direction, float *x, float *z, int pointnum, int slices, RGB color);
int CDrawPoints(POINT3F *p, int pointnum, RGB *color);
int CDrawBMPFile(float x, float y, float z, AUX_RGBImageRec *BmpImage);
int PDrawSpin(POINT3F p,DIRECT direction,float sita,float Radius,float height,
RGB color,GLubyte alpha,bool TEXTURE);
int PDrawDisk(POINT3F p,DIRECT direction,float sita,float Radius,float height,
RGB color,GLubyte alpha,bool TEXTURE);
int PDrawSpring(POINT3F p1,POINT3F p2,float h1,float h2,float sita,float Radius,float num, RGB color,float width,int slices);
int PDrawWireSpring(POINT3F startpoint, POINT3F endpoint, float h1, float h2, float sita, float Radius, float num, RGB color,
int slices);
int PDrawArrow(POINT3F start_point, POINT3F end_point, float ArrowLong, float ArrowWidth, RGB color);
int PDrawArrow1(POINT3F start_point,DIRECT direction,float Height,float ArrowLong,float ArrowWidth,RGB color);
int PDrawArrow2(POINT3F start_point,POINT3F end_point,float ArrowLong,float ArrowWidth,RGB color);
int PDrawPipe(POINT3F *p, int pointnum, float radius, RGB color);
int PDrawCylinder(POINT3F p, DIRECT direction, float baseRadius,float topRadius, RGB color,GLubyte alpha,
float height,float slices,int stacks,int style,bool TEXTURE);
int PDrawRing(POINT3F centerpos, DIRECT direction, float radius, float width, int slices, int rings, RGB color, int style);
int PDrawCoil(POINT3F startpoint, POINT3F endpoint, float sita, float radius, int num,
RGB color, float width, int slices); // 螺线管
int PDrawWireCoil(POINT3F startpoint, POINT3F endpoint, float sita, float radius, int num,
RGB color, int slices);
int PDrawTetrahedron(POINT3F centerpos, DIRECT direction, float sita, float size,
RGB color, int style); // 四面体
int PDrawOctahedron(POINT3F centerpos, DIRECT direction, float sita, float size,
RGB color, int style); // 八面体
int PDrawDodecahedron(POINT3F centerpos, DIRECT direction, float sita, float size,
RGB color, int style); // 十二面体
int PDrawIcosahedron(POINT3F centerpos, DIRECT direction, float sita, float size,
RGB color, int style); // 画二十面体
int PDrawCube(POINT3F centerpos, DIRECT direction, float sita, GLdouble size, RGB color, int style);
int PDrawGear(POINT3F centerpos, DIRECT direction, float sita, GLfloat inner_radius, GLfloat outer_radius, GLfloat width,
GLint teeth, GLfloat tooth_depth, RGB color);
int PDrawTeaPot(POINT3F centerpos, DIRECT direction, float sita, GLdouble size, RGB color, int style);
int MDrawArc(POINT3F p, DIRECT direction, float Radius, RGB color, int slices,
float StartAngle, float EndAngle);
// 画圆弧
int MDrawCircle(POINT3F p,DIRECT direction,float Radius,RGB color,int slices);
// 画圆
int MDrawEllipse(POINT3F p, DIRECT direction, float sita, float a, float b, int slices, RGB color);
// 画椭圆
int totalbyte(char *string,int fontsize);
#ifdef _cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -