|
|
This seems a bit of a stumper to me.
I'm trying to set up a simple class (for testing) that just initializes
directfb. So I have this header file:
class dfbScreen
{
IDirectFB* dfb;
IDirectFBScreen* screen;
IDirectFBFont* font;
....
public:
void openscreen();
void closescreen();
dfbScreen(); ~dfbScreen();
}
Now, of course, the implementation of those need to know the actual
declarations of IDirectFB, IDirectFBFont, and so on. But everything in
DirectFB is done with pointers, so you never actually declare a IDirectFB
value as a value, only as a pointer.
So what do I need to put before "class dfbScreen" such that I can include
just that class header file (without #include <directfb.h>) such that it
compiles, given that directfb.h includes lines like
typedef struct _IDirectFB IDirectFB;
typedef struct _IDirectFBFont IDirectFBFont;
and so on?
If I put "class IDirectFB;" in front, it tells me that's a redeclaration
when I include <directfb.h>. If I don't, it tells me IDirectFB isn't defined.
What I'm doing right now is declaring
struct _IDirectFB; struct _IDirectFBFont; ...
class dfbScreen {
struct _IDirectFB* dfb;
struct _IDirectFBFont* font;
...
}
But that seems wrong, given that I have to grope around in someone else's
headers to pull out private declarations to make it possible to compile a
header that doesn't depend on those declarations.
I tried googling, but I didn't really find any clear answer.
The other choice is to make it into a separate class and add another level
of indirection, but that too seems like a solution to what shouldn't be a
problem?
--
Darren New, San Diego CA, USA (PST)
I ordered stamps from Zazzle that read "Place Stamp Here".
Post a reply to this message
|
|