Page MenuHome

Python bgl docs still includes deprecated OpenGL functions
Closed, ResolvedPublic

Description

System Information
Operating system: windows 10 64
Graphics card: ----

Blender Version
Broken:
2.80 hash: 1b6da95ccb11, data: 2019-01-25

Short description of error
The library is missing glVertex.
https://i.imgur.com/fHTSY3X.png
Exact steps for others to reproduce the error
import bgl. enter bgl. press ctrl+space

Event Timeline

Vlad (Darcvizer) updated the task description. (Show Details)
Brecht Van Lommel (brecht) renamed this task from The library is missing glVertex. to Python bgl docs still includes deprecated OpenGL functions.Jan 26 2019, 2:36 PM
Brecht Van Lommel (brecht) triaged this task as Confirmed, Medium priority.

These functions are no longer available, it is the documentation that needs updating:
https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Draw_API

@Brecht Van Lommel (brecht), is doc/python_api/rst/bgl.rst all handwritten, or is it generated?

Maybe it was generated at one point, but I can't find anything about that in git history.

You could try auto-generating it from this if it's not too much work to extract the basic descriptions and argument types:
https://github.com/KhronosGroup/OpenGL-Refpages/tree/master/gl4

Hmm, I could do it but it does not feel like it is worth it.
Maybe we should just link to http://docs.gl/ and mention how bgl differs from the C functions.
I guess the main difference is that bgl.Buffer has toused as parameter instead of a pointer.

There is great OpenGL documentation out there; I don't think we can do much better than that. By outsourcing this part, we can focus more on creating better examples on how to use the functions in Blender.

That seems fine, I guess we can just link to the OpenGL reference docs for each function.

We should probably link to the official reference rather than docs.gl:
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/

I would be happy to give an example of how to transfer the coordinates of a real object, rather than enter them manually.
https://docs.blender.org/api/blender2.8/gpu.html#wireframe-cube-using-index-buffer