Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RoamSphere.cpp

Go to the documentation of this file.
00001 
00002 /*
00003     TSGL - Teddy Space Game Library
00004     Copyright (C) 2002 Timo Suoranta
00005     tksuoran@cc.helsinki.fi
00006 
00007         Adapted from
00008 
00009         The Universe Development Kit
00010         Copyright (C) 2000  Sean O'Neil
00011         s_p_oneil@hotmail.com
00012 
00013     This library is free software; you can redistribute it and/or
00014     modify it under the terms of the GNU Lesser General Public
00015     License as published by the Free Software Foundation; either
00016     version 2.1 of the License, or (at your option) any later version.
00017 
00018     This library is distributed in the hope that it will be useful,
00019     but WITHOUT ANY WARRANTY; without even the implied warranty of
00020     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00021     Lesser General Public License for more details.
00022 
00023     You should have received a copy of the GNU Lesser General Public
00024     License along with this library; if not, write to the Free Software
00025     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026 
00027     $Id: RoamSphere.cpp,v 1.1 2002/01/08 20:47:05 tksuoran Exp $
00028 */
00029 
00030 
00031 #if 0
00032 
00033 #include "config.h"
00034 #include "UniverseDevelopmentKit/CMaster.h"
00035 #include "Teddy/SpaceGame/RoamSphere.h"
00036 using namespace UniverseDevelopmentKit;
00037 
00038 
00039 int roam_triangle_count = 0;
00040 
00041 
00042 namespace Teddy     {
00043 namespace SpaceGame {
00044 
00045 
00046 //void RoamSphere::Draw( C3DBase *pCamera, GLenum nMode ){
00047 /*virtual*/ void RoamSphere::drawElements( Projection *p ){
00048 //void CROAMSphere::Draw(C3DBase *pCamera, bool bTexture)
00049 
00050     BuildIndexList();
00051     int nStart          = 0;
00052     int nSize           = m_nSize;
00053     roam_triangle_count = m_nSize;
00054 
00055 #   if !defined( USE_TINY_GL )
00056 
00057     while(nSize > 60000){
00058         glDrawElements( GL_TRIANGLES, 60000, GL_UNSIGNED_SHORT, &m_nIndex[nStart] );
00059         nSize -= 60000;
00060         nStart += 60000;
00061     }
00062     glDrawElements( GL_TRIANGLES, nSize, GL_UNSIGNED_SHORT, &m_nIndex[nStart] );
00063 
00064 #   else
00065 
00066     glBegin( GL_TRIANGLES );
00067     for( int i=0; i<m_nSize; i++ ){
00068         glNormal3fv( CVertex::Array[ m_nIndex[i] ]->m_vNormal   );
00069         glVertex3fv( CVertex::Array[ m_nIndex[i] ]->m_vPosition );
00070     }
00071     glEnd();
00072 
00073 #   endif
00074 
00075 }
00076 
00077 
00078 };  //  namespace Application
00079 
00080 
00081 #endif 
00082