Screenshots Project Page How-to Download Contact CVS

How to write a "callback" function for OGLCONOSLE

If you don't know what a callback function is you can read about them here. However, it should suffice to say that a callback function is what is used whenever an object / library that you are using provides an interface for you to customize its functionality. When this is achieved using Callback functions, this means that you write a function to replace the default functionality (or absent functionality) of the object / library in question, and then register that functionality with that object / library so that it can invoke it later, thus incorporating that functionality into its own.
As the author of OGLCONSOLE, I don't know what the hell your program does, and so I can't tell OGLCONSOLE what your program does either. Therefore this functionality is absent, and must be defined by you using a Callback function. If you don't understand this, allow me to explain by way of analogy: a web browser can be programmed to understand HTML, but it can't be programmed with all of the internet's content into it automatically, that is the responsibility of each web author who wishes their web page to be viewed in a web browser.
Callback function prototype:
void funcName( OGLCONSOLE_Console console, char *commandString);
Here is an example callback function for OGLCONSOLE. Although this function could just have a few lines changed to work for any other similar interactive console. This function has one command only: the add command.
To see this code in action, click here.