本文整理汇总了C++中StHandle::getRendererId方法的典型用法代码示例。如果您正苦于以下问题:C++ StHandle::getRendererId方法的具体用法?C++ StHandle::getRendererId怎么用?C++ StHandle::getRendererId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StHandle
的用法示例。
在下文中一共展示了StHandle::getRendererId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: open
bool StApplication::open() {
if(!myWindow.isNull()) {
return true;
}
StSettings aGlobalSettings(myResMgr, "sview");
if(!mySwitchTo.isNull()) {
myRendId = mySwitchTo->getRendererId();
myWindow = mySwitchTo;
mySwitchTo.nullify();
aGlobalSettings.saveString(ST_SETTING_RENDERER, myRendId);
aGlobalSettings.saveBool (ST_SETTING_RENDERER_AUTO, false);
} else {
if(myRenderers.isEmpty()) {
myWindow = new StWindow(myResMgr, myWinParent);
myWindow->setMessagesQueue(myMsgQueue);
myWindow->params.VSyncMode = params.VSyncMode;
} else {
bool isAuto = myRendId.isEqualsIgnoreCase(ST_SETTING_AUTO_VALUE);
if(!isAuto) {
for(size_t anIter = 0; anIter < myRenderers.size(); ++anIter) {
StHandle<StWindow> aWin = myRenderers[anIter];
if(myRendId == aWin->getRendererId()) {
myWindow = aWin;
aGlobalSettings.saveString(ST_SETTING_RENDERER, myRendId);
aGlobalSettings.saveBool (ST_SETTING_RENDERER_AUTO, isAuto);
break;
}
}
if(myWindow.isNull()) {
stError(StString("Output with id '" + myRendId + "' is not found."));
isAuto = true;
}
}
if(isAuto) {
// autodetection
aGlobalSettings.saveString(ST_SETTING_RENDERER, ST_SETTING_AUTO_VALUE);
aGlobalSettings.saveBool (ST_SETTING_RENDERER_AUTO, isAuto);
myWindow = myRenderers[0];
if(!myDevices.isEmpty()) {
StHandle<StOutDevice> aBestDev = myDevices[0];
for(size_t aDevIter = 0; aDevIter < myDevices.size(); ++aDevIter) {
const StHandle<StOutDevice>& aDev = myDevices[aDevIter];
if(aDev->Priority > aBestDev->Priority) {
aBestDev = aDev;
}
}
for(size_t anIter = 0; anIter < myRenderers.size(); ++anIter) {
const StHandle<StWindow>& aWin = myRenderers[anIter];
if(aBestDev->PluginId == aWin->getRendererId()) {
myWindow = aWin;
myWindow->setDevice(aBestDev->DeviceId);
break;
}
}
}
}
}
myWindow->setTitle(myTitle);
}
// synchronize devices enumeration
const StString aPluginId = myWindow->getRendererId();
const StString aDeviceId = myWindow->getDeviceId();
for(size_t aDevIter = 0; aDevIter < myDevices.size(); ++aDevIter) {
const StHandle<StOutDevice>& aDev = myDevices[aDevIter];
if(aPluginId == aDev->PluginId
&& aDeviceId == aDev->DeviceId) {
params.ActiveDevice->setValue((int32_t )aDevIter);
break;
}
}
// setup GL options before window creation
const StWinAttr anAttribs[] = {
StWinAttr_GlDebug, (StWinAttr )myGlDebug,
StWinAttr_NULL
};
myWindow->setAttributes(anAttribs);
myIsOpened = myWindow->create();
if(myIsOpened) {
// connect slots
myWindow->signals.onRedraw = stSlot(this, &StApplication::doDrawProxy);
myWindow->signals.onClose = stSlot(this, &StApplication::doClose);
myWindow->signals.onPause = stSlot(this, &StApplication::doPause);
myWindow->signals.onResize = stSlot(this, &StApplication::doResize);
myWindow->signals.onAction = stSlot(this, &StApplication::doAction);
myWindow->signals.onKeyDown = stSlot(this, &StApplication::doKeyDown);
myWindow->signals.onKeyUp = stSlot(this, &StApplication::doKeyUp);
myWindow->signals.onKeyHold = stSlot(this, &StApplication::doKeyHold);
myWindow->signals.onMouseDown = stSlot(this, &StApplication::doMouseDown);
myWindow->signals.onMouseUp = stSlot(this, &StApplication::doMouseUp);
myWindow->signals.onTouch = stSlot(this, &StApplication::doTouch);
myWindow->signals.onGesture = stSlot(this, &StApplication::doGesture);
myWindow->signals.onScroll = stSlot(this, &StApplication::doScroll);
myWindow->signals.onFileDrop = stSlot(this, &StApplication::doFileDrop);
myWindow->signals.onNavigate = stSlot(this, &StApplication::doNavigate);
//.........这里部分代码省略.........