im newbie to opengl, help plz

This is a discussion on im newbie to opengl, help plz within the C++ Programming forums, part of the General Programming Boards category; 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 ...

  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,075
    Well it would help if you showed up the function definitions because they are by no means standard.
    Sent from my iPad«

  3. #3
    Mad OnionKnight's Avatar
    Join Date
    Jan 2005
    Location
    Umeň, Sweden
    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 08:21 PM.

  4. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,075
    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, 04:25 AM
  2. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 01:34 PM
  3. newbie reading a file..how? plz help
    By iori in forum C Programming
    Replies: 3
    Last Post: 04-09-2003, 04: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, 08:27 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21