<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          OGLplusOpenGL的C++封裝庫

          聯(lián)合創(chuàng)作 · 2023-09-29 19:32

          OGLplus (oglplus) 是一個僅包含頭文件的 C++ 語言庫,用于實(shí)現(xiàn)一個瘦面向?qū)ο蟮?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;
          }
          瀏覽 23
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  国产日韩欧美一级电影 | 午夜福利人人妻人人澡人人爽 | 亚洲欧美在线观看久99一区 | 波多野结衣香蕉 | 色婷婷AV一区二区三区之e本道 |