As asked for in a comment by Walter here is a piece of code, it's the draw code for the forcefield which is sown in the previous post. The forcefields is a class that has a draw method and this is the code for it.
[code]
void ForceField::draw(float elapsedtime)
{
glEnable(GL_TEXTURE_2D);
glMatrixMode(GL_TEXTURE);
if (m_texturespeed < 1.0f)
{
m_texturespeed += 0.01f;
}
else
{
m_texturespeed = 0.0f;
}
Matrix44 m;
translate(m, m_texturespeed, 0.0f, 0.0f);
glLoadMatrixf(m.transposed().m());
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
TextureManager& tm = TextureManager::getInstance();
tm.activateTexture("..\\Textures\\ForceField.bmp");
//glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_MODULATE);
glDisable(GL_CULL_FACE);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glTranslatef(m_position.x(), m_position.y(), m_position.z());
//translated.writeM();
m_forcefield.draw(elapsedtime);
glPopMatrix();
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
glEnable(GL_CULL_FACE);
}
[\code]
2 comments:
cool, bedankt! (Je [code] tags werken niet ;) )
Dat inline declareren van variabelen blijft em toch de kriebels geven ;)
People should read this.
Post a Comment