Tue, 09/20/2011 - 23:28
Forums:
Hi all,
As I didn't found a solution, I made a small patch that allows to statically link OpenCascade, including the TKOpenGL stuff.
It's enough to modify Graphic3d_GraphicDevice.cxx file as :
extern "C"
{
Handle(Graphic3d_GraphicDriver) MetaGraphicDriverFactory(const Standard_CString AShrName);
}
void Graphic3d_GraphicDevice::SetGraphicDriver ()
{
Handle(Graphic3d_GraphicDriver)(*fp) (Standard_CString) = NULL;
fp = (Handle(Graphic3d_GraphicDriver)(*) (Standard_CString)) MetaGraphicDriverFactory;
Standard_CString aSharedName = "something";
MyGraphicDriver = (*fp)(aSharedName);
}
of course, it would be possible to check if statically built or not and choose between old and
new code.
Ciao
Max
Tue, 09/20/2011 - 23:38
Or, even *much* simpler......
extern "C"
{
Handle(Graphic3d_GraphicDriver) MetaGraphicDriverFactory(const Standard_CString AShrName);
}
void Graphic3d_GraphicDevice::SetGraphicDriver ()
{
MyGraphicDriver = MetaGraphicDriverFactory("");
}
Just an one-line patch :-)
Ciao
Max
Wed, 05/15/2013 - 19:45
It's very nice.I'll try.