Skip to main content
GameDev.net gamedev.net
🔒 Locked

OpenGL like API

Started by Ganja Man Sep 1, 2001 at 4:40 PM 5 replies 300+ views
Original Post
Ganja Man
Ganja Man
I want to write an OpenGl like API (for gui), how could I use object binding like in SGI API?
Drizzt DoUrden
Drizzt DoUrden
I wouldnt know, and I agree with shining knight. When I realized how hard it is to learn an API i figured "Hey, Ill make my own, and then Ill know it because I made it!" I looked into it and uh.. I decided to learn OpenGL. So unless you have ALOT of time on your hands, and acouple years, around 2- 6, I suggest you just learn OGL or D3D. But, if you do make an API, and its easy to use, I would be interested in using it.

"I''''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''''Urden
------------------------------Put THAT in your smoke and pipe it
TerranFury
TerranFury
If you want to make creating a GUI in OpenGL easier, just write a library that calls OpenGL itself, but has "button," "cursor," "checkbox," and similar classes that handle the low-level details. But don''t try writing an API. You''d be wasting your time.
Ganja Man
Ganja Man
I don''t want to rewrite OpenGL!!! Just a very little utility like glui...
rickquolan
rickquolan
terranfurby is absolutely right.
Prosper/LOADED
Prosper/LOADED
I''m not sure I''ve understood you but let''s give it a try.

Do you mean you want to know how to do something like this ?

bindStuff( myStuff);
doSomething(); // this function will affect "myStuff" but you don''t have to give it as a param.

If it''s what you want, it''s quite easy to do :

  

// My powerful API source file


struct Object
{
int stuff;
};

Object * selectedObject;

void bindObject( Object * o)
{
selectedObject = o;
}

void clear()
{
selectedObject->stuff = 0;
}



If I misunderstood you, I apologize for this useless post.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.