PDA

View Full Version : Complex project, simple problem



ButchDean
10-05-2017, 05:38 PM
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 (https://github.com/ButchDean/antivirus3-game-linux/tree/fillpolys) I am trying to fill the mesh instead of having a wireframe. I use glPolygonMode() as can be seen from this commit (https://github.com/ButchDean/antivirus3-game-linux/commit/0934b9835644131bf681d2c1ebce4623355b776c) but also note that on line 183 of main.cpp (https://github.com/ButchDean/antivirus3-game-linux/blob/fillpolys/base/src/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.

OceanJeff40
10-05-2017, 06:33 PM
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

Dark Photon
10-05-2017, 07:42 PM
...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.

ButchDean
10-06-2017, 06:09 PM
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 (https://github.com/ButchDean/antivirus3-game-linux/blob/fillpolys/base/src/mesh_generator.cpp) file at lines 142 and 143.

ButchDean
10-06-2017, 06:24 PM
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 (https://github.com/ButchDean/antivirus3-game-linux/blob/fillpolys/base/src/main.cpp) at line 183, and of course need that to draw.