00001 /* 00002 Copyright (C) 1999 Carsten Winkelholz 00003 00004 Malte Weiß, 29.07.2002: OpenGL fully implemented. 00005 00006 Address: FGAN Forschungsgesellschaft für Angewandte Naturwissenschaften e. V. 00007 Neuenahrer Str. 20 00008 D - 53343 Wachtberg 00009 00010 Email: winkelholz@fgan.de 00011 00012 This program is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU General Public License 00014 as published by the Free Software Foundation; either version 2 00015 of the License, or (at your option) any later version. 00016 00017 This program is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 GNU General Public License for more details. 00021 00022 You should have received a copy of the GNU General Public License 00023 along with this program; if not, write to the Free Software 00024 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00025 */ 00026 00027 00028 #ifndef CYBGLBACKGROUNDC_H 00029 #define CYBGLBACKGROUNDC_H 00030 00031 #include "oaw/ctk/cybbackgroundc.h" 00032 #include "oaw/ctk/vertexc.h" 00033 #include <GL/glut.h> 00034 #include "../oawconfig.h" 00035 00036 OAW_BEGIN_NAMESPACE 00037 00038 // Structure for a background sphere vertex 00039 00040 typedef struct _BgSphereVertex 00041 { 00042 Vector3C n; // Normal 00043 Vector3C p; // Position 00044 double u, v; // Texture Coordinates 00045 SFColor cSky; // Sky color 00046 SFColor cGround; // Ground solor 00047 } BgSphereVertex; 00048 00049 // Class definition 00050 00051 class OAW_DLLMAPPING CybGLBackgroundC : public CybBackgroundC 00052 { 00053 public: 00054 CybGLBackgroundC(CybWorldC*); 00055 CybGLBackgroundC(const CybGLBackgroundC&); 00056 CybGLBackgroundC&operator=(const CybGLBackgroundC&); 00057 virtual ~CybGLBackgroundC(); 00058 00059 00060 virtual void FinishInit(); 00061 void Render(CybChannelC*, long lFlag); 00062 00063 protected: 00064 void Cleanup(); 00065 virtual void PrepareRender(); 00066 00067 protected: 00068 short m_bSphere, m_bCube; 00069 00070 static long m_lPhic; 00071 static long m_lTetac; 00072 00073 // Background box 00074 static StandardVertex m_CubeVertices[24]; 00075 00076 // Background sphere 00077 BgSphereVertex *m_pSphereVertices; 00078 GLuint *m_pSphereIndices; 00079 long m_lNumSphereVertices; 00080 long m_lNumSphereIndices; 00081 }; 00082 00083 OAW_END_NAMESPACE 00084 00085 00086 #endif
1.3-rc2