From 9ac3e6642165d953cb376f3122f7aba69bce301f Mon Sep 17 00:00:00 2001 From: Kyle K Date: Fri, 15 Oct 2010 00:54:02 -0500 Subject: Check OpenGL version, moved some code around, renamed functions --- sdl/gltools.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) (limited to 'sdl/gltools.c') diff --git a/sdl/gltools.c b/sdl/gltools.c index d6c518f..756112b 100644 --- a/sdl/gltools.c +++ b/sdl/gltools.c @@ -2,6 +2,8 @@ * * OpenGL Tools * + * notes: some function modify current color, just fyi + * */ #include "math3d.h" @@ -235,6 +237,25 @@ void gltDrawTriangle(void) glEnd(); } +void gltDrawGround(void) +{ + GLfloat fExtent = 20.0f; + GLfloat fStep = 0.5f; + GLfloat y = -0.4f; + GLfloat iLine; + + glLineWidth(1.0f); + glBegin(GL_LINES); + for (iLine = -fExtent; iLine <= fExtent; iLine += fStep) + { + glVertex3f(iLine, y, fExtent); + glVertex3f(iLine, y, -fExtent); + glVertex3f(fExtent, y, iLine); + glVertex3f(-fExtent, y, iLine); + } + glEnd(); +} + void gltDrawUnitAxes(void) { GLUquadricObj *pObj; /* temporary, used for quadrics */ @@ -345,20 +366,10 @@ void gltDrawTorus(GLfloat majorRadius, GLfloat minorRadius, GLint numMajor, } } -/* this function just specifically draws the jet */ -/* FIXME: needs to accepts parameters of location and lightning */ -void gltDrawJet(int nShadow) +void gltDrawJet(void) { M3DVector3f vNormal; - /* nose cone, set material color, note we only have to set to black - * for the shadow once - */ - if (nShadow == 0) - glColor3ub(128, 128, 128); - else - glColor3ub(0, 0, 0); - /* nose cone, points straight down, set material color */ /* follow few lines use manual approach */ glBegin(GL_TRIANGLES); -- cgit v1.2.3