OGLplus OpenGL的C++封装库开源项目

我要开发同款
匿名用户2011年12月13日
53阅读
开发技术C/C++
所属分类程序开发、3D图形处理库
授权协议Boost

作品详情

OGLplus(oglplus)是一个仅包含头文件的C++语言库,用于实现一个瘦面向对象的OpenGL门面操作接口,提供了自动资源和对象管理的封装,让在C++中使用OpenGL更加简单和安全。

示例代码:

#include<oalplus/al.hpp>#include<oalplus/all.hpp>#include<oalplus/alut.hpp>#include<chrono>#include<thread>intmain(intargc,char**argv){//openthedefaultdeviceoalplus::Devicedevice;//createacontextusingthedeviceandmakeitcurrentoalplus::CurrentContextcontext(device);//createaninstanceofALUToalplus::ALUtilityToolkitalut(false,argc,argv);//createalistenerandsetitsposition,velocityandorientationoalplus::Listenerlistener;listener.Position(0.0f,0.0f,0.0f);listener.Velocity(0.0f,0.0f,0.0f);listener.Orientation(0.0f,0.0f,-1.0f,0.0f,1.0f,0.0f);//createaHelloWorldsoundandstoreitintoabufferoalplus::Bufferbuffer=alut.CreateBufferHelloWorld();//createasourcefromthedatainbufferandsetitspositionoalplus::Sourcesource;source.Buffer(buffer);source.Position(0.0f,0.0f,-1.0f);//letthesourceplaythesoundsource.Play();//waitforawhilestd::chrono::secondsduration(2);std::this_thread::sleep_for(duration);//return0;}
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论