Now you need to be careful, just making it simple may limit is usefulness also.
Let’s take your idea, GLUT does already does make programming a openGL program easy. But there are limits to what you can do with glut objects.
I think if you are looking to make it simple for the programmer, make commands like this:
add_cube(name, size, x, y, z); adds a cube scene
add_triange(name, size, x, y, z); adds a triangle scene
add_textured_cube(name, char texture_name, x, y, z)
example code:
int add_cube( char *name[], int s, int x, int y, int z)
{
int id_tag;
id_tag = add_object(); // our rendering engine would assign a id number.
// We create an object with the id_tag number, tell it to make a cube.
// Now the object cube is added to our que of objects to be rendered.
create_object( id_tag, CUBE, s, x, y, z);
return( id_tag )// return the address of the new object
}
// then you can have calls like this
Object_move( id_tag, x, y, z);
Object_scale( id_tag, s);
// You could also use a name, instead of id tag
// Look something like this:
Object_move( “name”, x, y, z) or
char name[30]; // use variables to store names
Object_move( name, x, y, z)
// How your engine would have a processing routine
Object_engine()
{
if (id_tag_index != 0) Check for objects to process
{
for(i = 0; i < id_tag_index; i++)
{
draw_objects( i ); // draw each object that has been added.
}
Update_display();
}
Hope this gives you an idea…
Originally posted by adityagaddam:
[b]wow! thanks for all your replies guys… I think some of you guys finally understood my stupid and unclear question… but I haven’t gotten what I really need… at least I dont think so. but I will look at all your solutions. I am currently using the workaround of first declaring a new “cube3d” struct and then passing it as a parameter to the function Makecube(cube3d cube);
Thanks again and if someone does come up with something please post it here… otherwise, dont waste your time guys… it is not that important… i just wanted my engine to be as code-free as possible(for the end user… not me of course
)
-Aditya[/b]
[This message has been edited by nexusone (edited 10-02-2002).]
[This message has been edited by nexusone (edited 10-02-2002).]