Results 1 to 3 of 3

Thread: how to get started with header files

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2002
    Location
    NIGERIA
    Posts
    1

    how to get started with header files

    i have been trying my program but it has been given me wrong header file in my C++ program pls try to tell me or send me a code that can do a 2D and 3D graphics of drawing a box using windows ME operating system.

  2. #2
    Junior Member Newbie
    Join Date
    Mar 2002
    Location
    Little Rock, AR,
    Posts
    7

    Re: how to get started with header files

    would like to help with you question but i need more information on your question like what are you asking. Like do you not know how to set up the OpenGl headers or do you need to use it with Windows if thats the case you use wglfunctions are is this a higher lvl question

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2002
    Location
    Bangkok/Thailand
    Posts
    23

    Re: how to get started with header files

    hi suen!
    Do you mean that you create your own headerfiles, right? In which you write the constructions for a cube.. and then include this in your mainpart to call the classes and functions from that header right?

    I am no expert about that at all, but in MSVC++6.0 it's working like this:
    1. you have written the main CPP part in your workspace already (i guess you know how that works).
    2. you go to insert -> files -> new -> headerfile
    and give the headerfile a name... example.h
    3. you open this file now and include some important headers from openGL and windows.. such as: #include <windows.h> #include <gl/opengl.h> or something like that
    4. create a class, for example a class cube.
    class cube:
    {
    private:
    // private variables or functions
    global:
    // global stuff.. for example
    void drawCube();
    };
    5. Now you need to "fill" the function:
    cube::drawCube(void)
    {
    glBegin .... //your code

    return 0;
    }:
    6. Now go back to your mainpart and include the headerfile there as well which would look like #include "example.h"
    7. Make a handle (i hope thats not the wrong word)
    cube CUBE;
    8. call the function:
    CUBE.drawcube();

    So.. that's it.. sure you might make some more improvements.. like return variabled and so on. But thats the basic idea. SORRY if i made some mistakes!!
    Fabian

Similar Threads

  1. Header files
    By xoquoxxotil in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-11-2006, 03:06 AM
  2. where can i get the header files?
    By xoquoxxotil in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 08-31-2006, 09:10 PM
  3. open Gl 1.2 header files and lib files for Windows 2000
    By nes in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-20-2000, 09:55 PM
  4. open Gl 1.2 header files and lib files for Windows 2000
    By nes in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 10-20-2000, 10:57 AM
  5. OGL 1.2 header files
    By Peter in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-27-2000, 12:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean