00001 00012 /*************************************************************************** 00013 * Copyright (C) 2007 by Jan Koci * 00014 * honza.koci@email.cz * 00015 * http://kengine.sourceforge.net/tutorial/ 00016 * * 00017 * This program is free software; you can redistribute it and/or modify * 00018 * it under the terms of the GNU General Public License as published by * 00019 * the Free Software Foundation; either version 2 of the License, or * 00020 * (at your option) any later version. * 00021 * * 00022 * This program is distributed in the hope that it will be useful, * 00023 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00024 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00025 * GNU General Public License for more details. * 00026 * * 00027 * You should have received a copy of the GNU General Public License * 00028 * along with this program; if not, write to the * 00029 * Free Software Foundation, Inc., * 00030 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00031 ***************************************************************************/ 00032 00033 #include "K3dDrawVertex.h" 00034 00036 void K3dDrawVertex::DrawVertices() 00037 { 00038 for(int i=0; i<m_pGameData->GetVertexObjSP().GetNum(); i++) 00039 { 00040 // Get vertex 00041 K3dVertexObj *pVertex = m_pGameData->GetVertexObjSP().Get(i); 00042 if(pVertex->GetIsVisible() == true) 00043 { 00044 glDisable(GL_TEXTURE_2D); 00045 glColor4ubv(pVertex->GetColor()->GetColorArray()); 00046 glPointSize(pVertex->GetSize()); 00047 // Enable blending 00048 glEnable(GL_BLEND); 00049 // Set blend function 00050 glBlendFunc(GL_ONE, GL_ONE); 00051 glPushMatrix(); 00052 glBegin( GL_POINTS ); 00053 glVertex3f((GLfloat) pVertex->GetPosition()->GetX(), (GLfloat) pVertex->GetPosition()->GetY(), (GLfloat) pVertex->GetPosition()->GetZ()); 00054 glEnd(); 00055 glPopMatrix(); 00056 // Disable blending 00057 glDisable(GL_BLEND); 00058 // Set default white color 00059 glColor3ub( 255, 255, 255 ); 00060 glEnable(GL_TEXTURE_2D); // Enable texturing*/ 00061 } 00062 } 00063 }