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.
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
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:
- you have written the main CPP part in your workspace already (i guess you know how that works).
- you go to insert -> files -> new -> headerfile
and give the headerfile a name… example.h
- 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
- create a class, for example a class cube.
// private variables or functions
// global stuff… for example
- Now you need to “fill” the function:
glBegin … //your code
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)
8. call the function:
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!!