jsbsudha
asked on
Opengl in VC++ win32 console application
I am doing openGL using C++ in VS2005 with GLUT...When I include glut.h I am getting error messgaes like " Not able to include glut.h / could not find glut.h".
Do I want to download and Install glut kit, if it is true where I can dowload?
Give me the step by step instructions for me to use GLUT in my c++ program........
Waiting for the reply.......
My c++ code using opengl with Glut
#include <windows.h> // Header File For Windows
#include<conio.h>
//#include <gl\gl.h> // Header File For The OpenGL32 Library
//#include <gl\glu.h> // Header File For The GLu32 Library
#include <glut.h> // Header File For The Glaux Library
void main()
{
// These are the AUX functions to set up the win dow
glutInitDisplayMode(AUX_SI NGLE | AUX_RGBA);
glutInitPosition(100,100,2 50,250);
glutInitWindow("My first OpenGL Program");
// These are the OpenGL functions that do something in the window
glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BI T);
glFlush();
// Stop and wait for a keypress
cprintf("Press any key to close the Window \n");
getch();
}
Do I want to download and Install glut kit, if it is true where I can dowload?
Give me the step by step instructions for me to use GLUT in my c++ program........
Waiting for the reply.......
My c++ code using opengl with Glut
#include <windows.h> // Header File For Windows
#include<conio.h>
//#include <gl\gl.h> // Header File For The OpenGL32 Library
//#include <gl\glu.h> // Header File For The GLu32 Library
#include <glut.h> // Header File For The Glaux Library
void main()
{
// These are the AUX functions to set up the win dow
glutInitDisplayMode(AUX_SI
glutInitPosition(100,100,2
glutInitWindow("My first OpenGL Program");
// These are the OpenGL functions that do something in the window
glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BI
glFlush();
// Stop and wait for a keypress
cprintf("Press any key to close the Window \n");
getch();
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you very much....
Can you explain the below main function why it takes two arguments...
int main(int argc, char **argv)
{}
Can you explain the below main function why it takes two arguments...
int main(int argc, char **argv)
{}
int main(int argc, char **argv)
{}
here "argc" is the "argument count"
which is the number of (command line) arguments passed to the main function.
these arguments are passed as strings: char** argv represents this list of strings.
argv is an array of strings and argc tells you, how many strings in this array are.
{}
here "argc" is the "argument count"
which is the number of (command line) arguments passed to the main function.
these arguments are passed as strings: char** argv represents this list of strings.
argv is an array of strings and argc tells you, how many strings in this array are.
Make sure that the path where these files reside is present in your project settings. To set that, right-click on your project in the solution view, go to "Configuration Properties", "C/C++|General" and and add the path to the field "Additional Include Directories"