当前位置: 首页>>代码示例>>C++>>正文


C++ GraphicsDevice::GetGraphicsFunction方法代码示例

本文整理汇总了C++中GraphicsDevice::GetGraphicsFunction方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsDevice::GetGraphicsFunction方法的具体用法?C++ GraphicsDevice::GetGraphicsFunction怎么用?C++ GraphicsDevice::GetGraphicsFunction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GraphicsDevice的用法示例。


在下文中一共展示了GraphicsDevice::GetGraphicsFunction方法的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 
//.........这里部分代码省略.........
开发者ID:ezhangle,项目名称:GNU-Data-Language-0.9.6,代码行数:101,代码来源:plotting_device.cpp


注:本文中的GraphicsDevice::GetGraphicsFunction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。