www.pudn.com > MyGame.rar > Bullet.cpp


// Bullet.cpp: implementation of the CBullet class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#include "stdafx.h" 
#include "MyGame.h" 
#include "Bullet.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char THIS_FILE[]=__FILE__; 
#define new DEBUG_NEW 
#endif 
 
////////////////////////////////////////////////////////////////////// 
// Construction/Destruction 
////////////////////////////////////////////////////////////////////// 
 
CBullet::CBullet() 
{ 
	ttl=StdTTL; 
} 
 
CBullet::~CBullet() 
{ 
 
} 
 
int CBullet::Draw() 
{ 
	glPushMatrix(); 
	glDisable(GL_LIGHTING); 
	glTranslate(p); 
	glRotatef(angle,0,0,1); 
	glBegin(GL_LINES); 
	glColor3f(.5, 1, 1); 
	glVertex3f(4.0,0,0); 
	glColor3f((GLfloat)0.,(GLfloat).3,(GLfloat).3); 
	glVertex3f(0.0,0,0); 
	glEnd(); 
	glEnable(GL_LIGHTING); 
	glPopMatrix(); 
	return 1; 
}