Talk:OpenGL Programming/Basics/Structure

compile problems creating a window
at glutInit(&argc, &argv[0]);  got 'glutInit_ATEXIT_HA--~CK' : cannot convert parameter 2 from 'char *const *' to 'char **' microsoft visual studio 2005 express edition, windows server 2003 SDK R2 using glut http://www.opengl.org/resources/libraries/glut/glut_downloads.php#windows Eadthem (talk) 04:09, 3 August 2009 (UTC)


 * found the problem

My First OpenGL Program shows this int main(int argc, char * const argv[]) Creating a Window shows this int main(int argc, char *argv[]) perhaps this shuld be corrected?

and now i get GLUT: Warning in opengl: The following is a new check for GLUT 3.0; update your code. GLUT: Fatal Error in opengl: redisplay needed for window 1, but no display callback.

found the problem a glutDisplayFunc(RenderScene);  or equivelnt is required void RenderScene { } aprently whatever function is passed is not requierd to have anything inside it. (talk) 04:30, 3 August 2009 (UTC)

Hello
this is a really good starting point. Thanks for sharing. Maybe I'm wrong but, shouldn't be
 * 1) ifndef WIN32
 * 1) ifdef WIN32

Also I was trying to compile this on CentOs and I didn't see conio.h. Maybe it's non-standard header. I've commented it out and window did not close immediatelly. Isn't call of glutMainLoop enough to prevent window from closing?

Corrections
As previously stated, the #ifndef WIN32 that actually defines WIN32 related stuff should be replaced by #ifdef. Also, there is no need for a getch since glutMainLoop doesn't return unless an event, message or command requires it (at least on Win32). Tested using VS2008 on Console subsystem. Feel free to revert if this has any impact I did not forsee on another architecture. TheSpooler (talk) 03:45, 25 July 2010 (UTC)