|
-
February 15th, 2010, 07:03 PM
#4
Re: typedef and static libraries
I can't show code for this, but I can give an overview.
There are two main compilations being done - a static library, and an app that is using it.
The define LIB is defined if it is the library being compiled.
In 'bufferobject.h', I'd have:
#ifndef LIB
# ifdef D3D
typedef BufferObject_D3D BufferObject;
# ...
# endif
#endif
As you can see, I am making it so ALL abstract version (BufferObject_D3D, BufferObject_GL, etc) are being compiled in to the library, and I am statically defining which it is by a typedef in the engine. Both classes have the same interface.
I am thinking that the only way I can solve this is to have functions that use this type to be in header form so they get reformed by the application? I am trying to avoid having to use an object factory for this abstract code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|