I am trying to use the bgl module to draw triangles on top of the Blender interface. My understanding is that glBegin/glEnd are deprecated, and vertex array or display list or VBO should be used instead.

But I can't seems to find the relevant functions I need (glDrawArray, glBindBuffer, etc) in the bgl module. Any insights?

my bgl.glGetString(bgl.GL_VERSION) is 2.1 ATI-1.8.18

  • $\begingroup$ come to think of it, I have never seen anyone with anything other than glBegin etc.. I don't think this has extended to the bgl yet, iirc only a part of ghost has it atm.. not sure.. $\endgroup$ – iKlsR Jun 11 '13 at 20:59
  • $\begingroup$ I was afraid of that, but thanks for the comment. Btw, do people think questions like this are too specific for this SE? $\endgroup$ – Mike Pan Jun 11 '13 at 21:02
  • $\begingroup$ Not at all, this is the only legible on-topic question I've seen all day. Also questions like these are bound to show up sooner or later anyways. $\endgroup$ – iKlsR Jun 11 '13 at 21:09

All the available OpenGL calls exposed in the bgl API are: https://www.blender.org/api/blender_python_api_current/bgl.html

(or in https://svn.blender.org/svnroot/bf-blender/trunk/blender/source/blender/python/generic/bgl.c without the gl prefix)

It has a few OpenGL 2.0 calls, but not even all I think. It's easy to extend it to specific functions, but we are close to the point where it makes more sense to use a full OpenGL wrapper such as PyGL (and that's why the number of functions exposed is a bit stagnated).

  • $\begingroup$ Thanks Dalai. Good to get an answer from a dev point of view. I will wait a few more days before 'accepting' this answer. $\endgroup$ – Mike Pan Jun 12 '13 at 3:11
  • 1
    $\begingroup$ Any info on when switching to something like pyopengl might happen ? $\endgroup$ – Stuart Axon Nov 17 '14 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.