本文整理汇总了C++中GraphicsDevice::SetFileName方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsDevice::SetFileName方法的具体用法?C++ GraphicsDevice::SetFileName怎么用?C++ GraphicsDevice::SetFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsDevice
的用法示例。
在下文中一共展示了GraphicsDevice::SetFileName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: device
//.........这里部分代码省略.........
{
static int valIx = e->KeywordIx( "CURSOR_CROSSHAIR");
BaseGDL* res = e->GetKW( valIx);
if( res != NULL)
{
bool success = actDevice->CursorCrosshair();
if( !success)
e->Throw( "Current device does not support keyword CURSOR_CROSSHAIR.");
}
}
// CURSOR_ORIGINAL (WARNING: SAME CODE AS CURSOR_CROSSHAIR!)
{
static int valIx = e->KeywordIx( "CURSOR_ORIGINAL");
BaseGDL* res = e->GetKW( valIx);
if( res != NULL)
{
bool success = actDevice->CursorCrosshair();
if( !success)
e->Throw( "Current device does not support keyword CURSOR_ORIGINAL.");
}
}
// FILENAME
{
static int fileNameIx = e->KeywordIx( "FILENAME");
BaseGDL* fileName = e->GetKW( fileNameIx);
if( fileName != NULL)
{
DString fName;
e->AssureStringScalarKW( fileNameIx, fName);
if( fName == "")
e->Throw( "Null filename not allowed.");
WordExp(fName);
bool success = actDevice->SetFileName( fName);
if( !success)
e->Throw( "Current device does not support keyword FILENAME.");
}
}
// LANDSCAPE and PORTRAIT need to be executed before XSIZE, YSIZE, XOFFSET and YOFFSET!
{
static int portraitIx = e->KeywordIx( "PORTRAIT");
static int landscapeIx = e->KeywordIx( "LANDSCAPE");
//IDL consider the value of the first typed of the two options, if both are present.
//I dunoo how to do that with GDL parsing.
if (e->KeywordSet(portraitIx) && e->KeywordSet(landscapeIx))
Warning("Warning: both PORTRAIT and LANDSCAPE specified!");
// LANDSCAPE
{
BaseGDL* landscapeKW=e->GetKW(landscapeIx);
if (landscapeKW != NULL)
{
DLong isLandscape;
e->AssureLongScalarKW( landscapeIx, isLandscape);
if (isLandscape == 0) {
bool success = actDevice->SetPortrait();
if (!success) e->Throw("Current device does not support keyword LANDSCAPE");
} else {
bool success = actDevice->SetLandscape();
if (!success) e->Throw("Current device does not support keyword LANDSCAPE");
}
}
}
// PORTRAIT