Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Algorithm implemented for drawing line in OpenGL

  1. #1
    Newbie Newbie
    Join Date
    Feb 2016
    Posts
    1

    Algorithm implemented for drawing line in OpenGL

    Do someone know, which is the algorithm implemented by OpenGL for drawing a line?
    - Bresenham or any other??

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,728
    Section 14.5.1 of the GL specification (I'm using 4.4 here) defines the line-drawing rules for OpenGL. This section firstly describes the ideal case, which it notes is a modified Bresenham, but also notes the following:
    Because the initial and final conditions of the diamond-exit rule may be difficult to implement, other line segment rasterization algorithms are allowed...
    There is therefore no specific algorithm implemented by OpenGL for lines. This should be obvious because OpenGL is not a software library, it's implemented in drivers by GPU vendors, and the line drawing method used is implementation-dependent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •