本文整理汇总了C++中GraphicsDevice::GetScreenSize方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsDevice::GetScreenSize方法的具体用法?C++ GraphicsDevice::GetScreenSize怎么用?C++ GraphicsDevice::GetScreenSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsDevice
的用法示例。
在下文中一共展示了GraphicsDevice::GetScreenSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: device
void device( EnvT* e)
{
GraphicsDevice* actDevice = GraphicsDevice::GetDevice();
//GET functions are examined BEFORE setting functions.
//GET_CURRENT_FONT ? //TODO
// GET_DECOMPOSED ?
{
static int get_decomposedIx = e->KeywordIx( "GET_DECOMPOSED" );
if ( e->KeywordPresent( get_decomposedIx ) )
{
DLong value = actDevice->GetDecomposed( );
if ( value == -1 )
e->Throw( "Keyword GET_DECOMPOSED not allowed for call to: DEVICE" );
else
e->SetKW( get_decomposedIx, new DLongGDL( value ) );
}
}
//GET_FONTNAMES? //TODO
//GET_FONTNUM? //TODO
// GET_GRAPHICS_FUNCTION
{
static int get_graphics_FunctionIx = e->KeywordIx( "GET_GRAPHICS_FUNCTION");
if( e->KeywordPresent( get_graphics_FunctionIx))
{
DLong value = actDevice->GetGraphicsFunction();
if(value == -1)
e->Throw( "Keyword GET_GRAPHICS_FUNCTION not allowed for call to: DEVICE");
else
e->SetKW( get_graphics_FunctionIx, new DLongGDL( value));
}
}
// GET_PAGE_SIZE ?
{
static int get_page_sizeIx = e->KeywordIx("GET_PAGE_SIZE");
if( e->KeywordPresent( get_page_sizeIx))
{
DIntGDL* value = actDevice->GetPageSize();
if (value == NULL)
e->Throw( "Keyword GET_PAGE_SIZE not allowed for call to: DEVICE");
else
e->SetKW( get_page_sizeIx, value );
}
}
// GET_PIXEL_DEPTH ?
{
static int get_pixel_depthIx = e->KeywordIx( "GET_PIXEL_DEPTH");
if( e->KeywordPresent( get_pixel_depthIx))
{
DLong value = actDevice->GetPixelDepth();
if(value == -1)
e->Throw( "Keyword GET_PIXEL_DEPTH not allowed for call to: DEVICE");
else
e->SetKW( get_pixel_depthIx, new DLongGDL( value ));
}
}
// GET_SCREEN_SIZE
{
static int get_screen_sizeIx = e->KeywordIx("GET_SCREEN_SIZE");
if( e->KeywordPresent( get_screen_sizeIx))
{
DIntGDL* fvalue=actDevice->GetScreenSize();
if (fvalue == NULL)
e->Throw( "Keyword GET_SCREEN_SIZE not allowed for call to: DEVICE");
else {
(*fvalue)[0]=floor((*fvalue)[0]);
(*fvalue)[1]=floor((*fvalue)[1]);
e->SetKW( get_screen_sizeIx, fvalue);
}
}
}
// GET_VISUAL_DEPTH ?
{
static int get_visual_depthIx = e->KeywordIx( "GET_VISUAL_DEPTH");
if( e->KeywordPresent( get_visual_depthIx))
{
DLong value = actDevice->GetVisualDepth();
if(value == -1)
e->Throw( "Keyword GET_VISUAL_DEPTH not allowed for call to: DEVICE");
else
e->SetKW( get_visual_depthIx, new DLongGDL( value));
}
}
// GET_VISUAL_NAME ?
{
static int get_visual_nameIx = e->KeywordIx( "GET_VISUAL_NAME");
if( e->KeywordPresent( get_visual_nameIx))
{
DString value = actDevice->GetVisualName();
if(value == "")
e->Throw( "Keyword GET_VISUAL_NAME not allowed for call to: DEVICE");
else
//.........这里部分代码省略.........