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


C++ LogCategory::print方法代码示例

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


在下文中一共展示了LogCategory::print方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: gglCreateSurface

GLSurface gglCreateSurface(GLDisplay dp,::Window hwin,GLFormat fp)
{
   GGLDisplay* display = (GGLDisplay*)dp;
   GGLFormat* format = (GGLFormat*)fp;
   GGLSurface* surface = 0;

   if (!_hasGLXExtension(display,GLX_VERSION_1_3)) {
      // Return our own GGL surface rep.
      surface = new GGLSurface;
      surface->type = GGLSurface::Window;
      surface->display = display;
      surface->drawable = 0;
      surface->window = hwin;
   }
   else {
      // Get config info from format ID
      GLXFBConfig config;
      if (!_getFBConfig(display,format->pformat,config))
         return 0;

      // Create GLX window
      GLXWindow window = glXCreateWindow(display->display,config,hwin,0);
      if (!window) {
         GLenum error = glGetError();
         static LogCategory log("/Gfx/Device/GL");
         log.print(format("Create window error: %d",error));
         return 0;
      }

      // Return our own GGL surface rep.
      surface = new GGLSurface;
      surface->type = GGLSurface::Window;
      surface->display = display;
      surface->drawable = window;
      surface->window = 0;
   }
   return surface;
}
开发者ID:Adhdcrazzy,项目名称:Torque3D,代码行数:38,代码来源:glx.cpp

示例2: gglSelectFormat

GLFormat gglSelectFormat(GLDisplay dp,GLFormatInfo& mode)
{
   GGLDisplay* display = (GGLDisplay*)dp;
   U32 pformat;

   if (!_hasGLXExtension(display,GLX_VERSION_1_3)) {
      // Find GL compatible X visual using 1.2 interface.
      // 1.2 or earlier does not include pbuffer support.
      if (mode.target != GLFormatInfo::Window)
         return 0;

      int attributes[] = {
         GLX_RGBA,
         GLX_RED_SIZE,        mode.red,
         GLX_BLUE_SIZE,       mode.blue,
         GLX_GREEN_SIZE,      mode.green,
         GLX_DEPTH_SIZE,      mode.z,
         GLX_ALPHA_SIZE,      mode.alpha,
         GLX_STENCIL_SIZE,    mode.stencil,
         GLX_DOUBLEBUFFER,    true,
         GLX_DOUBLEBUFFER,
         None
      };
      XVisualInfo* visual = glXChooseVisual(display->display, display->screen, attributes);
      if (!visual) {
         static LogCategory log("/Gfx/Device/GL");
         log.print("GGLContext: Could not get an accelerated visual");
         return 0;
      }
      pformat = visual->visualid;
      XFree(visual);
   }
   else {
      // Find GL compatible X visual using 1.3 interface.
      int attributes[] = {
         GLX_DRAWABLE_TYPE,   (mode.target == GLFormatInfo::Buffer)?
                              GLX_PBUFFER_BIT: GLX_WINDOW_BIT,
         GLX_RENDER_TYPE,     GLX_RGBA_BIT,
         GLX_RED_SIZE,        mode.red,
         GLX_BLUE_SIZE,       mode.blue,
         GLX_GREEN_SIZE,      mode.green,
         GLX_DEPTH_SIZE,      mode.z,
         GLX_ALPHA_SIZE,      mode.alpha,
         GLX_STENCIL_SIZE,    mode.stencil,
         GLX_DOUBLEBUFFER,    true,
         None
      };
      int count = 0;
      GLXFBConfig* configList = glXChooseFBConfig(display->display,
         display->screen,attributes,&count);
      if (!count)
         return 0;

      // Return the config ID
      int xid;
      glXGetFBConfigAttrib(display->display,configList[0],GLX_FBCONFIG_ID,&xid);
      XFree(configList);
      pformat = xid;
   }

   if (pformat) {
      GGLFormat* format = new GGLFormat;
      format->pformat = pformat;
      format->mode = mode;
      return format;
   }
   return 0;
}
开发者ID:Adhdcrazzy,项目名称:Torque3D,代码行数:68,代码来源:glx.cpp


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