here be the code
#include <gl/glut.h>
void changesize(GLsizei w, GLsizei h)
{
GLfloat nRange = 100.0f;
if(h==0)
h=1;
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if(w <= h)
glOrtho (-nRange, nRange, -nRange*h/w, nRange*h/w, -nRange, nRange);
else
glOrtho (-nRange*w/h, nRange*w/h, -nRange, nRange, -nRange, nRange);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
glBegin(GL_POINTS);
glVertex3f(0.0f, 0.0f, 0.0f);
glvertex3f(50.0f, 50.0f, 50.0f);
glEnd();
glBegin(GL_POINTS);
glvertex3f(0.0f, 0.0f, 0.0f);
glEnd();
glBegin(GL_POINTS);
glvertex3f(50.0f, 50.0f, 50.0f);
glEnd();
#define GL_PI 3.1415f
void SetupRC()
{
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glColor3f(0.0f, 1.0f, 0.0f);
}
void RenderScene(void)
{
GLfloat x, y, z, angle;
glClear(GL_COLOR_BUFFER_BIT);
glPushMatrix();
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
glRotatef(yRot, 0.0f, 1.0f, 0.0f);
glBegin(GL_POINTS);
z = -50.0f;
for(angle = 0.0f; angle <= (2.0f * GL_PI) * 3.0f; angle += 0.1f)
{
x = 50.0f * sin(angle);
y = 50.0f * cos(angle);
glVertex3f(x, y, z);
z += 0.5f;
}
glEnd();
glPopMatrix();
glFlush();
}
it makes a spiral and for some reason it doesnt work it gives errors like these when i compile it
21 C:\Dev-Cpp\spiral.cpp expected constructor, destructor, or type conversion before ‘(’ token
21 C:\Dev-Cpp\spiral.cpp expected ,' or
;’ before ‘(’ token
can anyone help please
thanks in advance
tralfas