   Need help
  Hi, I am using Dev C++ and i am trying to compile the simple triangle programm! but it gets errors!i am using the Dev C++ OpenGL Template.and when i try the nehe Triangle tutorialit gets errors.this is the nehe triangle tutorial.*****************************************************************int DrawGLScene(GLvoid){glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);glLoadIdentity();   glTranslatef(-1.5f,0.0f,-6.0f);   glBegin(GL_TRIANGLES);glVertex3f( 0.0f, 1.0f, 0.0f);glVertex3f(-1.0f,-1.0f, 0.0f);glVertex3f( 1.0f,-1.0f, 0.0f);glEnd();********************************************************************Thanks***   TeenProgramer 
  "It gets errors" isn''t going to help us help you if you don''t tell us what those errors are.   "Sneftel is correct, if rather vulgar." --Flarelocke ;  Sorry!  Ok, i only get errors when i make a functionsuch as " int DrawGLScene(GLvoid) { ....} "It gets 13 ErrorsMy errors are somthin like hWnd undefined and Hdc and stuff like that, it also has a problem with the function DrawGLScene(GLvoid)and then it points to the stuff right below the Triangle programmhere is a cut out of the Dev C++ Templatei will highlight the triangle programm****************************************************************// enable OpenGL for the windowEnableOpenGL( hWnd, &hDC, &hRC );// program main loopwhile ( !bQuit ) {// check for messagesif ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) ) {// handle or dispatch messagesif ( msg.message == WM_QUIT ) {bQuit = TRUE;} else {TranslateMessage( &msg );DispatchMessage( &msg );}} else {// OpenGL animation code goes here****************************************************************TRIANGLE PROGRAMM!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!****************************************************************int DrawGLScene(GLvoid) {// Here''s Where We Do All The DrawingglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);// Clear The Screen And The Depth BufferglLoadIdentity();    glTranslatef(-1.5f,0.0f,-6.0f);    glBegin(GL_TRIANGLES);// Drawing Using TrianglesglVertex3f( 0.0f, 1.0f, 0.0f);// TopglVertex3f(-1.0f,-1.0f, 0.0f);// Bottom LeftglVertex3f( 1.0f,-1.0f, 0.0f);// Bottom RightglEnd();  }****************************************************************   }    }// shutdown OpenGLDisableOpenGL( hWnd, hDC, hRC );// destroy the window explicitlyDestroyWindow( hWnd );return msg.wParam;}   TeenProgramer ;  COOOOPY and PAAASTE the ERRRRORS.   "Sneftel is correct, if rather vulgar." --Flarelocke ;  Here are all the Errors! parse error before `{'' `hWnd'' was not declared in this scope `hDC'' was not declared in this scope `hRC'' was not declared in this scope ANSI C++ forbids declaration `DisableOpenGL'' with no type `int DisableOpenGL'' redeclared as different kind of symbol previous declaration of `void DisableOpenGL(HWND__ *, HDC__ *, HGLRC__ *)'' initializer list being treated as compound expression `hWnd'' was not declared in this scope ANSI C++ forbids declaration `DestroyWindow'' with no type `int DestroyWindow'' redeclared as different kind of symbol previous declaration of `BOOL DestroyWindow(HWND__ *)'' parse error before `return'' TeenProgramer ;  Alright. So what the compiler is telling you, is that you''re referring to variables, "hWnd", "hDC", and "hRC", that aren''t defined--or at least aren''t defined in a place where they''re visible to the function. Are you, perhaps, declaring those variables in a different function than the one you''re using them in?   "Sneftel is correct, if rather vulgar." --Flarelocke ;  See, this whole thing (Except the triangle programm) is a template that came with my compiler!so i dont know.i dont think so.oh and when i take away the function and just type whats inside the function it Compiles without errors!but it wont display a triangle! TeenProgramer 