#include <GL/glut.h>
#include <string>
#include <vector>

#include "globale.h"
#include "info.h"

void display(void)
{
	glClear(GL_COLOR_BUFFER_BIT);


	glColor3f(1,1,1);
	glBegin(GL_LINES);
		glVertex2d(LesInfos.xmin, 0);
		glVertex2d(LesInfos.xmax, 0);
		glVertex2d(0, LesInfos.ymin);
		glVertex2d(0, LesInfos.ymax);
	glEnd();

	glColor3f(1,0,0);
	glBegin(GL_LINE_STRIP);
		for (unsigned int i = 0; i < Ordonnees.size(); i++)
			glVertex2d(LesInfos.xmin+i*LesInfos.dx, Ordonnees[i]);
	glEnd();

	glutSwapBuffers();
}


void keyboard(unsigned char, int, int)
{
	exit(0);
}


void reshape(int w, int h)
{
	glViewport(0, 0, w, h);
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glOrtho(LesInfos.xmin, LesInfos.xmax, LesInfos.ymin, LesInfos.ymax, -1, 1);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
}
