Example #1
0
// Draw the splash screen and menu.
void MainMenu::Draw()
{
	if (splashState)
	{
		RENDER(getTexture(splashTexture), 0, TEXTURE_HEIGHT(getTexture(splashTexture)), TEXTURE_WIDTH(getTexture(splashTexture)), TEXTURE_HEIGHT(getTexture(splashTexture)), 0, false);

		DRAW_TEXT(getTexture(fontMap), SPLASH_TEXT, 100, 100, 16, 16, 0, 0, WHITE);
	}
	else if (exiting)
	{
		RENDER(getTexture(splashTexture), 0, TEXTURE_HEIGHT(getTexture(splashTexture)), TEXTURE_WIDTH(getTexture(splashTexture)), TEXTURE_HEIGHT(getTexture(splashTexture)), 0, false);

		DRAW_TEXT(getTexture(fontMap), EXIT_TEXT, 50, 300, 16, 16, 0, 0, WHITE);
	}
	else
	{
		RENDER(getTexture(splashTexture), 0, TEXTURE_HEIGHT(getTexture(splashTexture)), TEXTURE_WIDTH(getTexture(splashTexture)), TEXTURE_HEIGHT(getTexture(splashTexture)), 0, false);

		DRAW_TEXT(getTexture(fontMap), MAINMENU_OPTION_ONE, 40, 100, 16, 16, 0, 0, WHITE);

		DRAW_TEXT(getTexture(fontMap), MAINMENU_OPTION_TWO, 60, 80, 16, 16, 0, 0, WHITE);

		DRAW_TEXT(getTexture(fontMap), hScoreStream.str().c_str(), 30, 30, 16, 16, 0, 0, WHITE);

		switch (getCurrentSelection())
		{
		case 0:
			RENDER(getTexture(selectedTexture), 20, 100, 20, 20, 0, 0);
			break;
		case 1:
			RENDER(getTexture(selectedTexture), 40, 80, 20, 20, 0, 0);
			break;
		}
	}
}
Example #2
0
void SceneRenderer::Render( const Terrain* terrain )
{
	WORD color;
	size_t ch;

	switch(terrain->Type())
	{
	case Terrain::Ice:
		color = FOREGROUND_BLUE;
		ch = 176;
		break;

	case Terrain::Rock:
		color = 0;
		ch = 219;
		break;

	case Terrain::Grass:
		color = FOREGROUND_GREEN;
		ch = 5;
		break;
	}

	RENDER(terrain, ch, color );
}
Example #3
0
void RenderFrustum::Render(){
    glColor4f(color[0], color[1], color[2], 1.0f);
    glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

#define RENDER(vert) glVertex3f(vert[0],vert[1],vert[2]);

    glBegin(GL_LINE_STRIP);
        RENDER(frustum.hitherTopLeft);
        RENDER(frustum.hitherTopRight);
        RENDER(frustum.hitherBottomRight);
        RENDER(frustum.hitherBottomLeft);
        RENDER(frustum.hitherTopLeft);
        RENDER(frustum.fartherTopLeft);
        RENDER(frustum.fartherTopRight);
        RENDER(frustum.hitherTopRight);
        RENDER(frustum.hitherBottomRight);
        RENDER(frustum.fartherBottomRight);
        RENDER(frustum.fartherBottomLeft);
        RENDER(frustum.hitherBottomLeft);
    glEnd();
};
Example #4
0
void SceneRenderer::Render( const Mine* mine )
{
	RENDER(mine, 15, FOREGROUND_RED );
}
Example #5
0
void SceneRenderer::Render( const Bullet* bullet )
{
	RENDER(bullet, 42, FOREGROUND_BLUE| FOREGROUND_RED );
}
Example #6
0
void SceneRenderer::Render( const Tank* tank )
{
	RENDER(tank, 2, FOREGROUND_GREEN );
}