Beispiel #1
0
int main(){

  Foo foo;

  std::cout << foo.lol() << std::endl;

  globalFunc();

  stats();
  return 0;
}
void LWPRender::freeCallBacks()
{
	LWPPlugin::freeCallBacks();

	if (systemIsModeler) return;	// don't try freeing render-specifics in Modeler

	if (-- callBackUsers) return;	// still need them

	globalFunc(LWBONEINFO_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWCAMERAINFO_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWGLOBALPOOL_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWITEMINFO_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWOBJECTINFO_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWPSYSFUNCS_GLOBAL, GFUSE_RELEASE);

	if (systemIsScreamerNet) return;
	
	globalFunc("LW Command Interface", GFUSE_RELEASE);
}
void LWPRender::QuietlyGetTransients()
{
	// get transients and don't complain if any failed (for layout-modeler plugins)
	backdropInfo = (LWBackdropInfo *)globalFunc(LWBACKDROPINFO_GLOBAL, GFUSE_TRANSIENT);
	compInfo = (LWCompInfo *)globalFunc(LWCOMPINFO_GLOBAL, GFUSE_TRANSIENT);
	fogInfo = (LWFogInfo *)globalFunc(LWFOGINFO_GLOBAL, GFUSE_TRANSIENT);
	sceneInfo = (LWSceneInfo *)globalFunc(LWSCENEINFO_GLOBAL, GFUSE_TRANSIENT);
	timeInfo = (LWTimeInfo *)globalFunc(LWTIMEINFO_GLOBAL, GFUSE_TRANSIENT);
	if (!systemIsScreamerNet) interfaceInfo = (LWInterfaceInfo *)globalFunc(LWINTERFACEINFO_GLOBAL, GFUSE_TRANSIENT);
#ifdef LW6
	// read light positions [NOTE] to work around wPosition bug in LW
	LightPosQ.clear();
	for (LWPLight l = LWPLight::first(); l; l = l.next())
	{
		Point v;
		l.param(LWIP_W_POSITION, timeInfo->time, v);
		LightPosQ << LightPos(l, v);
	}
#endif
}
XCALL_(LWError) LWPRender::NewTime(void * inst, LWFrame f, LWTime t)
{
	// get transients each NewTime

	if (!(backdropInfo = (LWBackdropInfo *)globalFunc(LWBACKDROPINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Backdrop Info";
	
	if (!(compInfo = (LWCompInfo *)globalFunc(LWCOMPINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Compositing Info";

	if (!(fogInfo = (LWFogInfo *)globalFunc(LWFOGINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Fog Info";

	if (!(sceneInfo = (LWSceneInfo *)globalFunc(LWSCENEINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Scene Info";

	if (!(timeInfo = (LWTimeInfo *)globalFunc(LWTIMEINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Time Info";

	if (!systemIsScreamerNet)
	{
		if (!(interfaceInfo = (LWInterfaceInfo *)globalFunc(LWINTERFACEINFO_GLOBAL, GFUSE_TRANSIENT)))
			return "Couldn't get Interface Info";
	}

#ifdef LW6
	// read light positions [NOTE] to work around wPosition bug in LW
	LightPosQ.clear();
	for (LWPLight l = LWPLight::first(); l; l = l.next())
	{
		Point v;
		l.param(LWIP_W_POSITION, t, v);
		LightPosQ << LightPos(l, v);
	}
#endif
	// get world to screen matrix
	TransW2S = LWPCamera::renderCamera().w2sMatrix(t);

	return ((LWPRender *)inst)->newTime(f, t);
}
LWError LWPRender::getCallBacks()
{
	LWError err = LWPPlugin::getCallBacks();
	if (err) return err;

	// transients

	if (systemIsModeler)	// fake transients for modeler
	{
		//backdropInfo = (LWBackdropInfo *); [FIXME]
		compInfo = &ModelerCompInfo;
		//fogInfo = (LWFogInfo *); [FIXME]
		//sceneInfo = (LWSceneInfo *); [FIXME]
		timeInfo = &ModelerTimeInfo;
		return 0;	// don't try getting render-specifics in Modeler
	}

	if (!(backdropInfo = (LWBackdropInfo *)globalFunc(LWBACKDROPINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Backdrop Info";
	
	if (!(compInfo = (LWCompInfo *)globalFunc(LWCOMPINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Compositing Info";

	if (!(fogInfo = (LWFogInfo *)globalFunc(LWFOGINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Fog Info";

	if (!(sceneInfo = (LWSceneInfo *)globalFunc(LWSCENEINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Scene Info";

	if (!(timeInfo = (LWTimeInfo *)globalFunc(LWTIMEINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Time Info";

	// non-screamy transients

	if (!systemIsScreamerNet)
	{
		if (!(interfaceInfo = (LWInterfaceInfo *)globalFunc(LWINTERFACEINFO_GLOBAL, GFUSE_TRANSIENT)))
			return "Couldn't get Interface Info";
	}

	// acquisitions

	if (callBackUsers ++) return 0;	// already got them

	if (!(boneInfo = (LWBoneInfo *)globalFunc(LWBONEINFO_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Bone Info";

	if (!(cameraInfo = (LWCameraInfo *)globalFunc(LWCAMERAINFO_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Camera Info";

	if (!(globalPool = (LWGlobalPool *)globalFunc(LWGLOBALPOOL_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Global Pool";

	if (!(itemInfo = (LWItemInfo *)globalFunc(LWITEMINFO_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Item Info";

	if (!(lightInfo = (LWLightInfo *)globalFunc(LWLIGHTINFO_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Light Info";

	if (!(objectInfo = (LWObjectInfo *)globalFunc(LWOBJECTINFO_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Object Info";

	if (!(particleFuncs = (LWPSysFuncs *)globalFunc(LWPSYSFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Particle Functions";

	// non-screamy acquisitions

	if (!systemIsScreamerNet)
	{
		if (!(commandFunc = (LWCommandFunc)globalFunc("LW Command Interface", GFUSE_ACQUIRE)))
			return "Couldn't get LW Command Interface";
	}

	return 0;
}
LWError LWPPlugin::getCallBacks()
{
	if (!globalFunc) return "LWPPlugin::getCallbacks() : globalFunc not initialized!";

	// transients

	if (!(localeInfo = (unsigned long)globalFunc(LWLOCALEINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Locale Info";

	if (!(productInfo = (unsigned long)globalFunc(LWPRODUCTINFO_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get Product Info";
	productID = productInfo & LWINF_PRODUCT;
	productMajor = LWINF_GETMAJOR(productInfo);
	productMinor = LWINF_GETMINOR(productInfo);
	productBuild = LWINF_GETBUILD(productInfo);

	if (!(systemID = (unsigned long)globalFunc(LWSYSTEMID_GLOBAL, GFUSE_TRANSIENT)))
		return "Couldn't get System ID";
	systemContext = systemID & LWSYS_TYPEBITS;
	systemSerial = systemID & LWSYS_SERIALBITS;
	systemIsModeler = systemID & LWSYS_MODELER;
	systemIsLayout = 1;
	systemIsScreamerNet = systemID & LWSYS_SCREAMERNET;

	// acquisitions

	if (callBackUsers ++) return 0;	// already got them

	if (!(channelInfo = (LWChannelInfo *)globalFunc(LWCHANNELINFO_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Channel Info";

	if (!(dirInfoFunc = (LWDirInfoFunc *)globalFunc(LWDIRINFOFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Directory Info";

	if (!(dynaConvertFunc = (DynaConvertFunc *)globalFunc(LWDYNACONVERTFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Dynamic Conversion Funcsions";

	if (!(dynaRequestFuncs = (DynaReqFuncs *)globalFunc(LWDYNAREQFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Dynamic Requestor Functions";

	if (!(envelopeFuncs = (LWEnvelopeFuncs *)globalFunc(LWENVELOPEFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Envelops Functions";

	if (!(fileIOFuncs = (LWFileIOFuncs *)globalFunc(LWFILEIOFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get File IO Functions";

	if (!(imageList = (LWImageList *)globalFunc(LWIMAGELIST_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Image List";

	if (!(imageUtil = (LWImageUtil *)globalFunc(LWIMAGEUTIL_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Image Utilities";

	if (!(instUpdate = (LWInstUpdate *)globalFunc(LWINSTUPDATE_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Instance Update Functions";

	if (!(messageFuncs = (LWMessageFuncs*)globalFunc(LWMESSAGEFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Info Messages Functions";

	if (!(mutexFuncs = (LWMTUtilFuncs *)globalFunc(LWMTUTILFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Mutex Functions";

	if (!(objectFuncs = (LWObjectFuncs *)globalFunc(LWOBJECTFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Object Functions";
   
	if (!(surfaceFuncs = (LWSurfaceFuncs *)globalFunc(LWSURFACEFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Surface Functions";

	if (!(textureFuncs = (LWTextureFuncs *)globalFunc(LWTEXTUREFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Texture Functions";

	if (!(vParmFuncs = (LWVParmFuncs *)globalFunc(LWVPARMFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Variable Parameter Functions";

	if (systemIsScreamerNet) return 0;

	// non-screamy acquisitions

	if (!(colorPickerFunc = (LWColorActivateFunc *)globalFunc(LWCOLORACTIVATEFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Color Activate Function";

	if (!(fileActivateFunc = (LWFileActivateFunc *)globalFunc(LWFILEACTIVATEFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get File Request Activation Function";

	if (!(fileReqFunc = (LWFileReqFunc *)globalFunc(LWFILEREQFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get File Request Function";

	if (!(fileTypeFunc = (LWFileTypeFunc *)globalFunc(LWFILETYPEFUNC_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get File Type Function";

	if (!(panelFuncs = (LWPanelFuncs *)globalFunc(LWPANELFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Panel Functions";

	if (!(previewFuncs = (LWPreviewFuncs *)globalFunc(LWPREVIEWFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Preview Functions";

	if (!(rasterFuncs = (LWRasterFuncs *)globalFunc(LWRASTERFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Raster Functions";

	if (!(shelfFuncs = (LWShelfFuncs *)globalFunc(LWSHELFFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Shelf Functions";

	if (!(surfaceEditFuncs = (LWSurfEdFuncs *)globalFunc(LWSURFEDFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Surface Edit Functions";

	if (!(textureEditFuncs = (LWTxtrEdFuncs *)globalFunc(LWTXTREDFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get Texture Edit Functions";

	if (!(xPanelFuncs = (LWXPanelFuncs *)globalFunc(LWXPANELFUNCS_GLOBAL, GFUSE_ACQUIRE)))
		return "Couldn't get XPanel Functions";

	return 0;
}
void LWPPlugin::freeCallBacks()
{
	if (-- callBackUsers) return;	// still need them

	globalFunc(LWCHANNELINFO_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWDIRINFOFUNC_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWDYNACONVERTFUNC_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWDYNAREQFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWENVELOPEFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWFILEIOFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWIMAGELIST_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWIMAGEUTIL_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWINSTUPDATE_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWLIGHTINFO_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWMESSAGEFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWMTUTILFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWOBJECTFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWSURFACEFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWTEXTUREFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWVPARMFUNCS_GLOBAL, GFUSE_RELEASE);

	if (systemIsScreamerNet) return;

	globalFunc(LWCOLORACTIVATEFUNC_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWFILEACTIVATEFUNC_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWFILEREQFUNC_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWFILETYPEFUNC_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWPANELFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWPREVIEWFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWRASTERFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWSHELFFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWSURFEDFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWTXTREDFUNCS_GLOBAL, GFUSE_RELEASE);
	globalFunc(LWXPANELFUNCS_GLOBAL, GFUSE_RELEASE);
}
Beispiel #8
0
 static int staticPubMethod(int arg) {
     FUNCTION_MACRO(arg);
     globalFunc(arg);
     return globalStaticVariable;
 }