Draw some 2D graphics like glVertex2d #1207
Replies: 3 comments 1 reply
-
Qt API questions are best asked in Qt forums, this community is focused on Vulkan/VulkanSceneGraph. However, if you are actually asking a more general question then Vulkan doesn't have any functionality like glVertex2d, and even on the OpenGL side glVertex2d is deprecated in favour of using vertex arrays and primitive sets. Essentially you'll just have to pack your chain of vertex into a vsg::vec3Array and your pirmitive indices into a vsg::shortArray and assign them to a vsg::VertexDraw/VertexIndexDraw. |
Beta Was this translation helpful? Give feedback.
-
okay,I would use vsg::VertexDraw/VertexIndexDraw to implement it. |
Beta Was this translation helpful? Give feedback.
-
If you are incrementally adding vertices such as a with drawing on screen then allocate a big enough vsg::vec3Array etc. to handle all the possible vertices and change the number of primitives draw updating the counts in vsg::VertexDraw/VerexIndexDraw. Allocate the vsg::vec3Array as dynamic data. Have a look at the section of the vsgTutorial on dynamic data updates. |
Beta Was this translation helpful? Give feedback.
-
Hi everybody.
Is there any way to draw 2d graphics in QT like glVertex2d?
Beta Was this translation helpful? Give feedback.
All reactions