Thanks alot!!! I did make a few mistakes coping the code unfortunately those errors didn't change anything. I still have the same amount of errors!!
I was told to put in the glut header file, but that doesn't change anything. this is the modified code. I added return O; then return TRUE, still no change.
To Morgul: Initially all the tutorials I downloaded and the programs I wrote were compiling. After I encountered this errors, all the other projects had the same errors! (However, I didn't try to compile a project without graphics). I included the correct libraries and linked them to the project. Thanks!
Code:
#include <windows.h>
#include <gl\gl.h> // Header file for the OpenGL32 library
#include <gl\glu.h> // Header file for the GLu32 library
#include "aux.h" // Header file for the auxillary library
void display(void)
{
GLdouble eqn[4] = {0.0,1.0,0.0,0.0}; // this arguement points to the 4 coefficients of the plane equation
GLdouble eqn2[4] = {1.0,0.0,0.0,0.0}; // same as above
glClear(GL_COLOR_BUFFER_BIT); // clears color buffer
glColor3f(1.0,1.0,1.0); // sets color to white
glPushMatrix(); // this pushes the current matrix stack down by one, duplicating the current matrix
glTranslatef(0.0,0.0,-5.0); // this moves the current view matrix 5 units deeper into the screen
glClipPlane(GL_CLIP_PLANE0, eqn); // indicates the clipping plane
glEnable(GL_CLIP_PLANE0); // enables clip plane0
glClipPlane(GL_CLIP_PLANE1, eqn2); // indicates the clipping plane
glEnable(GL_CLIP_PLANE1); // enables clip plane1
glRotate(90.0,1.0,0.0,0.0); // rotates object 90 degrees on the X axis (ie it moves up and down away from the viewer)
auxWireSphere(1.0); // draws a wire sphere with a diameter of 1?
glPopMatrix(); // pops the current matrix stack, replace the current matrix with the one below it on the stack
glFlush(); // empties all the buffers causing all issued commands to execute in finite time (as quickly as they're accepted by the actual rendering engine)
}
// closes the display(void) function
void myinit(void)
{
glShadeModel(GL_FLAT); // this selects which type of shading is used (Flat shading selects the computed color of one vertex and assigns it to the entire object)
}
void myReshape(GLsizei w, GLsizei h)
{
glViewport(0,0,w,h); // specifies the affine transformation of x and y(0,0) from normalized device co ords to windows co ords
glMatrixMode(GL_PROJECTION); // specifies which matrix is the current matrix ie the Projection matrix stack
glLoadIdentity(); // replaces the current matrix with the identity matrix
gluPerspective(60.0, (GLfloat) w /(GLfloat) h, 1.0,20.0); // sets up a perspective projection matrix
glMatrixMode(GL_MODELVIEW); // specifies which matrix is the current matrix ie the Modelview matrix stack
}
int main(int argc, char** argv)
{
auxInitDisplayMode(AUX_SINGLE | AUX_RGBA); // tells auxInitWindow to create a RGBA and a single buffered window
auxInitPosition(0,0,500,500); // tells auxInitWindow where to position a window on the screen
auxInitWondow(argv[0]); // opens a window with the characteristics specificied by the two previous commands, the string argv appears in the title window)
myinit(); // calls the myinit() function above
auxReshapeFunc(myReshape); // specifies the function that is called when the window is resized( in this case the myReshape() function), moved or exposed. the arguement is a pointer to a function that expects 2 parameters
auxMainLoop(display); // specifies the function that's called when the window needs to be updated. This function should redraw the objects on the screen
return TRUE;
}
thanks for all the help!!! If you know of any websites or books that will give me assistance with this project I would greatly appreciate it. Have a great day!!!!
Danny