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

C++ OGLPLUS_CHECK函数代码示例

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

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



在下文中一共展示了OGLPLUS_CHECK函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:GLDRorg,项目名称:oglplus,代码行数:28,代码来源:info_log.hpp


示例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));
	}
开发者ID:GLDRorg,项目名称:oglplus,代码行数:34,代码来源:AMD_performance_monitor.hpp


示例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));
		}
	}
开发者ID:r-lyeh-forks,项目名称:oglplus,代码行数:56,代码来源:AMD_performance_monitor.hpp


示例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);
	}
开发者ID:GLDRorg,项目名称:oglplus,代码行数:35,代码来源:program.hpp


示例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;
 }
开发者ID:zhengxiuyu,项目名称:PCISPH,代码行数:30,代码来源:vertex_array.hpp


示例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;
	}
开发者ID:BrainlessLabsInc,项目名称:oglplus,代码行数:15,代码来源:scissor_test.hpp


示例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;
	}
开发者ID:AdamSimpson,项目名称:oglplus,代码行数:33,代码来源:frag_data.hpp


示例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;
	}
开发者ID:BrainlessLabsInc,项目名称:oglplus,代码行数:29,代码来源:vertex_attrib.hpp


示例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)
		);
	}
开发者ID:r-lyeh-forks,项目名称:oglplus,代码行数:35,代码来源:AMD_performance_monitor.hpp


示例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;
 }
开发者ID:matus-chochlik,项目名称:oglplus,代码行数:9,代码来源:transform_feedback.hpp


示例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)
		);
	}
开发者ID:Extrunder,项目名称:oglplus,代码行数:16,代码来源:buffer.hpp


示例12: Disable

	/**
	 *  @glsymbols
	 *  @glfunref{DisableVertexArrayAttribEXT}
	 */
	const DSAVertexArrayAttribEXT& Disable(void) const
	{
		OGLPLUS_GLFUNC(DisableVertexArrayAttribEXT)(
			_vao,
			GLuint(_location)
		);
		OGLPLUS_CHECK(OGLPLUS_ERROR_INFO(DisableVertexArrayAttribEXT));
		return *this;
	}
开发者ID:BrainlessLabsInc,项目名称:oglplus,代码行数:13,代码来源:vertex_attrib.hpp


示例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)
		);
	}
开发者ID:MaikKlein,项目名称:oglplus,代码行数:15,代码来源:viewport.hpp


示例14: Begin

	/**
	 *  @glsymbols
	 *  @glfunref{BeginPerfMonitorAMD}
	 */
	void Begin(void) const
	{
		OGLPLUS_GLFUNC(BeginPerfMonitorAMD)(this->_name);
		OGLPLUS_CHECK(
			BeginPerfMonitorAMD,
			ObjectError,
			Object(*this)
		);
	}
开发者ID:r-lyeh-forks,项目名称:oglplus,代码行数:13,代码来源:AMD_performance_monitor.hpp


示例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)));
 }
开发者ID:matus-chochlik,项目名称:oglplus,代码行数:16,代码来源:frag_data.hpp


示例16: End

	/**
	 *  @glsymbols
	 *  @glfunref{EndPerfMonitorAMD}
	 */
	void End(void) const
	{
		OGLPLUS_GLFUNC(EndPerfMonitorAMD)(this->_name);
		OGLPLUS_CHECK(
			EndPerfMonitorAMD,
			ObjectError,
			Object(*this)
		);
	}
开发者ID:r-lyeh-forks,项目名称:oglplus,代码行数:13,代码来源:AMD_performance_monitor.hpp


示例17: Viewport

	/**
	 *  @throws Error
	 *
	 *  @glsymbols
	 *  @glfunref{ViewportIndexedfv}
	 */
	static void Viewport(GLuint viewport, const GLfloat* extents)
	{
		OGLPLUS_GLFUNC(ViewportIndexedfv)(viewport, extents);
		OGLPLUS_CHECK(
			ViewportIndexedfv,
			Error,
			Index(viewport)
		);
	}
开发者ID:MaikKlein,项目名称:oglplus,代码行数:15,代码来源:viewport.hpp


示例18: Scissor

 /**
  *  @glvoereq{4,1,ARB,viewport_array}
  *  @glsymbols
  *  @glfunref{ScissorIndexedv}
  */
 static void Scissor(GLuint viewport, GLint* v)
 {
     OGLPLUS_GLFUNC(ScissorIndexedv)(viewport, v);
     OGLPLUS_CHECK(
         ScissorIndexedv,
         Error,
         Index(viewport)
     );
 }
开发者ID:xubingyue,项目名称:oglplus,代码行数:14,代码来源:scissor_test.hpp


示例19: Apply

    /** @note Only presets from the same instance of UniformSubroutines
     *  that saved them can be loaded or applied.
     *
     *  @see Preset
     *  @see Save
     *  @see Load
     */
    void Apply(const Preset& preset) {
        assert(_program == preset._program);
        assert(_stage == preset._stage);
        assert(_get_indices().size() == preset._indices.size());

        OGLPLUS_GLFUNC(UniformSubroutinesuiv)
        (GLenum(_stage),
         GLsizei(preset._indices.size()),
         preset._indices.data());
        OGLPLUS_CHECK(UniformSubroutinesuiv, Error, EnumParam(_stage));
    }
开发者ID:matus-chochlik,项目名称:oglplus,代码行数:18,代码来源:uniform_subroutines.hpp


示例20: ViewportDepthRange

	/**
	 *  @throws Error
	 *
	 *  @glsymbols
	 *  @glfunref{Get}
	 *  @gldefref{DEPTH_RANGE}
	 */
	static oglplus::context::DepthRange ViewportDepthRange(GLuint viewport)
	{
		oglplus::context::DepthRange result;
		OGLPLUS_GLFUNC(GetFloati_v)(GL_DEPTH_RANGE, viewport,result._v);
		OGLPLUS_CHECK(
			GetFloati_v,
			Error,
			Index(viewport)
		);
		return result;
	}
开发者ID:MaikKlein,项目名称:oglplus,代码行数:18,代码来源:viewport.hpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ OGLPLUS_ERROR_INFO函数代码示例发布时间:2022-05-30
下一篇:
C++ OGDF_ASSERT函数代码示例发布时间: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