Callback Functions And Directx

Created by Jijith Nadumuri at 28 Apr 2010 12:05 and updated at 28 Apr 2010 12:44

Callback Functions

A callback-function is essentially an event-handler that is implemented by an application and called by the system. Microsoft Windows applications typically implement multiple callback functions, each one designed for a particular set of events. When an event occurs, the system notifies the application by calling the appropriate callback function. The callback function also usually has a parameter list that the system can use to pass the application more detailed information about the event. The most common example of a callback function is the window-procedure. This function is used by the system to pass Windows messages to the applications that owns the window.

Microsoft DirectX uses callback functions for a variety of purposes. You should declare the function as CALLBACK or WINAPI type to make it a callback function. Either type is acceptable. You can use any function name that you wish. The implementation details will depend on the particular function and the requirements of your application. Then you supply a function-pointer of the callback function, to the appropriate Microsoft DirectX component. The DirectX component can then use the function pointer to call the function, when required.

Share:- Facebook

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License