本文整理汇总了C++中StHandle::isFile方法的典型用法代码示例。如果您正苦于以下问题:C++ StHandle::isFile方法的具体用法?C++ StHandle::isFile怎么用?C++ StHandle::isFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StHandle
的用法示例。
在下文中一共展示了StHandle::isFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getResourceManager
bool StOutIZ3D::create() {
StWindow::show();
if(!StWindow::create()) {
return false;
}
// initialize GL context
myContext = StWindow::getContext();
myContext->setMessagesQueue(myMsgQueue);
const StHandle<StResourceManager>& aResMgr = getResourceManager();
if(!myContext->isGlGreaterEqual(2, 0)) {
myMsgQueue->pushError(stCString("OpenGL 2.0 is required by iZ3D Output"));
myIsBroken = true;
return true;
}
StWindow::stglMakeCurrent(ST_WIN_MASTER);
myContext->stglSetVSync((StGLContext::VSync_Mode )StWindow::params.VSyncMode->getValue());
StWindow::params.VSyncMode->signals.onChanged += stSlot(this, &StOutIZ3D::doSwitchVSync);
// INIT iZ3D tables textures
StAVImage aTableImg;
StHandle<StResource> aTableOld = aResMgr->getResource(StString("textures") + SYS_FS_SPLITTER + "iz3dTableOld.png");
uint8_t* aData = NULL;
int aDataSize = 0;
if(!aTableOld.isNull()
&& !aTableOld->isFile()
&& aTableOld->read()) {
aData = (uint8_t* )aTableOld->getData();
aDataSize = aTableOld->getSize();
}
if(!aTableImg.load(!aTableOld.isNull() ? aTableOld->getPath() : StString(), StImageFile::ST_TYPE_PNG, aData, aDataSize)) {
myMsgQueue->pushError(StString("iZ3D output - critical error:\n") + aTableImg.getState());
myIsBroken = true;
return true;
}
myTexTableOld.setMinMagFilter(*myContext, GL_NEAREST); // we need not linear filtrating for lookup-table!
if(!myTexTableOld.init(*myContext, aTableImg.getPlane())) {
myMsgQueue->pushError(stCString("iZ3D output - critical error:\nLookup-table initalization failed!"));
myIsBroken = true;
return true;
}
StHandle<StResource> aTableNew = aResMgr->getResource(StString("textures") + SYS_FS_SPLITTER + "iz3dTableNew.png");
aData = NULL;
aDataSize = 0;
if(!aTableNew.isNull()
&& !aTableNew->isFile()
&& aTableNew->read()) {
aData = (uint8_t* )aTableNew->getData();
aDataSize = aTableNew->getSize();
}
if(!aTableImg.load(!aTableNew.isNull() ? aTableNew->getPath() : StString(), StImageFile::ST_TYPE_PNG, aData, aDataSize)) {
myMsgQueue->pushError(StString("iZ3D output - critical error:\n") + aTableImg.getState());
myIsBroken = true;
return true;
}
myTexTableNew.setMinMagFilter(*myContext, GL_NEAREST); // we need not linear filtrating for lookup-table!
if(!myTexTableNew.init(*myContext, aTableImg.getPlane())) {
myMsgQueue->pushError(stCString("iZ3D output - critical error:\nLookup-table initalization failed!"));
myIsBroken = true;
return true;
}
// INIT shaders
if(!myShaders.init(*myContext)) {
myMsgQueue->pushError(stCString("iZ3D output - critical error:\nShaders initialization failed!"));
myIsBroken = true;
return true;
}
myIsBroken = false;
return true;
}