本文整理汇总了C++中OGLPLUS_CHECK函数的典型用法代码示例。如果您正苦于以下问题:C++ OGLPLUS_CHECK函数的具体用法?C++ OGLPLUS_CHECK怎么用?C++ OGLPLUS_CHECK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OGLPLUS_CHECK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetInfoLog
OGLPLUS_LIB_FUNC
String GetInfoLog(
GLuint object_name,
void (GLAPIENTRY *GetObjectiv)(GLuint, GLenum, GLint*),
void (GLAPIENTRY *GetObjectInfoLog)(GLuint, GLsizei, GLsizei*, GLchar*),
const char* name_GetObjectiv,
const char* name_GetObjectInfoLog
)
#if !OGLPLUS_LINK_LIBRARY || defined(OGLPLUS_IMPLEMENTING_LIBRARY)
{
int length = 0;
GetObjectiv(object_name, GL_INFO_LOG_LENGTH, &length);
OGLPLUS_CHECK(OGLPLUS_ERROR_INFO_STR(name_GetObjectiv));
if(length > 0)
{
GLsizei real_length = 0;
std::vector<GLchar> buffer(length);
GetObjectInfoLog(
object_name,
buffer.size(),
&real_length,
buffer.data()
);
OGLPLUS_CHECK(OGLPLUS_ERROR_INFO_STR(name_GetObjectInfoLog));
return String(buffer.data(), buffer.size());
}
else return String();
}
示例2: GetCounters
/**
* @glsymbols
* @glfunref{GetPerfMonitorCountersAMD}
*/
void GetCounters(
GLint& max_active_counters,
std::vector<PerfMonitorAMDCounter>& counters
) const
{
GLint count = 0;
OGLPLUS_GLFUNC(GetPerfMonitorCountersAMD)(
_group,
&count,
&max_active_counters,
0,
nullptr
);
OGLPLUS_CHECK(OGLPLUS_ERROR_INFO(GetPerfMonitorCountersAMD));
std::vector<GLuint> buffer(count);
OGLPLUS_GLFUNC(GetPerfMonitorCountersAMD)(
_group,
&count,
&max_active_counters,
buffer.size(),
buffer.data()
);
OGLPLUS_CHECK(OGLPLUS_ERROR_INFO(GetPerfMonitorCountersAMD));
counters.clear();
counters.reserve(count);
for(auto i=buffer.begin(), e=buffer.end(); i!=e; ++i)
counters.push_back(PerfMonitorAMDCounter(_group, *i));
}
示例3: Result
/**
* @glsymbols
* @glfunref{GetPerfMonitorCounterDataAMD}
* @gldefref{PERFMON_RESULT_SIZE_AMD}
* @gldefref{PERFMON_RESULT_AMD}
*/
void Result(std::vector<PerfMonitorAMDResult>& results) const
{
GLuint size = 0;
OGLPLUS_GLFUNC(GetPerfMonitorCounterDataAMD)(
this->_name,
GL_PERFMON_RESULT_SIZE_AMD,
sizeof(size),
&size,
nullptr
);
OGLPLUS_CHECK(
GetPerfMonitorCounterDataAMD,
ObjectError,
Object(*this)
);
std::vector<GLuint> data(size / sizeof(GLuint));
OGLPLUS_GLFUNC(GetPerfMonitorCounterDataAMD)(
this->_name,
GL_PERFMON_RESULT_AMD,
data.size() * sizeof(GLuint),
data.data(),
nullptr
);
OGLPLUS_CHECK(
GetPerfMonitorCounterDataAMD,
ObjectError,
Object(*this)
);
results.clear();
results.reserve(data.size() / 3);
auto i = data.begin(), e = data.end();
while(i != e)
{
GLuint group = *i++;
assert(i != e);
GLuint ctr = *i++;
assert(i != e);
PerfMonitorAMDCounter counter(group, ctr);
auto type = counter.Type();
GLuint lo = *i++, hi = 0;
if(type == PerfMonitorAMDType::UnsignedInt64)
hi = *i++;
results.push_back(PerfMonitorAMDResult(counter, lo, hi));
}
}
示例4: ActiveUniformBlockInfo
ActiveUniformBlockInfo(
ProgramInterfaceContext& context,
GLuint index
): _index(0)
{
GLint length = 0;
OGLPLUS_GLFUNC(GetProgramiv)(
context.Program(),
GL_UNIFORM_BLOCK_NAME_LENGTH,
&length
);
if(context.Buffer().size() < size_t(length))
context.Buffer().resize(length);
OGLPLUS_VERIFY(OGLPLUS_OBJECT_ERROR_INFO(
GetProgramiv,
Program,
nullptr,
context.Program()
));
GLsizei strlen = 0;
OGLPLUS_GLFUNC(GetActiveUniformBlockName)(
context.Program(),
index,
context.Buffer().size(),
&strlen,
context.Buffer().data()
);
OGLPLUS_CHECK(OGLPLUS_OBJECT_ERROR_INFO(
GetActiveUniformBlockName,
Program,
nullptr,
context.Program()
));
_name = String(context.Buffer().data(), strlen);
}
示例5: VertexAttribIOffset
/**
* @glsymbols
* @glfunref{VertexArrayVertexAttribIOffsetEXT}
*/
const ObjectOps& VertexAttribIOffset(
BufferName buffer,
VertexAttribSlot location,
GLint values_per_vertex,
DataType data_type,
GLsizei stride,
GLintptr offset
) const
{
OGLPLUS_GLFUNC(VertexArrayVertexAttribIOffsetEXT)(
_name,
GetGLName(buffer),
GLuint(location),
values_per_vertex,
GLenum(data_type),
stride,
offset
);
OGLPLUS_CHECK(
VertexArrayVertexAttribIOffsetEXT,
ObjectError,
Object(*this).
Index(GLuint(location))
);
return *this;
}
示例6: ScissorBox
/**
* @throws Error
*
* @glvoereq{4,1,ARB,viewport_array}
* @glsymbols
* @glfunref{Get}
* @gldefref{SCISSOR_BOX}
*/
static ScissorRectangle ScissorBox(GLuint viewport)
{
ScissorRectangle result;
OGLPLUS_GLFUNC(GetIntegeri_v)(GL_SCISSOR_BOX, viewport,result._v);
OGLPLUS_CHECK(OGLPLUS_ERROR_INFO(GetIntegeri_v));
return result;
}
示例7: GetLocation
/** Finds the location / index of the fragment data specified
* by @p identifier in a @p program. If active_only is true then
* throws if no such fragment data output exists or if it is not active.
*
* @glsymbols
* @glfunref{GetFragDataLocation}
*/
static GLint GetLocation(
ProgramName program,
StrCRef identifier,
bool active_only
)
{
GLint result = OGLPLUS_GLFUNC(GetFragDataLocation)(
GetGLName(program),
identifier.c_str()
);
OGLPLUS_CHECK(
GetFragDataLocation,
ProgVarError,
Program(program).
Identifier(identifier)
);
OGLPLUS_HANDLE_ERROR_IF(
active_only && (result < 0),
GL_INVALID_OPERATION,
MsgGettingInactive(),
ProgVarError,
Program(program).
Identifier(identifier)
);
return result;
}
示例8: LPointer
/**
* @glsymbols
* @glfunref{VertexAttribPointer}
*/
const VertexAttribArray& LPointer(
GLuint values_per_vertex,
DataType data_type,
GLsizei stride,
const void* pointer
) const
{
#if GL_VERSION_4_2 || GL_ARB_vertex_attrib_64bit
OGLPLUS_GLFUNC(VertexAttribLPointer)(
_location,
values_per_vertex,
GLenum(data_type),
stride,
pointer
);
OGLPLUS_CHECK(OGLPLUS_ERROR_INFO(VertexAttribLPointer));
#else
assert(!
"The glVertexAttribLPointer function is "
"required but not available! Double-precision "
"vertex attribute values are not supported."
);
#endif
return *this;
}
示例9: SelectCounters
/**
* The @p counters must be from the same group.
*
* @glsymbols
* @glfunref{SelectPerfMonitorCountersAMD}
*/
void SelectCounters(
bool enable,
const std::vector<PerfMonitorAMDCounter>& counters
) const
{
if(counters.empty()) return;
std::vector<GLuint> list(counters.size());
GLuint group = counters[0]._group;
for(size_t i=0, n=counters.size(); i!=n; ++i)
{
assert(group == counters[i]._group);
list[i] = counters[i]._counter;
}
OGLPLUS_GLFUNC(SelectPerfMonitorCountersAMD)(
this->_name,
enable? GL_TRUE: GL_FALSE,
group,
GLint(list.size()),
list.data()
);
OGLPLUS_CHECK(
SelectPerfMonitorCountersAMD,
ObjectError,
Object(*this)
);
}
示例10: BufferBase
ObjectOps& BufferBase(GLuint index, BufferName buffer) {
OGLPLUS_GLFUNC(TransformFeedbackBufferBase)
(_obj_name(), index, GetGLName(buffer));
OGLPLUS_CHECK(
TransformFeedbackBufferBase,
ObjectPairError,
Subject(buffer).Object(*this).Index(index));
return *this;
}
示例11: MakeNonResident
/**
* @glextreq{NV,shader_buffer_load}
* @glsymbols
* @glfunref{MakeNamedBufferNonResidentNV}
*
* @throws Error
*/
void MakeNonResident(void) const
{
OGLPLUS_GLFUNC(MakeNamedBufferNonResidentNV)(_name);
OGLPLUS_CHECK(
MakeNamedBufferNonResidentNV,
ObjectError,
Object(*this)
);
}
示例12: Disable
/**
* @glsymbols
* @glfunref{DisableVertexArrayAttribEXT}
*/
const DSAVertexArrayAttribEXT& Disable(void) const
{
OGLPLUS_GLFUNC(DisableVertexArrayAttribEXT)(
_vao,
GLuint(_location)
);
OGLPLUS_CHECK(OGLPLUS_ERROR_INFO(DisableVertexArrayAttribEXT));
return *this;
}
示例13: DepthRange
/**
* @throws Error
*
* @glsymbols
* @glfunref{DepthRangeIndexed}
*/
static void DepthRange(GLuint viewport, GLclampd near_val, GLclampd far_val)
{
OGLPLUS_GLFUNC(DepthRangeIndexed)(viewport, near_val, far_val);
OGLPLUS_CHECK(
DepthRangeIndexed,
Error,
Index(viewport)
);
}
示例14: Begin
/**
* @glsymbols
* @glfunref{BeginPerfMonitorAMD}
*/
void Begin(void) const
{
OGLPLUS_GLFUNC(BeginPerfMonitorAMD)(this->_name);
OGLPLUS_CHECK(
BeginPerfMonitorAMD,
ObjectError,
Object(*this)
);
}
示例15: BindLocation
/**
* @see GetLocation
* @see QueryLocation
*
* @glsymbols
* @glfunref{BindFragDataLocation}
*/
static void BindLocation(
ProgramName program, FragDataSlot location, StrCRef identifier) {
OGLPLUS_GLFUNC(BindFragDataLocation)
(GetGLName(program), GLuint(location), identifier.c_str());
OGLPLUS_CHECK(
BindFragDataLocation,
ProgVarError,
Program(program).Identifier(identifier).Index(GLuint(location)));
}