"Function" variables

Started by
1 comment, last by OptimisticHuman 21 years, 9 months ago
Ok, here''s my problem (sorry for my horrible english and wrongful use of terminology I wrote a nice wrapper library for Direct3D8 a while ago, then formatted one of my hard drives, and oh! the horror!, my library huge header file got deleted... and now I don''t remember how I managed to code this : In my wrapper library, I call some custom initialisation function (such as the loading of d3d objects after alt-tabbing, etc...). Here''s what the code looks like: // Wrapper.cpp typedef VOIDPROC // (this is the part I forgot) VOIDPROC LoadD3DObjects; VOIDPROC KillD3DObjects; void MainInit(void) { InitDirect3D(); if(LoadD3DObjects != NULL) Load3D3Objects(); } // Project.cpp void LoadMyAppObjects(void) { LoadSomeStuff(); LoadSomeMore(); } void KillD3DObjects(void) { KillSomeStuff(); KillSomeMore(); } void MainProc(void) { LoadD3DObjects = LoadMyAppObjects(); KillD3DOBjects = KillMyAppObjects(); InitDirect3D(); } I only need to remember how to define my VOIDPROC variable type in order to get my library back on track. Any would be greatly appreciated. Thanks
Advertisement
typedef void (*VOIDPROC)(void);
---visit #directxdev on afternet <- not just for directx, despite the name
Wow, thank you, it is exactly what I was looking for, and I never believed someone would post a solution to my problem so fast!

This topic is closed to new replies.

Advertisement