Thread: im newbie to opengl, help plz

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    9

    im newbie to opengl, help plz

    I've been reading some tutorials on a tutorial website for opengl and on the first tutorial : http://fly.srk.fer.hr/~unreal/theredbook/chapter01.html

    shows the user how to create a window and polygon, could some1 plz tell me how the fix this code? I get errors on "OpenAWindowPlease();" and "KeepTheWindowOnTheScreenForAWhile();"

    Code:
    #include <gl.h>
    #include <glext.h>
    #include <glu.h>
    
    main() {
    
       OpenAWindowPlease();
    
       glClearColor(0.0, 0.0, 0.0, 0.0);
       glClear(GL_COLOR_BUFFER_BIT);
       glColor3f(1.0, 1.0, 1.0);
       glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); 
       glBegin(GL_POLYGON);
          glVertex2f(-0.5, -0.5);
          glVertex2f(-0.5, 0.5);
          glVertex2f(0.5, 0.5);
          glVertex2f(0.5, -0.5);
       glEnd();
       glFlush();
    
       KeepTheWindowOnTheScreenForAWhile();
    }

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Well it would help if you showed up the function definitions because they are by no means standard.
    Sent from my iPadŽ

  3. #3
    Registered User OnionKnight's Avatar
    Join Date
    Jan 2005
    Posts
    555
    Quote Originally Posted by SlyMaelstrom
    Well it would help if you showed up the function definitions because they are by no means standard.
    It would've been awesome if they were though

    [edit]
    You should've read a little further. Those lines were just pseudocode. The real example is a bit further down:
    Code:
    #include <GL/gl.h>
    #include "aux.h"
    
    int main(int argc, char** argv)
    {
        auxInitDisplayMode (AUX_SINGLE | AUX_RGBA);
        auxInitPosition (0, 0, 500, 500);
        auxInitWindow (argv[0]);
    
        glClearColor (0.0, 0.0, 0.0, 0.0);
        glClear(GL_COLOR_BUFFER_BIT);
        glColor3f(1.0, 1.0, 1.0);
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity();
        glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
        glBegin(GL_POLYGON);
                glVertex2f(-0.5, -0.5);
                glVertex2f(-0.5, 0.5);
                glVertex2f(0.5, 0.5);
                glVertex2f(0.5, -0.5);
        glEnd();
        glFlush();
    
        sleep(10);
    }
    Last edited by OnionKnight; 05-14-2006 at 07:21 PM.

  4. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Code:
    int main() {
       createthebestgameeverplease();
    
       return 0;
    }
    Sent from my iPadŽ

  5. #5
    1479
    Join Date
    Aug 2003
    Posts
    253
    Haha, thats some great stuff. Don't get discouraged at the ammount of work you actually have to do. The cool thing about being new to ogl is that you basically just have to learn what a function does and how to manipulate it.......putting it where it should go is the fun part.

    Code:
    int main(){
    
    correctmeifIamwrongIamanOGLnewbto();
    return (corrections);
    };
    Knowledge is power and I want it all

    -0RealityFusion0-

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie needs help plz
    By boffinson in forum C++ Programming
    Replies: 22
    Last Post: 07-29-2006, 03:25 AM
  2. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  3. newbie reading a file..how? plz help
    By iori in forum C Programming
    Replies: 3
    Last Post: 04-09-2003, 03:58 PM
  4. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 07:57 PM
  5. HI .. newbie to the board... need some help plz
    By Arwen27 in forum C Programming
    Replies: 3
    Last Post: 04-28-2002, 07:27 AM