
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "SDL.h"

#define SCREEN_BPP	16			/* bitdepth of colors */
#define TRUE 1
#define FALSE 0

void DrawMyStuff() {			/* The Drawing Routine */
	double x,y;
	glColor3f(1.0, 1.0, 0.0);	/* Set drawing color to yellow */
	glBegin(GL_POINTS);			/* Start drawing POINTS */
	for (x = -1; x <= 1; x += .001) {	/* Step from -1 to +1 by 0.001 */
		y = 4*x - 4*x*x;		/* Calculate y value of parabola */
		glVertex3f(x, y, 0.0);	/* Plot point at (x,y) z=0 in 2D */
	}
	glEnd();					/* End drawing points */
} 

void myinit(void) {				/* select clearing (background) color */
	SDL_WM_SetCaption("My Window", NULL);
		/* Set window caption and icon caption, respectively */
	glClearColor(0.5, 0.5, 0.5, 0.0);	/* These RGB values make gray */

	/* initialize viewing values */
	glMatrixMode(GL_PROJECTION);	/* Select Matrix Mode */
	glLoadIdentity();			/* Provide Base Matrix */
	glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);	/* Set window dimensions */
	/* Parameters:  glOrtho(Left, Right, Bottom, Top, Front, Back) */
}

void KeyPressed(SDL_keysym *keysym) {
	switch (keysym->sym) {		/* which key is it? */
		case SDLK_F1:			/* F1 */
			ToggleFullScreen();	/* Toggle fullscreen/windowed mode */
			break;
		case SDLK_ESCAPE:		/* if it is ESC */
			Quit(0);
			break;
		default:
			break;
	}
}



