1 #ifndef ANIMLOADER_HANDLER_H
2 #define ANIMLOADER_HANDLER_H
32 virtual double GetAspect (
int *w,
int *h,
double *pixAspect) = 0;
33 virtual void Evaluate (
double, LWAnimFrameAccess *) = 0;
46 static int Activate(
int version, GlobalFunc *global,
void *l,
void *serverData )
48 if (version > LWANIMLOADER_VERSION)
return AFUNC_BADVERSION;
52 LWAnimLoaderHandler *plugin =
static_cast<LWAnimLoaderHandler *
>(l);
54 plugin->inst->create = AnimLoaderAdaptor::Create;
55 plugin->frameCount = AnimLoaderAdaptor::FrameCount;
56 plugin->frameRate = AnimLoaderAdaptor::FrameRate;
57 plugin->aspect = AnimLoaderAdaptor::Aspect;
58 plugin->evaluate = AnimLoaderAdaptor::Evaluate;
62 catch (std::exception &e)
65 return AFUNC_BADAPP_SILENT;
70 static LWInstance Create (
void *priv,
void *context, LWError *err)
74 LWError localErr =
"\0";
75 T *plugin =
new T(priv, context, &localErr);
82 if (!plugin->isValid())
87 return static_cast<LWInstance
> (plugin);
89 catch (std::exception &e)
91 static LWError error = e.what();
97 static int FrameCount (LWInstance instance)
101 T *plugin = (T *) instance;
102 return plugin->GetFrameCount();
104 catch (std::exception &e)
111 static double FrameRate (LWInstance instance)
115 T *plugin = (T *) instance;
116 return plugin->GetFrameRate();
118 catch (std::exception &e)
125 static double Aspect (LWInstance instance,
int *w,
int *h,
double *pixAspect)
129 T *plugin = (T *) instance;
130 return plugin->GetAspect(w, h, pixAspect);
132 catch (std::exception &e)
139 static void Evaluate (LWInstance instance,
double time, LWAnimFrameAccess *fa)
143 T *plugin = (T *) instance;
144 plugin->Evaluate(time, fa);
146 catch (std::exception &e)
154 #endif // ANIMLOADER_HANDLER_H