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


C++ RegalContext类代码示例

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


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

示例1: TexParameter

  void Filt::TexParameter(const RegalContext &ctx, GLenum target, GLenum pname, GLfloat param)
  {
    UNUSED_PARAMETER(ctx);
    UNUSED_PARAMETER(target);
    UNUSED_PARAMETER(pname);
    UNUSED_PARAMETER(param);

    #if REGAL_SYS_ES2 || REGAL_SYS_GL
    if (ctx.isCore() || ctx.isES2())
      switch(pname)
      {
        case GL_TEXTURE_WRAP_S:
        case GL_TEXTURE_WRAP_T:
        case GL_TEXTURE_WRAP_R:
          switch(int(param))
          {
            case GL_CLAMP:
              Warning("Regal does not support GL_CLAMP wrap mode for core or ES 2.0 profiles - skipping.");
              filtered = true;
            default: break;
          }
        default: break;
      }
    #endif
  }
开发者ID:sherief,项目名称:regal,代码行数:25,代码来源:RegalFilt.cpp

示例2: init

void
Init::shareContext(RegalSystemContext a, RegalSystemContext b)
{
  init();

  RegalContext *contextA = getContext(a);
  RegalContext *contextB = getContext(b);

  RegalAssert(contextA);
  RegalAssert(contextB);

  // Either of the groups of contexts needs to be uninitialized.
  // In principle Regal might be able to merge the shared
  // containers together, but that's not currently implemented.

  if (contextA->groupInitializedContext() && contextB->groupInitializedContext())
  {
    Warning("Regal can't share initialized context groups.");
    RegalAssert(false);
    return;
  }

  // Share all the Regal contexts in b into a

  std::list<RegalContext *> tmp = *contextB->shareGroup;

  for (std::list<RegalContext *>::iterator i = tmp.begin(); i!=tmp.end(); ++i)
  {
    RegalAssert(*i);
    contextA->shareGroup->push_back(*i);
    (*i)->shareGroup = contextA->shareGroup;
  }
}
开发者ID:jra101,项目名称:regal,代码行数:33,代码来源:RegalInit.cpp

示例3: getContext

void
Init::destroyContext(RegalSystemContext sysCtx)
{
  if (_init && sysCtx)
  {
    RegalContext *context = getContext(sysCtx);

    if (context)
    {
      RegalAssert(context->sysCtx==sysCtx);

      Thread::ScopedLock thLock(th2rcMutex);
      Thread::ScopedLock scLock(sc2rcMutex);

      th2rc.erase(context->thread);
      sc2rc.erase(sysCtx);

      // TODO - clear TLS for other threads too?

      if (context==Thread::CurrentContext())
      {
        context->Cleanup();
        setContextTLS(NULL);
      }

      delete context;
    }
  }
}
开发者ID:jra101,项目名称:regal,代码行数:29,代码来源:RegalInit.cpp

示例4: FilterTexParameter

  bool Filt::FilterTexParameter(const RegalContext &ctx, GLenum target, GLenum pname, GLfloat param, GLfloat &newParam)
  {
    UNUSED_PARAMETER(ctx);
    UNUSED_PARAMETER(target);

    if (!ctx.isES2() && !ctx.isCore())
      return false;

    switch (pname)
    {
      case GL_TEXTURE_WRAP_S:
      case GL_TEXTURE_WRAP_T:
      case GL_TEXTURE_WRAP_R:
        switch (int(param))
        {
          case GL_CLAMP:
            Warning("Regal does not support GL_CLAMP wrap mode for core or ES 2.0 profiles - remapping to equivalent GL_CLAMP_TO_EDGE");
            newParam = GL_CLAMP_TO_EDGE;
            return true;
          default:
            break;
        }
      default:
        break;
    }

    return false;
  }
开发者ID:Shalmezad,项目名称:regal,代码行数:28,代码来源:RegalFilt.cpp

示例5: PolygonMode

  void Filt::PolygonMode(const RegalContext &ctx, GLenum face, GLenum mode)
  {
    UNUSED_PARAMETER(ctx);
    UNUSED_PARAMETER(face);
    UNUSED_PARAMETER(mode);

    #if REGAL_SYS_GL
    if (ctx.isCore())
    {
      if (face!=GL_FRONT_AND_BACK)
      {
        Warning("Regal does not support ", GLenumToString(face), " in glPolygonMode for core profile, only GL_FRONT_AND_BACK is supported - skipping.");
        filtered = true;
      }
    }
    #endif

    #if REGAL_SYS_ES2
    if (ctx.isES2())
    {
      Warning("Regal does not support glPolygonMode for ES 2.0 - skipping.");
      filtered = true;
    }
    #endif
  }
开发者ID:sherief,项目名称:regal,代码行数:25,代码来源:RegalFilt.cpp

示例6: RenderMode

  void Filt::RenderMode(const RegalContext &ctx, GLenum mode)
  {
    UNUSED_PARAMETER(ctx);
    UNUSED_PARAMETER(mode);

    #if REGAL_SYS_ES2 || REGAL_SYS_GL
    if (ctx.isCore() || ctx.isES2())
      if (mode!=GL_RENDER)
      {
        Warning("Regal does not support ", GLenumToString(mode), " render mode for core or ES 2.0 profiles, only GL_RENDER is supported in those profiles - skipping.");
        filtered = true;
      }
    #endif
  }
开发者ID:sherief,项目名称:regal,代码行数:14,代码来源:RegalFilt.cpp

示例7: RenderMode

  bool Filt::RenderMode(const RegalContext &ctx, GLenum mode)
  {
    UNUSED_PARAMETER(ctx);
    UNUSED_PARAMETER(mode);

    if (ctx.isCore() || ctx.isES2())
      if (mode!=GL_RENDER)
      {
        Warning("Regal does not support ", GLenumToString(mode), " render mode for core or ES 2.0 profiles, only GL_RENDER is supported in those profiles - skipping.");
        return true;
      }

    return false;
  }
开发者ID:Shalmezad,项目名称:regal,代码行数:14,代码来源:RegalFilt.cpp

示例8: switch

  bool Filt::TexImage2D(const RegalContext &ctx, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* data)
  {
    UNUSED_PARAMETER(ctx);
    UNUSED_PARAMETER(target);
    UNUSED_PARAMETER(level);
    UNUSED_PARAMETER(internalformat);
    UNUSED_PARAMETER(width);
    UNUSED_PARAMETER(height);
    UNUSED_PARAMETER(border);
    UNUSED_PARAMETER(format);
    UNUSED_PARAMETER(type);
    UNUSED_PARAMETER(data);

    if (ctx.isES2())
    {
      switch ( target )
      {
        case GL_PROXY_TEXTURE_CUBE_MAP:
          Warning( "Regal does not support PROXY_TEXTURE_CUBE_MAP as target for TexImage2D for ES 2.0 profile" );
          return true;
        default:
          break;
      }
    }

    return false;
  }
开发者ID:Shalmezad,项目名称:regal,代码行数:27,代码来源:RegalFilt.cpp

示例9: GenerateMipmap

  bool Filt::GenerateMipmap(const RegalContext &ctx, GLenum target)
  {
    UNUSED_PARAMETER(ctx);
    UNUSED_PARAMETER(target);

    if (!ctx.isES2())
      return false;

    switch (target)
    {
      case GL_TEXTURE_2D:
      case GL_TEXTURE_CUBE_MAP:
        break;

      case GL_TEXTURE_2D_ARRAY:
        if (!ctx.info->gl_nv_texture_array)
        {
          Warning("glGenerateMipmap(GL_TEXTURE_2D_ARRAY) not supported for ES 2.0 without NV_texture_array.");
          return true;
        }
        break;

      default:
        Warning("glGenerateMipmap(", GLenumToString(target), ") not supported for ES 2.0.");
        return true;
    }

    return false;
  }
开发者ID:Shalmezad,项目名称:regal,代码行数:29,代码来源:RegalFilt.cpp

示例10:

void
TexC::Init( RegalContext& ctx )
{
  RegalContext* sharingWith = ctx.groupInitializedContext();
  if ( sharingWith != NULL ) {
    mapTextureToTextureState = sharingWith->texc->mapTextureToTextureState;
  }

  Reset_();
}
开发者ID:LosingLin,项目名称:regal,代码行数:10,代码来源:RegalTexC.cpp

示例11: ReadBuffer

  bool Filt::ReadBuffer(const RegalContext &ctx, GLenum src)
  {
    UNUSED_PARAMETER(ctx);
    UNUSED_PARAMETER(src);

    if (!ctx.isES2() || !ctx.info->gl_nv_read_buffer)
      return false;

    switch (src)
    {
      // These two should always be supported w/o additional extensions
      case GL_COLOR_ATTACHMENT0:
      case GL_BACK:
        break;

      // GL_FRONT may require NV_read_buffer_front, depending whether the context is
      // double buffered. Let's output a warning but still pass it through
      case GL_FRONT:
        if (!ctx.info->gl_nv_read_buffer_front)
          Warning("glReadBuffer(GL_FRONT) may not work on ES 2 without NV_read_buffer_front, depending on context buffering.");
        break;

      case GL_COLOR_ATTACHMENT1:
      case GL_COLOR_ATTACHMENT2:
      case GL_COLOR_ATTACHMENT3:
      case GL_COLOR_ATTACHMENT4:
      case GL_COLOR_ATTACHMENT5:
      case GL_COLOR_ATTACHMENT6:
      case GL_COLOR_ATTACHMENT7:
      case GL_COLOR_ATTACHMENT8:
      case GL_COLOR_ATTACHMENT9:
      case GL_COLOR_ATTACHMENT10:
      case GL_COLOR_ATTACHMENT11:
      case GL_COLOR_ATTACHMENT12:
      case GL_COLOR_ATTACHMENT13:
      case GL_COLOR_ATTACHMENT14:
      case GL_COLOR_ATTACHMENT15:
        if (!ctx.info->gl_nv_draw_buffers)
        {
          Warning("glReadBuffer(GL_COLOR_ATTACHMENT1+) not supported for ES 2 without NV_draw_buffers.");
          return true;
        }
        break;

      default:
        Warning("glReadBuffer(", GLenumToString(src), ") not supported for ES 2.\n");
        return true;
    }

    return false;
  }
开发者ID:Shalmezad,项目名称:regal,代码行数:51,代码来源:RegalFilt.cpp

示例12: PolygonMode

  bool Filt::PolygonMode(const RegalContext &ctx, GLenum face, GLenum mode)
  {
    UNUSED_PARAMETER(ctx);
    UNUSED_PARAMETER(face);
    UNUSED_PARAMETER(mode);

    if (ctx.isCore())
    {
      if (face!=GL_FRONT_AND_BACK)
      {
        Warning("Regal does not support ", GLenumToString(face), " in glPolygonMode for core profile, only GL_FRONT_AND_BACK is supported - skipping.");
        return true;
      }
    }

    if (ctx.isES2())
    {
      Warning("Regal does not support glPolygonMode for ES 2.0 - skipping.");
      return true;
    }

    return false;
  }
开发者ID:Shalmezad,项目名称:regal,代码行数:23,代码来源:RegalFilt.cpp

示例13: Warning

  bool Filt::FramebufferTexture2D(const RegalContext &ctx, GLenum target, GLenum attachment,
                                  GLenum textarget, GLuint texture, GLint level)
  {
    UNUSED_PARAMETER(ctx);
    UNUSED_PARAMETER(target);
    UNUSED_PARAMETER(attachment);
    UNUSED_PARAMETER(textarget);
    UNUSED_PARAMETER(texture);
    UNUSED_PARAMETER(level);

    if (!FramebufferAttachmentSupported(ctx, attachment))
    {
      return true;
    }

    if (!ctx.isES2())
      return false;

    if ((level > 0) && !ctx.info->gl_oes_fbo_render_mipmap)
    {
      Warning("glFramebufferTexture2D with level > 0 not supported for ES 2.0 without OES_fbo_render_mipmap.");
      return true;
    }

    if (texture > 0)
    {
      switch (textarget)
      {
        case GL_TEXTURE_2D:
        case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
        case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
        case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
        case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
        case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
        case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
          break;

        default:
          Warning("glFramebufferTexture2D with ", GLenumToString(target), ") not supported for ES 2.0.");
          return true;
      }
    }

    return false;
  }
开发者ID:Shalmezad,项目名称:regal,代码行数:45,代码来源:RegalFilt.cpp

示例14: DrawBuffers

  bool Filt::DrawBuffers(const RegalContext &ctx, GLsizei n, const GLenum *bufs)
  {
    UNUSED_PARAMETER(ctx);

    if (!ctx.isES2())
      return false;

    for (GLsizei i = 0; i < n; ++i)
    {
      if (bufs[i] == GL_NONE || (bufs[i] >= GL_COLOR_ATTACHMENT0 && bufs[i] <= GL_COLOR_ATTACHMENT15))
        continue;

      Warning( "Regal does not support ", GLenumToString( bufs[i] ), " as target for glDrawBuffers for ES 2.0 profile - skipping." );
      return true;
    }

    return false;
  }
开发者ID:Shalmezad,项目名称:regal,代码行数:18,代码来源:RegalFilt.cpp

示例15: BindTexture

  bool Filt::BindTexture(const RegalContext &ctx, GLenum target, GLuint name)
  {
    UNUSED_PARAMETER(ctx);
    UNUSED_PARAMETER(target);
    UNUSED_PARAMETER(name);

    if (ctx.isES2())
    {
      switch ( target )
      {
        case GL_TEXTURE_1D:
        case GL_TEXTURE_3D:
          Warning( "Regal does not support ", GLenumToString( target ), " as target for glBindTexture for ES 2.0 profile - skipping." );
          return true;
        default:
          break;
      }
    }

    return false;
  }
开发者ID:Shalmezad,项目名称:regal,代码行数:21,代码来源:RegalFilt.cpp


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