#include "eglSetup.h"
#include "callbacks.h"
#include "helloMesh.h"

static GLfixed g_rx, g_ry;

static void drawHello()
{		
		glEnableClientState( GL_VERTEX_ARRAY );
		glVertexPointer( 2, GL_FIXED, 0, helloVertex ); // 2 means (x,y) for one vertex, coord is in float number, stride is 0

		glEnableClientState( GL_COLOR_ARRAY );
		glColorPointer( 4, GL_FIXED, 0,  helloColor); // 4 means (R,G,B, A) for color of one vertex, color is in float number, stride is 0

		glDrawArrays(GL_TRIANGLES, 0, sizeof(helloVertex)/sizeof(GLfixed)/2 );
		
}


void rendering(void)
{
	glEnable(GL_DEPTH_TEST);
	glDepthFunc(GL_LEQUAL);
	
	glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

	glPushMatrix();
        glTranslatex( Float2Fixed(-1.0f), 0, 0 );
	glScalex( Float2Fixed(0.5),Float2Fixed(0.5),Float2Fixed(0.5) );

	glRotatex( g_rx, 1, 0, 0 );
	glRotatex( g_ry, 0, 1, 0 );

	// draw here
	drawHello();

	glPopMatrix();
	swapBuffers();
}

void accelerating(float x, float y, float z)
{
}
