00001 #ifndef GraphicsUtilH
00002 #define GraphicsUtilH
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00037
00038
00039 #include "CoreMainHeader.h"
00040 #include "Point.h"
00041 #include "Color.h"
00042
00043
00044
00045 class CSmallString;
00046
00047
00048
00050
00053 class NEMESIS_CORE_PACKAGE CElementColors{
00054 public:
00055 __fastcall CElementColors(void);
00056
00057 void __fastcall SetColor(bool excite,GLenum face=GL_FRONT_AND_BACK) const;
00058
00059 void __fastcall SetTransparency(float transparency);
00060
00061 public:
00062 bool Uniform;
00063
00064 CColor Ambient;
00065 CColor Diffuse;
00066 CColor Specular;
00067 CColor Emission;
00068 int Shininess;
00069
00070 CColor ExciteAmbient;
00071 CColor ExciteDiffuse;
00072 CColor ExciteSpecular;
00073 CColor ExciteEmission;
00074 int ExciteShininess;
00075
00076 CColor Color;
00077 CColor ExciteColor;
00078 };
00079
00080
00081
00083
00086 class NEMESIS_CORE_PACKAGE CSphere{
00087 public:
00088 __fastcall CSphere(void);
00089 __fastcall ~CSphere(void);
00090 void __fastcall Draw(const float radius);
00091 bool __fastcall SetTessellationQuality(const unsigned int quality);
00092 private:
00093 CSimplePoint<float>* Vertices;
00094 unsigned int NumOfVertices;
00095 unsigned int Tessellation;
00096 unsigned int DummyPos;
00097 void __fastcall ComputeVertices(void);
00098 void __fastcall ComputePartition(const CSimplePoint<GLfloat>& v1,const CSimplePoint<GLfloat>& v2,const CSimplePoint<GLfloat>& v3,CSimplePoint<GLfloat> data[],const unsigned int complexity);
00099 };
00100
00101
00102
00104
00107 class NEMESIS_CORE_PACKAGE CHalfSphere{
00108 public:
00109 __fastcall CHalfSphere(void);
00110 __fastcall ~CHalfSphere(void);
00111
00112 void __fastcall Draw(const float radius);
00113 bool __fastcall SetTessellationQuality(const unsigned int quality);
00114 private:
00115 CSimplePoint<float>* Vertices;
00116 unsigned int NumOfVertices;
00117 unsigned int Tessellation;
00118 unsigned int DummyPos;
00119
00120 void __fastcall ComputeVertices(void);
00121 void __fastcall ComputePartition(const CSimplePoint<GLfloat>& v1,const CSimplePoint<GLfloat>& v2,const CSimplePoint<GLfloat>& v3,CSimplePoint<GLfloat> data[],const unsigned int complexity);
00122 };
00123
00124
00125
00127
00130 class NEMESIS_CORE_PACKAGE CCylinder{
00131 public:
00132 __fastcall CCylinder(void);
00133 __fastcall ~CCylinder(void);
00134
00135 void __fastcall Draw(const float radius,const float height);
00136 void __fastcall Draw(const float radius,const float height,const CColor* color1,const CColor* color2);
00137 void __fastcall Draw(const float radius,const float height,const CElementColors* color1,bool excite1,const CElementColors* color2,bool excite2);
00138 void __fastcall Draw(const float radius1,const float radius2,const float height);
00139 bool __fastcall SetTessellationQuality(const unsigned int quality);
00140 private:
00141 CSimplePoint<float>* Vertices;
00142 unsigned int NumOfFaces;
00143 unsigned int Tessellation;
00144
00145 void __fastcall ComputeVertices(void);
00146 };
00147
00148
00149
00151
00154 class NEMESIS_CORE_PACKAGE CArc{
00155 public:
00156 __fastcall CArc(void);
00157 __fastcall ~CArc(void);
00158
00159 void __fastcall Draw(const CSimplePoint<GLfloat>& v1,const CSimplePoint<GLfloat>& v2,const CSimplePoint<GLfloat>& v3,float angle,CSimplePoint<GLfloat>& str);
00160 bool __fastcall SetTessellationQuality(const unsigned int quality);
00161
00162 private:
00163 CSimplePoint<float>* Vertices;
00164 unsigned int NumOfFaces;
00165 unsigned int Tessellation;
00166
00167 void __fastcall ComputeVertices(void);
00168 };
00169
00170
00171
00173
00176 class NEMESIS_CORE_PACKAGE COpenGL2DFont{
00177 public:
00178 __fastcall COpenGL2DFont(void);
00179 __fastcall ~COpenGL2DFont(void);
00180
00181 bool __fastcall CreateFont(TFont* p_font,TWinControl* p_win);
00182 bool __fastcall IsInitialized(void);
00183 bool __fastcall DestroyFont(void);
00184
00185 void __fastcall DrawText(const CSmallString& text);
00186
00187 private:
00188 unsigned int FirstGylph;
00189 unsigned int NumGylph;
00190 unsigned int ListBase;
00191 };
00192
00193
00194
00195 class CObject;
00196
00197 GLenum __fastcall NEMESIS_CORE_PACKAGE GLGetMode(void);
00198 void __fastcall NEMESIS_CORE_PACKAGE GLLoadObject(CObject* object);
00199
00200
00201 #endif