本文整理汇总了C++中vogl_context_info::supports_extension方法的典型用法代码示例。如果您正苦于以下问题:C++ vogl_context_info::supports_extension方法的具体用法?C++ vogl_context_info::supports_extension怎么用?C++ vogl_context_info::supports_extension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vogl_context_info
的用法示例。
在下文中一共展示了vogl_context_info::supports_extension方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: snapshot
bool vogl_framebuffer_attachment::snapshot(const vogl_context_info &context_info, vogl_handle_remapper &remapper, GLenum attachment, GLenum type)
{
VOGL_FUNC_TRACER
VOGL_NOTE_UNUSED(remapper);
VOGL_NOTE_UNUSED(context_info);
clear();
m_attachment = attachment;
m_type = type;
#define DO_QUERY(e) \
do \
{ \
int val = 0; \
GL_ENTRYPOINT(glGetFramebufferAttachmentParameteriv)(GL_FRAMEBUFFER, attachment, e, &val); \
VOGL_CHECK_GL_ERROR; \
m_params.insert(e, val); \
} while (0)
// TODO: Is this query really valid on default framebuffer FBO's?
DO_QUERY(GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME);
static const GLenum s_common_queries[] =
{
GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,
GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
};
for (uint32_t i = 0; i < VOGL_ARRAY_SIZE(s_common_queries); i++)
{
DO_QUERY(s_common_queries[i]);
}
if (m_type == GL_TEXTURE)
{
DO_QUERY(GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL);
DO_QUERY(GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE);
DO_QUERY(GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER);
// only need to query LAYERED if GS supported
if (context_info.supports_extension("GL_ARB_geometry_shader4"))
DO_QUERY(GL_FRAMEBUFFER_ATTACHMENT_LAYERED);
}
#undef DO_QUERY
return true;
}
示例2: snapshot
bool vogl_query_state::snapshot(const vogl_context_info &context_info, vogl_handle_remapper &remapper, GLuint64 handle, GLenum target)
{
VOGL_FUNC_TRACER
VOGL_NOTE_UNUSED(remapper);
VOGL_CHECK_GL_ERROR;
clear();
VOGL_ASSERT(handle <= cUINT32_MAX);
m_snapshot_handle = static_cast<GLuint>(handle);
m_target = target;
m_has_been_begun = GL_ENTRYPOINT(glIsQuery)(static_cast<GLuint>(handle)) != 0;
if (target != GL_NONE)
{
if (context_info.supports_extension("GL_ARB_timer_query") && GL_ENTRYPOINT(glGetQueryObjecti64v))
{
GLint64 result = 0;
GL_ENTRYPOINT(glGetQueryObjecti64v)(m_snapshot_handle, GL_QUERY_RESULT, &result);
m_prev_result = result;
}
else
{
GLuint prev_result32;
GL_ENTRYPOINT(glGetQueryObjectuiv)(m_snapshot_handle, GL_QUERY_RESULT, &prev_result32);
m_prev_result = prev_result32;
}
}
m_get_result_status = vogl_check_gl_error();
m_is_valid = true;
return true;
}
示例3:
vogleditor_stateTreeProgramItem::vogleditor_stateTreeProgramItem(QString name, QString value, vogleditor_stateTreeItem* parentNode, vogl_program_state& state, const vogl_context_info& info)
: vogleditor_stateTreeItem(name, value, parentNode),
m_pState(&state)
{
QString tmp;
// basic info
this->appendChild(new vogleditor_stateTreeProgramBoolItem("GL_LINK_STATUS", &vogl_program_state::get_link_status, this, state));
if (info.supports_extension("GL_ARB_separate_shader_objects"))
this->appendChild(new vogleditor_stateTreeProgramBoolItem("GL_PROGRAM_SEPARABLE", &vogl_program_state::get_separable, this, state));
this->appendChild(new vogleditor_stateTreeProgramBoolItem("GL_DELETE_STATUS", &vogl_program_state::get_marked_for_deletion, this, state));
this->appendChild(new vogleditor_stateTreeProgramBoolItem("GL_VALIDATE_STATUS", &vogl_program_state::get_verify_status, this, state));
if (info.get_version() >= VOGL_GL_VERSION_3_1)
{
this->appendChild(new vogleditor_stateTreeProgramUIntItem("GL_ACTIVE_UNIFORM_BLOCKS", &vogl_program_state::get_num_active_uniform_blocks, this, state));
}
// program binary
this->appendChild(new vogleditor_stateTreeItem("GL_PROGRAM_BINARY_RETRIEVABLE_HINT", "TODO", this));
this->appendChild(new vogleditor_stateTreeProgramUIntItem("GL_PROGRAM_BINARY_LENGTH", &vogl_program_state::get_program_binary_size, this, state));
this->appendChild(new vogleditor_stateTreeProgramEnumItem("GL_PROGRAM_BINARY_FORMAT", &vogl_program_state::get_program_binary_format, this, state));
if (m_pState->get_program_binary().size() > 0)
{
this->appendChild(new vogleditor_stateTreeItem("Program Binary", "TODO: open in a new tab", this));
}
// info log
this->appendChild(new vogleditor_stateTreeProgramLogItem("GL_INFO_LOG_LENGTH", &vogl_program_state::get_info_log, this, state));
// linked shaders
const vogl_unique_ptr<vogl_program_state> &linked_program = m_pState->get_link_time_snapshot();
if (linked_program.get())
{
uint num_attached_shaders = linked_program->get_shaders().size();
vogleditor_stateTreeItem* pLinkedShadersNode = new vogleditor_stateTreeItem("Linked Shaders", tmp.sprintf("[%u]", num_attached_shaders), this);
this->appendChild(pLinkedShadersNode);
for (uint i = 0; i < num_attached_shaders; i++)
{
vogl_shader_state& shader = const_cast<vogl_shader_state&>(linked_program->get_shaders()[i]);
GLuint64 shaderId = shader.get_snapshot_handle();
pLinkedShadersNode->appendChild(new vogleditor_stateTreeShaderItem(tmp.sprintf("%" PRIu64, shaderId), enum_to_string(shader.get_shader_type()), pLinkedShadersNode, shader));
}
}
// attached shaders
uint num_attached_shaders = m_pState->get_shaders().size();
vogleditor_stateTreeItem* pAttachedShadersNode = new vogleditor_stateTreeItem("GL_ATTACHED_SHADERS", tmp.sprintf("[%u]", num_attached_shaders), this);
this->appendChild(pAttachedShadersNode);
for (uint i = 0; i < num_attached_shaders; i++)
{
vogl_shader_state& shader = const_cast<vogl_shader_state&>(m_pState->get_shaders()[i]);
GLuint64 shaderId = shader.get_snapshot_handle();
pAttachedShadersNode->appendChild(new vogleditor_stateTreeShaderItem(tmp.sprintf("%" PRIu64, shaderId), enum_to_string(shader.get_shader_type()), pAttachedShadersNode, shader));
}
// active attribs
vogleditor_stateTreeItem* pAttribsNode = new vogleditor_stateTreeItem("GL_ACTIVE_ATTRIBUTES", tmp.sprintf("[%u]", m_pState->get_num_active_attribs()), this);
this->appendChild(pAttribsNode);
uint num_active_attributes = m_pState->get_attrib_state_vec().size();
for (uint i = 0; i < num_active_attributes; i++)
{
const vogl_program_attrib_state& attrib = m_pState->get_attrib_state_vec()[i];
vogleditor_stateTreeProgramAttribItem* pItem = new vogleditor_stateTreeProgramAttribItem(tmp.sprintf("%s", attrib.m_name.get_ptr()), pAttribsNode, attrib);
m_attribItems.push_back(pItem);
pAttribsNode->appendChild(pItem);
}
// uniforms
vogleditor_stateTreeItem* pUniformsNode = new vogleditor_stateTreeItem("GL_ACTIVE_UNIFORMS", tmp.sprintf("[%u]", m_pState->get_num_active_uniforms()), this);
this->appendChild(pUniformsNode);
uint num_uniforms = m_pState->get_uniform_state_vec().size();
for (uint i = 0; i < num_uniforms; i++)
{
const vogl_program_uniform_state& uniform = m_pState->get_uniform_state_vec()[i];
// pUniformsNode->appendChild(new vogleditor_stateTreeItem(QString(uniform.m_name.get_ptr()), tmp.sprintf("Loc: %d, Size: %d, Type: %s", uniform.m_base_location, uniform.m_size, enum_to_string(uniform.m_type).toStdString().c_str()), pUniformsNode));
vogleditor_stateTreeProgramUniformItem* pItem = new vogleditor_stateTreeProgramUniformItem(QString(uniform.m_name.get_ptr()), pUniformsNode, uniform);
m_uniformItems.push_back(pItem);
pUniformsNode->appendChild(pItem);
}
// uniform blocks
}
示例4: snapshot
bool vogl_sampler_state::snapshot(const vogl_context_info &context_info, vogl_handle_remapper &remapper, GLuint64 handle, GLenum target)
{
VOGL_FUNC_TRACER
VOGL_NOTE_UNUSED(remapper);
VOGL_CHECK_GL_ERROR;
(void)target;
clear();
VOGL_ASSERT(handle <= cUINT32_MAX);
m_snapshot_handle = static_cast<uint32>(handle);
bool any_gl_errors = false;
#define GET_INT(pname) \
do \
{ \
int values[4] = { 0, 0, 0, 0 }; \
GL_ENTRYPOINT(glGetSamplerParameteriv)(m_snapshot_handle, pname, values); \
if (vogl_check_gl_error()) \
any_gl_errors = true; \
m_params.insert(pname, 0, values, sizeof(values[0])); \
} while (0)
#define GET_FLOAT(pname) \
do \
{ \
float values[4] = { 0, 0, 0, 0 }; \
GL_ENTRYPOINT(glGetSamplerParameterfv)(m_snapshot_handle, pname, values); \
if (vogl_check_gl_error()) \
any_gl_errors = true; \
m_params.insert(pname, 0, values, sizeof(values[0])); \
} while (0)
GET_INT(GL_TEXTURE_MAG_FILTER);
GET_INT(GL_TEXTURE_MIN_FILTER);
GET_FLOAT(GL_TEXTURE_MIN_LOD);
GET_FLOAT(GL_TEXTURE_MAX_LOD);
GET_INT(GL_TEXTURE_WRAP_S);
GET_INT(GL_TEXTURE_WRAP_T);
GET_INT(GL_TEXTURE_WRAP_R);
GET_FLOAT(GL_TEXTURE_BORDER_COLOR);
GET_INT(GL_TEXTURE_COMPARE_MODE);
GET_INT(GL_TEXTURE_COMPARE_FUNC);
if (context_info.supports_extension("GL_EXT_texture_filter_anisotropic"))
{
GET_FLOAT(GL_TEXTURE_MAX_ANISOTROPY_EXT);
}
if (context_info.supports_extension("GL_EXT_texture_sRGB_decode"))
{
GET_INT(GL_TEXTURE_SRGB_DECODE_EXT);
}
#undef GET_INT
#undef GET_FLOAT
if (any_gl_errors)
{
clear();
vogl_error_printf("%s: GL error while enumerating sampler %" PRIu64 "'s' params\n", VOGL_METHOD_NAME, (uint64_t)handle);
return false;
}
m_is_valid = true;
return true;
}
示例5: if
vogleditor_stateTreeTextureItem::vogleditor_stateTreeTextureItem(QString name, QString value, vogleditor_stateTreeItem* parentNode, vogl_texture_state* pState, const vogl_context_info& info)
: vogleditor_stateTreeItem(name, value, parentNode),
m_pTexture(pState),
m_pDiffBaseState(NULL)
{
QString tmp;
float fVals[16];
int iVals[16];
#define STR_INT1(val) tmp.sprintf("%d", val[0])
#define GET_INT(name, num) if (m_pTexture->get_params().get<int>(name, 0, iVals, num)) { vogleditor_stateTreeStateVecIntItem* pItem = new vogleditor_stateTreeStateVecIntItem(#name, name, 0, m_pTexture->get_params(), iVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
#define GET_ENUM(name, num) if (m_pTexture->get_params().get<int>(name, 0, iVals, num)) { vogleditor_stateTreeStateVecEnumItem* pItem = new vogleditor_stateTreeStateVecEnumItem(#name, name, 0, m_pTexture->get_params(), iVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
#define GET_FLOAT(name, num) if (m_pTexture->get_params().get<float>(name, 0, fVals, num)) { vogleditor_stateTreeStateVecFloatItem* pItem = new vogleditor_stateTreeStateVecFloatItem(#name, name, 0, m_pTexture->get_params(), fVals, num, false, this); m_diffableItems.push_back(pItem); this->appendChild(pItem); }
GET_INT(GL_TEXTURE_BASE_LEVEL, 1);
int base_level = iVals[0];
GET_INT(GL_TEXTURE_MAX_LEVEL, 1);
GET_FLOAT(GL_TEXTURE_BORDER_COLOR, 4);
GET_ENUM(GL_TEXTURE_COMPARE_MODE, 1);
GET_ENUM(GL_TEXTURE_COMPARE_FUNC, 1);
GET_FLOAT(GL_TEXTURE_LOD_BIAS, 1);
GET_ENUM(GL_TEXTURE_MIN_FILTER, 1);
GET_ENUM(GL_TEXTURE_MAG_FILTER, 1);
GET_FLOAT(GL_TEXTURE_MIN_LOD, 1);
GET_FLOAT(GL_TEXTURE_MAX_LOD, 1);
GET_ENUM(GL_TEXTURE_SWIZZLE_R, 1);
GET_ENUM(GL_TEXTURE_SWIZZLE_G, 1);
GET_ENUM(GL_TEXTURE_SWIZZLE_B, 1);
GET_ENUM(GL_TEXTURE_SWIZZLE_A, 1);
GET_ENUM(GL_TEXTURE_SWIZZLE_RGBA, 4);
GET_ENUM(GL_TEXTURE_WRAP_S, 1);
GET_ENUM(GL_TEXTURE_WRAP_T, 1);
GET_ENUM(GL_TEXTURE_WRAP_R, 1);
if (!info.is_core_profile())
{
GET_ENUM(GL_GENERATE_MIPMAP, 1);
}
GET_INT(GL_TEXTURE_IMMUTABLE_FORMAT, 1);
if (info.supports_extension("GL_EXT_texture_filter_anisotropic"))
{
GET_FLOAT(GL_TEXTURE_MAX_ANISOTROPY_EXT, 1);
}
if (info.supports_extension("GL_EXT_texture_sRGB_decode"))
{
GET_ENUM(GL_TEXTURE_SRGB_DECODE_EXT, 1);
}
if (!info.is_core_profile() && info.supports_extension("GL_ARB_shadow_ambient"))
{
GET_FLOAT(GL_TEXTURE_COMPARE_FAIL_VALUE_ARB, 1);
}
if (!info.is_core_profile())
{
GET_ENUM(GL_DEPTH_TEXTURE_MODE, 1);
// TODO
//GL_TEXTURE_PRIORITY
//GL_TEXTURE_RESIDENT
}
int num_actual_levels = m_pTexture->get_num_levels();
uint num_faces = (m_pTexture->get_target() == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
for (uint face = 0; face < num_faces; face++)
{
GLenum face_target_to_query = m_pTexture->get_target();
if (m_pTexture->get_target() == GL_TEXTURE_CUBE_MAP)
face_target_to_query = GL_TEXTURE_CUBE_MAP_POSITIVE_X + face;
vogleditor_stateTreeItem* pFaceNode = this;
if (m_pTexture->get_target() == GL_TEXTURE_CUBE_MAP)
{
pFaceNode = new vogleditor_stateTreeItem(enum_to_string(face_target_to_query), "", this);
this->appendChild(pFaceNode);
}
for (int level = base_level; level < num_actual_levels; level++)
{
vogleditor_stateTreeItem* pLevelNode = new vogleditor_stateTreeItem(tmp.sprintf("Mip level %d", level), "", pFaceNode);
pFaceNode->appendChild(pLevelNode);
const vogl_state_vector& level_params = m_pTexture->get_level_params(face, level);
// TODO: Check for core vs. compat profiles and not query the old stuff
#undef GET_INT
#undef GET_ENUM
#define GET_INT(name, num) if (level_params.get<int>(name, 0, iVals, num)) { pLevelNode->appendChild(new vogleditor_stateTreeStateVecIntItem(#name, name, 0, level_params, iVals, num, false, pLevelNode)); }
#define GET_ENUM(name, num) if (level_params.get<int>(name, 0, iVals, num)) { pLevelNode->appendChild(new vogleditor_stateTreeStateVecEnumItem(#name, name, 0, level_params, iVals, num, false, pLevelNode)); }
GET_INT(GL_TEXTURE_WIDTH, 1);
GET_INT(GL_TEXTURE_HEIGHT, 1);
GET_INT(GL_TEXTURE_DEPTH, 1);
GET_ENUM(GL_TEXTURE_INTERNAL_FORMAT, 1);
//.........这里部分代码省略.........