#include "loademo.h"
#include "general.h"

#include "part01.h"

int loading=0;

int LoadTextures()
{
	int Status=1;					// Status Indicator

	Status = loadTGA("maps/present.tga", loading);

	return Status;
}

int Set()
{
	glEnable(GL_TEXTURE_2D);
		
	glMatrixMode(GL_MODELVIEW);
	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);

	BuildFont();

	return 1;
}

int LoadDemo()
{
	if (!LoadTextures())
			return 0;

	Set();

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

	glBindTexture(GL_TEXTURE_2D, loading);
	glColor4f(1.0f,1.0f,1.0f,1.0f);
		glBegin(GL_QUADS);
			glTexCoord2f(0.0f, 0.0f); glVertex3f(-2.0f, -1.5f, -3.6f);
			glTexCoord2f(1.0f, 0.0f); glVertex3f(2.0f, -1.5f, -3.6f);
			glTexCoord2f(1.0f, 1.0f); glVertex3f(2.0f, 1.5f, -3.6f);
			glTexCoord2f(0.0f, 1.0f); glVertex3f(-2.0f, 1.5f, -3.6f);
		glEnd();

	glDisable (GL_TEXTURE_2D);
	glColor3f(1.0f, 1.0f, 1.0f);
	glTranslatef(-0.01f, -0.01f, -0.1f);
	glScalef(0.005f, 0.005f, 1.0f);
	glPrint("Loading... Please Wait");

	SwapBuffers(hDC);

	if (!LoadPart01()) return 0;

	KillFont();

	return 1;
}
