OpenGL 的 C++ 封裝庫,OGLplus 0.56.0 發布
OGLplus 0.56.0 發布,此版本更新了類 ``ClientContext``;添加了大量的新 getter/setter 函數到 ``Context``;更新 GLM 的互操作性;更新 Quickbook 文檔和構建系統。
改進記錄
=======
- The ``oglplus::ClientContext`` class was updated, wrappers for new state variables and functions were added..
- The ``EnumAssocType`` and ``EnumAssocGLType`` templates and their specializations were added.
- Many new getter/setter functions were added to ``oglplus::Context``.
- The Quickbook documentation was updated.
- Minor changes in the error reporting in the low-profile mode were made.
- A problem with the wxGL harness on Windows was fixed.
- The tools for auto-generating of the enumeration headers were updated and the headers were re-generated.
- Several minor changes were made to the enumerations types.
- New options were added to the configure.bat script.
- Detection of support for strongly-typed enum template parameters was added.
OGLplus (oglplus) 是一個僅包含頭文件的 C++ 語言庫,用于實現一個瘦面向對象的 OpenGL 門面操作接口,提供了自動資源和對象管理的封裝,讓在 C++ 中使用 OpenGL 更加簡單和安全。
#include <oalplus/al.hpp> #include <oalplus/all.hpp> #include <oalplus/alut.hpp> #include <chrono> #include <thread> int main(int argc, char** argv) { // open the default device oalplus::Device device; // create a context using the device and make it current oalplus::CurrentContext context(device); // create an instance of ALUT oalplus::ALUtilityToolkit alut(false, argc, argv); // create a listener and set its position, velocity and orientation oalplus::Listener listener; 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); // create a Hello World sound and store it into a buffer oalplus::Buffer buffer = alut.CreateBufferHelloWorld(); // create a source from the data in buffer and set its position oalplus::Source source; source.Buffer(buffer); source.Position(0.0f, 0.0f,-1.0f); // let the source play the sound source.Play(); // wait for a while std::chrono::seconds duration(2); std::this_thread::sleep_for(duration); // return 0; }
來自:http://www.oschina.net/news/58405/oglplus-0-56-0