One of the parameters defined during the graphics pipeline creation is the width of drawn lines. We can define it statically. But if we intend to draw multiple lines with different widths, we should specify line width as one of the dynamic states. This way, we can use the same pipeline object and specify the width of the drawn lines with a function call.
Setting line width states dynamically
How to do it...
- Take the handle of a command buffer that is being recorded and use it to initialize a variable of type VkCommandBuffer named command_buffer.
- Create a variable of type float named line_width through which the width of drawn lines will be provided.
- Call vkCmdSetLineWidth( command_buffer, line_width ) providing the command_buffer and line_width variables.