本文整理汇总了C++中GLResourceRecord::GetResourceID方法的典型用法代码示例。如果您正苦于以下问题:C++ GLResourceRecord::GetResourceID方法的具体用法?C++ GLResourceRecord::GetResourceID怎么用?C++ GLResourceRecord::GetResourceID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GLResourceRecord
的用法示例。
在下文中一共展示了GLResourceRecord::GetResourceID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void WrappedOpenGL::glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
m_Real.glFramebufferTexture2D(target, attachment, textarget, texture, level);
if(m_State >= WRITING)
{
GLResourceRecord *record = m_DeviceRecord;
if(target == eGL_DRAW_FRAMEBUFFER || target == eGL_FRAMEBUFFER)
{
if(m_DrawFramebufferRecord) record = m_DrawFramebufferRecord;
}
else
{
if(m_ReadFramebufferRecord) record = m_ReadFramebufferRecord;
}
SCOPED_SERIALISE_CONTEXT(FRAMEBUFFER_TEX2D);
Serialise_glNamedFramebufferTexture2DEXT(GetResourceManager()->GetCurrentResource(record->GetResourceID()).name,
attachment, textarget, texture, level);
if(m_State == WRITING_IDLE)
record->AddChunk(scope.Get());
else
m_ContextRecord->AddChunk(scope.Get());
}
}
示例2: glTexBufferRange
void WrappedOpenGL::glTexBufferRange(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
{
m_Real.glTexBufferRange(target, internalformat, buffer, offset, size);
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
RDCASSERT(record);
SCOPED_SERIALISE_CONTEXT(TEXBUFFER_RANGE);
Serialise_glTextureBufferRangeEXT(GetResourceManager()->GetCurrentResource(record->GetResourceID()).name,
target, internalformat, buffer, offset, size);
record->AddChunk(scope.Get());
}
}
示例3:
void WrappedOpenGL::glTexStorage1D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width)
{
m_Real.glTexStorage1D(target, levels, internalformat, width);
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
RDCASSERT(record);
SCOPED_SERIALISE_CONTEXT(TEXSTORAGE1D);
Serialise_glTextureStorage1DEXT(GetResourceManager()->GetCurrentResource(record->GetResourceID()).name,
target, levels, internalformat, width);
record->AddChunk(scope.Get());
}
}
示例4:
void WrappedOpenGL::glTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels)
{
m_Real.glTexSubImage1D(target, level, xoffset, width, format, type, pixels);
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
RDCASSERT(record);
SCOPED_SERIALISE_CONTEXT(TEXSUBIMAGE1D);
Serialise_glTextureSubImage1DEXT(GetResourceManager()->GetCurrentResource(record->GetResourceID()).name,
target, level, xoffset, width, format, type, pixels);
if(m_State == WRITING_CAPFRAME)
m_ContextRecord->AddChunk(scope.Get());
else
record->AddChunk(scope.Get());
}
}
示例5: glTexParameterfv
void WrappedOpenGL::glTexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
{
m_Real.glTexParameterfv(target, pname, params);
if(m_State >= WRITING)
{
GLResourceRecord *record = m_TextureRecord[m_TextureUnit];
RDCASSERT(record);
SCOPED_SERIALISE_CONTEXT(TEXPARAMETERFV);
Serialise_glTextureParameterfvEXT(GetResourceManager()->GetCurrentResource(record->GetResourceID()).name,
target, pname, params);
if(m_State == WRITING_IDLE)
record->AddChunk(scope.Get());
else
m_ContextRecord->AddChunk(scope.Get());
}
}
示例6: wglDXRegisterObjectNV
HANDLE WrappedOpenGL::wglDXRegisterObjectNV(HANDLE hDevice, void *dxObject, GLuint name,
GLenum type, GLenum access)
{
RDCASSERT(IsCaptureMode(m_State));
ID3D11Resource *real = UnwrapDXResource(dxObject);
if(real == NULL)
{
SetLastError(ERROR_OPEN_FAILED);
return 0;
}
WrappedHANDLE *wrapped = new WrappedHANDLE();
if(type == eGL_RENDERBUFFER)
wrapped->res = RenderbufferRes(GetCtx(), name);
else if(type == eGL_NONE)
wrapped->res = BufferRes(GetCtx(), name);
else
wrapped->res = TextureRes(GetCtx(), name);
GLResourceRecord *record = GetResourceManager()->GetResourceRecord(wrapped->res);
if(!record)
{
RDCERR("Unrecognised object with type %x and name %u", type, name);
delete wrapped;
return NULL;
}
SERIALISE_TIME_CALL(wrapped->real =
m_Real.wglDXRegisterObjectNV(hDevice, real, name, type, access));
{
RDCASSERT(record);
USE_SCRATCH_SERIALISER();
SCOPED_SERIALISE_CHUNK(gl_CurChunk);
Serialise_wglDXRegisterObjectNV(ser, wrapped->res, type, dxObject);
record->AddChunk(scope.Get());
}
if(type != eGL_NONE)
{
ResourceFormat fmt;
uint32_t width = 0, height = 0, depth = 0, mips = 0, layers = 0, samples = 0;
GetDXTextureProperties(dxObject, fmt, width, height, depth, mips, layers, samples);
// defined as arrays mostly for Coverity code analysis to stay calm about passing
// them to the *TexParameter* functions
GLint maxlevel[4] = {GLint(mips - 1), 0, 0, 0};
m_Real.glTextureParameteriEXT(wrapped->res.name, type, eGL_TEXTURE_MAX_LEVEL, GLint(mips - 1));
ResourceId texId = record->GetResourceID();
m_Textures[texId].resource = wrapped->res;
m_Textures[texId].curType = type;
m_Textures[texId].width = width;
m_Textures[texId].height = height;
m_Textures[texId].depth = RDCMAX(depth, samples);
m_Textures[texId].samples = samples;
m_Textures[texId].dimension = 2;
if(type == eGL_TEXTURE_1D || type == eGL_TEXTURE_1D_ARRAY)
m_Textures[texId].dimension = 1;
else if(type == eGL_TEXTURE_3D)
m_Textures[texId].dimension = 3;
m_Textures[texId].internalFormat = MakeGLFormat(fmt);
}
return wrapped;
}