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 5 of 5

Thread: Complex project, simple problem

  1. #1
    Newbie Newbie
    Join Date
    Oct 2017
    Posts
    3

    Question Complex project, simple problem

    Hi,

    I have a fairly basic problem of not being able to get glPolygonMode() to work when trying to fill polygons. In this particular branch I am trying to fill the mesh instead of having a wireframe. I use glPolygonMode() as can be seen from this commit but also note that on line 183 of main.cpp I call glDrawElements(GL_LINES, 2 * MAP_NUM_LINES , GL_UNSIGNED_INT, 0);. Could this be the problem, or am I completely missing something (which I clearly am!)?

    Thank you.

  2. #2
    Intern Contributor
    Join Date
    Dec 2016
    Posts
    58
    Do you have a buffer bound to GL_ELEMENT_ARRAY_BUFFER?

    I'm still looking through your code, so I might find it.....but haven't seen it yet.

    Jeff

  3. #3
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,124
    Quote Originally Posted by ButchDean View Post
    ...not being able to get glPolygonMode() to work when trying to fill polygons. ... I call glDrawElements(GL_LINES, ...);. Could this be the problem
    Could be. Comment out all your glDraw* calls with a primitive type having "LINE" or "POINT" in the name. Then focus on what's left.

  4. #4
    Newbie Newbie
    Join Date
    Oct 2017
    Posts
    3
    Quote Originally Posted by OceanJeff40 View Post
    Do you have a buffer bound to GL_ELEMENT_ARRAY_BUFFER?

    I'm still looking through your code, so I might find it.....but haven't seen it yet.

    Jeff
    Yes I do in mesh_generator.cpp file at lines 142 and 143.

  5. #5
    Newbie Newbie
    Join Date
    Oct 2017
    Posts
    3
    Quote Originally Posted by Dark Photon View Post
    Could be. Comment out all your glDraw* calls with a primitive type having "LINE" or "POINT" in the name. Then focus on what's left.
    I only have one call in main.cpp at line 183, and of course need that to draw.

Posting Permissions

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