• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetCtx函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SERIALISE_ELEMENT

bool WrappedOpenGL::Serialise_glTransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar *const*varyings, GLenum bufferMode)
{
	SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(ProgramRes(GetCtx(), program)));
	SERIALISE_ELEMENT(uint32_t, Count, count);
	SERIALISE_ELEMENT(GLenum, Mode, bufferMode);

	string *vars = m_State >= WRITING ? NULL : new string[Count];
	char **varstrs = m_State >= WRITING ? NULL : new char*[Count];

	for(uint32_t c=0; c < Count; c++)
	{
		string v = varyings && varyings[c] ? varyings[c] : "";
		m_pSerialiser->Serialise("Varying", v);
		if(vars) { vars[c] = v; varstrs[c] = (char *)vars[c].c_str(); }
	}
	
	if(m_State == READING)
	{
		m_Real.glTransformFeedbackVaryings(GetResourceManager()->GetLiveResource(id).name, Count, varstrs, Mode);
	}

	SAFE_DELETE_ARRAY(vars);
	SAFE_DELETE_ARRAY(varstrs);
	
	return true;
}
开发者ID:debaetsd,项目名称:renderdoc,代码行数:26,代码来源:gl_shader_funcs.cpp


示例2: GetResourceManager

void WrappedOpenGL::glDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
{
	m_Real.glDeleteFramebuffers(n, framebuffers);

	for(GLsizei i=0; i < n; i++)
		GetResourceManager()->UnregisterResource(FramebufferRes(GetCtx(), framebuffers[i]));
}
开发者ID:Lonesled,项目名称:renderdoc,代码行数:7,代码来源:gl_framebuffer_funcs.cpp


示例3: ShaderRes

GLuint WrappedOpenGL::glCreateShader(GLenum type)
{
	GLuint real = m_Real.glCreateShader(type);

	GLResource res = ShaderRes(GetCtx(), real);
	ResourceId id = GetResourceManager()->RegisterResource(res);

	if(m_State >= WRITING)
	{
		Chunk *chunk = NULL;

		{
			SCOPED_SERIALISE_CONTEXT(CREATE_SHADER);
			Serialise_glCreateShader(real, type);

			chunk = scope.Get();
		}

		GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
		RDCASSERT(record);

		record->AddChunk(chunk);
	}
	else
	{
		GetResourceManager()->AddLiveResource(id, res);
	}

	return real;
}
开发者ID:debaetsd,项目名称:renderdoc,代码行数:30,代码来源:gl_shader_funcs.cpp


示例4: SERIALISE_ELEMENT

bool WrappedOpenGL::Serialise_glNamedFramebufferTextureEXT(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level)
{
	SERIALISE_ELEMENT(GLenum, Attach, attachment);
	SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(TextureRes(GetCtx(), texture)));
	SERIALISE_ELEMENT(int32_t, Level, level);
	SERIALISE_ELEMENT(ResourceId, fbid, (framebuffer == 0 ? ResourceId() : GetResourceManager()->GetID(FramebufferRes(GetCtx(), framebuffer))));
	
	if(m_State < WRITING)
	{
		GLResource res = GetResourceManager()->GetLiveResource(id);
		if(fbid == ResourceId())
		{
			glNamedFramebufferTextureEXT(0, Attach, res.name, Level);
		}
		else
		{
			GLResource fbres = GetResourceManager()->GetLiveResource(fbid);
			glNamedFramebufferTextureEXT(fbres.name, Attach, res.name, Level);
		}

		if(m_State == READING)
		{
			m_Textures[GetResourceManager()->GetLiveID(id)].creationFlags |= eTextureCreate_RTV;
		}
	}

	return true;
}
开发者ID:Lonesled,项目名称:renderdoc,代码行数:28,代码来源:gl_framebuffer_funcs.cpp


示例5: ProgramRes

GLuint WrappedOpenGL::glCreateProgram()
{
	GLuint real = m_Real.glCreateProgram();
	
	GLResource res = ProgramRes(GetCtx(), real);
	ResourceId id = GetResourceManager()->RegisterResource(res);
		
	if(m_State >= WRITING)
	{
		Chunk *chunk = NULL;

		{
			SCOPED_SERIALISE_CONTEXT(CREATE_PROGRAM);
			Serialise_glCreateProgram(real);

			chunk = scope.Get();
		}

		GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
		RDCASSERT(record);
		
		// we always want to mark programs as dirty so we can serialise their
		// locations as initial state (and form a remapping table)
		GetResourceManager()->MarkDirtyResource(id);

		record->AddChunk(chunk);
	}
	else
	{
		GetResourceManager()->AddLiveResource(id, res);
	}

	return real;
}
开发者ID:debaetsd,项目名称:renderdoc,代码行数:34,代码来源:gl_shader_funcs.cpp


示例6: CoherentMapImplicitBarrier

void WrappedOpenGL::glGetNamedBufferPointervEXT(GLuint buffer, GLenum pname, void **params)
{
  CoherentMapImplicitBarrier();

  // intercept GL_BUFFER_MAP_POINTER queries
  if(pname == eGL_BUFFER_MAP_POINTER)
  {
    GLResourceRecord *record = GetResourceManager()->GetResourceRecord(BufferRes(GetCtx(), buffer));
    RDCASSERTMSG("Couldn't identify object passed to function. Mismatched or bad GLuint?", record,
                 buffer);

    if(record)
    {
      if(record->Map.status == GLResourceRecord::Unmapped)
        *params = NULL;
      else
        *params = (void *)record->Map.ptr;
    }
    else
    {
      *params = NULL;
    }
  }
  else
  {
    m_Real.glGetNamedBufferPointervEXT(buffer, pname, params);
  }
}
开发者ID:DrChat,项目名称:renderdoc,代码行数:28,代码来源:gl_get_funcs.cpp


示例7: QueryRes

void WrappedOpenGL::glGenQueries(GLsizei count, GLuint *ids)
{
	m_Real.glGenQueries(count, ids);

	for(GLsizei i=0; i < count; i++)
	{
		GLResource res = QueryRes(GetCtx(), ids[i]);
		ResourceId id = GetResourceManager()->RegisterResource(res);

		if(m_State >= WRITING)
		{
			Chunk *chunk = NULL;

			{
				SCOPED_SERIALISE_CONTEXT(GEN_QUERIES);
				Serialise_glGenQueries(1, ids+i);

				chunk = scope.Get();
			}

			GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
			RDCASSERT(record);

			record->AddChunk(chunk);
		}
		else
		{
			GetResourceManager()->AddLiveResource(id, res);
		}
	}
}
开发者ID:loosche,项目名称:renderdoc,代码行数:31,代码来源:gl_query_funcs.cpp


示例8: SERIALISE_ELEMENT

bool WrappedOpenGL::Serialise_glBindTexture(GLenum target, GLuint texture)
{
	SERIALISE_ELEMENT(GLenum, Target, target);
	SERIALISE_ELEMENT(ResourceId, Id, (texture ? GetResourceManager()->GetID(TextureRes(GetCtx(), texture)) : ResourceId()));
	
	if(m_State == WRITING_IDLE)
	{
		m_TextureRecord[m_TextureUnit]->datatype = Target;
	}
	else if(m_State < WRITING)
	{
		if(Id == ResourceId())
		{
			m_Real.glBindTexture(Target, 0);
		}
		else
		{
			GLResource res = GetResourceManager()->GetLiveResource(Id);
			m_Real.glBindTexture(Target, res.name);

			m_Textures[GetResourceManager()->GetLiveID(Id)].curType = Target;
		}
	}

	return true;
}
开发者ID:FeuernD,项目名称:renderdoc,代码行数:26,代码来源:gl_texture_funcs.cpp


示例9: GetResourceManager

void WrappedOpenGL::glDeleteTextures(GLsizei n, const GLuint *textures)
{
	m_Real.glDeleteTextures(n, textures);

	for(GLsizei i=0; i < n; i++)
		GetResourceManager()->UnregisterResource(TextureRes(GetCtx(), textures[i]));
}
开发者ID:FeuernD,项目名称:renderdoc,代码行数:7,代码来源:gl_texture_funcs.cpp


示例10: TextureRes

void WrappedOpenGL::glGenTextures(GLsizei n, GLuint* textures)
{
	m_Real.glGenTextures(n, textures);

	for(GLsizei i=0; i < n; i++)
	{
		GLResource res = TextureRes(GetCtx(), textures[i]);
		ResourceId id = GetResourceManager()->RegisterResource(res);

		if(m_State >= WRITING)
		{
			Chunk *chunk = NULL;

			{
				SCOPED_SERIALISE_CONTEXT(GEN_TEXTURE);
				Serialise_glGenTextures(1, textures+i);

				chunk = scope.Get();
			}

			GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
			RDCASSERT(record);

			record->AddChunk(chunk);
		}
		else
		{
			GetResourceManager()->AddLiveResource(id, res);
			m_Textures[id].resource = res;
			m_Textures[id].curType = eGL_UNKNOWN_ENUM;
		}
	}
}
开发者ID:FeuernD,项目名称:renderdoc,代码行数:33,代码来源:gl_texture_funcs.cpp


示例11: ProgramPipeRes

void WrappedOpenGL::glGenProgramPipelines(GLsizei n, GLuint *pipelines)
{
  m_Real.glGenProgramPipelines(n, pipelines);

  for(GLsizei i = 0; i < n; i++)
  {
    GLResource res = ProgramPipeRes(GetCtx(), pipelines[i]);
    ResourceId id = GetResourceManager()->RegisterResource(res);

    if(m_State >= WRITING)
    {
      Chunk *chunk = NULL;

      {
        SCOPED_SERIALISE_CONTEXT(GEN_PROGRAMPIPE);
        Serialise_glGenProgramPipelines(1, pipelines + i);

        chunk = scope.Get();
      }

      GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
      RDCASSERT(record);

      record->AddChunk(chunk);
    }
    else
    {
      GetResourceManager()->AddLiveResource(id, res);
    }
  }
}
开发者ID:JasonWinston,项目名称:renderdoc,代码行数:31,代码来源:gl_shader_funcs.cpp


示例12: FramebufferRes

void WrappedOpenGL::glGenFramebuffers(GLsizei n, GLuint *framebuffers)
{
	m_Real.glGenFramebuffers(n, framebuffers);

	for(GLsizei i=0; i < n; i++)
	{
		GLResource res = FramebufferRes(GetCtx(), framebuffers[i]);
		ResourceId id = GetResourceManager()->RegisterResource(res);
		
		if(m_State >= WRITING)
		{
			Chunk *chunk = NULL;

			{
				SCOPED_SERIALISE_CONTEXT(GEN_FRAMEBUFFERS);
				Serialise_glGenFramebuffers(1, framebuffers+i);

				chunk = scope.Get();
			}

			GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
			RDCASSERT(record);

			record->AddChunk(chunk);
		}
		else
		{
			GetResourceManager()->AddLiveResource(id, res);
		}
	}
}
开发者ID:Lonesled,项目名称:renderdoc,代码行数:31,代码来源:gl_framebuffer_funcs.cpp


示例13: SERIALISE_ELEMENT

bool WrappedOpenGL::Serialise_glCreateSamplers(GLsizei n, GLuint *samplers)
{
  SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(SamplerRes(GetCtx(), *samplers)));

  if(m_State == READING)
  {
    GLuint real = 0;
    m_Real.glCreateSamplers(1, &real);

    GLResource res = SamplerRes(GetCtx(), real);

    ResourceId live = m_ResourceManager->RegisterResource(res);
    GetResourceManager()->AddLiveResource(id, res);
  }

  return true;
}
开发者ID:DrChat,项目名称:renderdoc,代码行数:17,代码来源:gl_sampler_funcs.cpp


示例14: SERIALISE_ELEMENT

bool WrappedOpenGL::Serialise_glCreateQueries(GLenum target, GLsizei n, GLuint* ids)
{
	SERIALISE_ELEMENT(ResourceId, id, GetResourceManager()->GetID(QueryRes(GetCtx(), *ids)));
	SERIALISE_ELEMENT(GLenum, Target, target);

	if(m_State == READING)
	{
		GLuint real = 0;
		m_Real.glCreateQueries(Target, 1, &real);
		
		GLResource res = QueryRes(GetCtx(), real);

		ResourceId live = m_ResourceManager->RegisterResource(res);
		GetResourceManager()->AddLiveResource(id, res);
	}

	return true;
}
开发者ID:Clever-Boy,项目名称:renderdoc,代码行数:18,代码来源:gl_query_funcs.cpp


示例15: SERIALISE_ELEMENT

bool WrappedOpenGL::Serialise_glAttachShader(GLuint program, GLuint shader)
{
  SERIALISE_ELEMENT(ResourceId, progid, GetResourceManager()->GetID(ProgramRes(GetCtx(), program)));
  SERIALISE_ELEMENT(ResourceId, shadid, GetResourceManager()->GetID(ShaderRes(GetCtx(), shader)));

  if(m_State == READING)
  {
    ResourceId liveProgId = GetResourceManager()->GetLiveID(progid);
    ResourceId liveShadId = GetResourceManager()->GetLiveID(shadid);

    m_Programs[liveProgId].shaders.push_back(liveShadId);

    m_Real.glAttachShader(GetResourceManager()->GetLiveResource(progid).name,
                          GetResourceManager()->GetLiveResource(shadid).name);
  }

  return true;
}
开发者ID:JasonWinston,项目名称:renderdoc,代码行数:18,代码来源:gl_shader_funcs.cpp


示例16: GetResourceManager

void WrappedOpenGL::glAttachShader(GLuint program, GLuint shader)
{
	m_Real.glAttachShader(program, shader);
	
	if(m_State >= WRITING && program != 0 && shader != 0)
	{
		GLResourceRecord *progRecord = GetResourceManager()->GetResourceRecord(ProgramRes(GetCtx(), program));
		GLResourceRecord *shadRecord = GetResourceManager()->GetResourceRecord(ShaderRes(GetCtx(), shader));
		RDCASSERT(progRecord && shadRecord);
		{
			SCOPED_SERIALISE_CONTEXT(ATTACHSHADER);
			Serialise_glAttachShader(program, shader);

			progRecord->AddParent(shadRecord);
			progRecord->AddChunk(scope.Get());
		}
	}
}
开发者ID:debaetsd,项目名称:renderdoc,代码行数:18,代码来源:gl_shader_funcs.cpp


示例17: ProgramRes

GLuint WrappedOpenGL::glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const *strings)
{
  GLuint real = m_Real.glCreateShaderProgramv(type, count, strings);

  GLResource res = ProgramRes(GetCtx(), real);
  ResourceId id = GetResourceManager()->RegisterResource(res);

  if(m_State >= WRITING)
  {
    Chunk *chunk = NULL;

    {
      SCOPED_SERIALISE_CONTEXT(CREATE_SHADERPROGRAM);
      Serialise_glCreateShaderProgramv(real, type, count, strings);

      chunk = scope.Get();
    }

    GLResourceRecord *record = GetResourceManager()->AddResourceRecord(id);
    RDCASSERT(record);

    // we always want to mark programs as dirty so we can serialise their
    // locations as initial state (and form a remapping table)
    GetResourceManager()->MarkDirtyResource(id);

    record->AddChunk(chunk);
  }
  else
  {
    GetResourceManager()->AddLiveResource(id, res);

    vector<string> src;
    for(GLsizei i = 0; i < count; i++)
      src.push_back(strings[i]);

    GLuint sepprog = MakeSeparableShaderProgram(*this, type, src, NULL);

    auto &progDetails = m_Programs[id];

    progDetails.linked = true;
    progDetails.shaders.push_back(id);
    progDetails.stageShaders[ShaderIdx(type)] = id;

    auto &shadDetails = m_Shaders[id];

    shadDetails.type = type;
    shadDetails.sources.swap(src);
    shadDetails.prog = sepprog;

    shadDetails.Compile(*this);
  }

  return real;
}
开发者ID:JasonWinston,项目名称:renderdoc,代码行数:54,代码来源:gl_shader_funcs.cpp


示例18: GetResourceManager

void WrappedOpenGL::glCompileShader(GLuint shader)
{
  m_Real.glCompileShader(shader);

  if(m_State >= WRITING)
  {
    GLResourceRecord *record = GetResourceManager()->GetResourceRecord(ShaderRes(GetCtx(), shader));
    RDCASSERT(record);
    {
      SCOPED_SERIALISE_CONTEXT(COMPILESHADER);
      Serialise_glCompileShader(shader);

      record->AddChunk(scope.Get());
    }
  }
  else
  {
    m_Shaders[GetResourceManager()->GetID(ShaderRes(GetCtx(), shader))].Compile(*this);
  }
}
开发者ID:JasonWinston,项目名称:renderdoc,代码行数:20,代码来源:gl_shader_funcs.cpp


示例19: SCOPED_SERIALISE_CONTEXT

void WrappedOpenGL::glBindFramebuffer(GLenum target, GLuint framebuffer)
{
	if(m_State == WRITING_CAPFRAME)
	{
		SCOPED_SERIALISE_CONTEXT(BIND_FRAMEBUFFER);
		Serialise_glBindFramebuffer(target, framebuffer);
		
		m_ContextRecord->AddChunk(scope.Get());
	}

	if(framebuffer == 0 && m_State < WRITING)
		framebuffer = m_FakeBB_FBO;

	if(target == eGL_DRAW_FRAMEBUFFER || target == eGL_FRAMEBUFFER)
		m_DrawFramebufferRecord = GetResourceManager()->GetResourceRecord(FramebufferRes(GetCtx(), framebuffer));
	else
		m_ReadFramebufferRecord = GetResourceManager()->GetResourceRecord(FramebufferRes(GetCtx(), framebuffer));

	m_Real.glBindFramebuffer(target, framebuffer);
}
开发者ID:Lonesled,项目名称:renderdoc,代码行数:20,代码来源:gl_framebuffer_funcs.cpp


示例20: ShaderRes

void WrappedOpenGL::glDeleteShader(GLuint shader)
{
  m_Real.glDeleteShader(shader);

  GLResource res = ShaderRes(GetCtx(), shader);
  if(GetResourceManager()->HasCurrentResource(res))
  {
    if(GetResourceManager()->HasResourceRecord(res))
      GetResourceManager()->GetResourceRecord(res)->Delete(GetResourceManager());
    GetResourceManager()->UnregisterResource(res);
  }
}
开发者ID:JasonWinston,项目名称:renderdoc,代码行数:12,代码来源:gl_shader_funcs.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetCurPart函数代码示例发布时间:2022-05-30
下一篇:
C++ GetCtrlVal函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap