Showing posts with label VBO. Show all posts
Showing posts with label VBO. Show all posts

Monday, August 26, 2019

[OpenGL] VBO, glew, double buffer, support gdi, windows


在 Windows 系統的 OpenGL 程式,如果使用 PFD_SUPPORT_GDI 旗標 (Single Buffer),使用的 OpenGL 將會是 Microsoft 的軟體版本 (1.1.0),因而無法使用 VBO (至少需要 1.5 版以上) 。即在使用 Single Buffer 的情況下,無法使用 VBO。

glGetString(GL_VERSION) 可以取得 OpenGL 版本

變通的方法如下:
    1. 仍然使用 Double Buffer.
    2. 圖形繪製到 Front Buffer: glDrawBuffer(GL_FRONT)
    3. 繪製圖形的程式碼結束後,使用 glFlush() 送出,而不是使用 SwapBuffers()
    4. 可使用 VBO.





Thursday, March 21, 2013

[OpenGL] Display List, Vertex Array, Vertex buffer object (VBO)

Reference: http://www.songho.ca/opengl/gl_vbo.html
Reference: http://www.gamedev.net/topic/487333-glgenbuffers-vs-glgenbuffersarb/

"Using vertex array can reduce the number of function calls and redundant usage of the shared vertices. However, the disadvantage of vertex array is that vertex array functions are in the client state and the data in the arrays must be re-sent to the server each time when it is referenced.
On the other hand, display list is server side function, so it does not suffer from overhead of data transfer. But, once a display list is compiled, the data in the display list cannot be modified.
Vertex buffer object (VBO) creates "buffer objects" for vertex attributes in high-performance memory on the server side and provides same access functions to reference the arrays, which are used in vertex arrays, such as glVertexPointer(), glNormalPointer(), glTexCoordPointer(), etc."

Vertex Array: 資料存放在 Client 端, 每次畫圖時要傳送至 Server 端。可修改資料內容。
Display List: 資料放在 Serve 端(執行較快)。但不可修改資料內容。若要修改, 則必須重建 Display List。
VBO:同時兼具 Vertex Array 和 Display List 的優點。資料放在 Server 端,而且可修改資料內容。

OpenGL 1.4 版(含)之前,VBO 是 OpenGL 延伸功能 (GL_ARB_vertex_buffer_object),相關函數名後面加有 ARB。

OpenGL 1.5 版(含)之後,VBO 是 OpenGL 內函功能,相關函數名後面不加 ARB。

[Qt] 執行檔需要哪些 Dll?

 1. 使用 Qt  的 windeployqt.exe 工具 (在 C:\Qt\Qt5.14.1\5.14.1\msvc2017\bin\)。   a. 把執行檔 myProgram.exe 放在某個資料夾。   b. 在檔案總管這個資料夾按 Shift 和滑鼠右鍵,開啟 Po...