Another beginner

Been trying to learn C++ and Opengl at the same time for the past month.
What am I missing in my code?

(I know I may be missing a header file or two, but which one/s?)

#ifdef_FLAT_
#include <windows.h>
#include <GL/glut.h>

//Initialize and create OpenGL Window
int main (argc, char** argv)
{
glInit (&arge, argv);
glInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glInitWindowSize (400, 100);
glInitWindowPosition (100, 100);
glCreateWindow (“First openGL Window”);

int() ;
glDisplayFunc (display) ;

gl MainLoop () ;

return (0) ;

}

//Set color(white) and shade mode(flat or smooth)
void init(void);
{
glClearColor (1.0, 1.0, 1.0, 0.0);
glShadeMode(GL_FLAT);
}

Did I miss glBegin declaration or something?
Thanks for any help, fell free to rip it apart. Been working off of a tutorial on the 'net.

Originally posted by omac:
(I know I may be missing a header file or two, but which one/s?)

Yes. I think you are missing <gl/gl.h> and <gl/glu.h> Warnings about declaration functions without prototype are clues to find wich headers you must include.

Hi. Your using glut, so the functions in main() need to start with glut, not gl. You also need to include gl.h for the gl functions.
int() i assume is meant to be init(). gl MainLoop() should be glutMainLoop().

Old GLman.

I need to correct the other post, if you are using GLUT.H, you do not have to include gl.h or glu.h

If this is your complete program, there are a few things that are not correct. I will point them out.

Also when you are getting error’s it is helpfull for you to write them down and post them. Just saying you have an error leaves us in the dark…
Also if you are using a another program as a model for your program, it would be good for you to list the web site in which you got the example and file name.

A good website for you to look at is nehe.gamedev.net he has a lot of examples of programming opengl with C.

Originally posted by omac:
[b]Been trying to learn C++ and Opengl at the same time for the past month.
What am I missing in my code?

(I know I may be missing a header file or two, but which one/s?)

#ifdef_FLAT_ REMOVE THIS LINE
#include <windows.h>
#include <GL/glut.h>

//Initialize and create OpenGL Window
int main (argc, char** argv)
{
glInit (&arge, argv);
glInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glInitWindowSize (400, 100);
glInitWindowPosition (100, 100);
glCreateWindow (“First openGL Window”);

int() ;
glDisplayFunc (display) ;
gl MainLoop () ; There should be no space between glMainLoop
return (0) ;

}

//Set color(white) and shade mode(flat or smooth)
void init(void);
{
glClearColor (1.0, 1.0, 1.0, 0.0);
glShadeMode(GL_FLAT);
}

Did I miss glBegin declaration or something?
Thanks for any help, fell free to rip it apart. Been working off of a tutorial on the 'net.[/b]

[This message has been edited by nexusone (edited 03-28-2002).]

[This message has been edited by nexusone (edited 03-28-2002).]

Why don’t you try looking at one of the beginning tutorials at http://nehe.gamedev.net

I have been using them for the last month or two to learn about OpenGL.

Most of the tutorials are originally written directly to Windows but there are usually ports to glut which seems much easier for someone just starting out (like myself).

Good luck,
jpummill

[This message has been edited by jpummill (edited 03-28-2002).]

[This message has been edited by jpummill (edited 03-28-2002).]