add missing bgl and gpu api docstrings (found using docstring completeness checker)
This commit is contained in:
parent
55535b21fe
commit
9d0334bc74
|
@ -689,7 +689,7 @@ OpenGL}" and the online NeHe tutorials are two of the best resources.
|
||||||
|
|
||||||
Return the specified pixel map
|
Return the specified pixel map
|
||||||
|
|
||||||
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glGetPixelMap.xml>`_
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetPixelMap.xml>`_
|
||||||
|
|
||||||
:type map: Enumerated constant
|
:type map: Enumerated constant
|
||||||
:arg map: Specifies the name of the pixel map to return.
|
:arg map: Specifies the name of the pixel map to return.
|
||||||
|
@ -701,7 +701,7 @@ OpenGL}" and the online NeHe tutorials are two of the best resources.
|
||||||
|
|
||||||
Return the polygon stipple pattern
|
Return the polygon stipple pattern
|
||||||
|
|
||||||
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glGetPolygonStipple.xml>`_
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glGetPolygonStipple.xml>`_
|
||||||
|
|
||||||
:type mask: :class:`bgl.Buffer` object I{type GL_BYTE}
|
:type mask: :class:`bgl.Buffer` object I{type GL_BYTE}
|
||||||
:arg mask: Returns the stipple pattern. The initial value is all 1's.
|
:arg mask: Returns the stipple pattern. The initial value is all 1's.
|
||||||
|
@ -824,13 +824,25 @@ OpenGL}" and the online NeHe tutorials are two of the best resources.
|
||||||
|
|
||||||
Set the current color index
|
Set the current color index
|
||||||
|
|
||||||
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glIndex.xml>`_
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIndex.xml>`_
|
||||||
|
|
||||||
:type c: :class:`bgl.Buffer` object. Depends on function prototype.
|
:type c: :class:`bgl.Buffer` object. Depends on function prototype.
|
||||||
:arg c: Specifies a pointer to a one element array that contains the new value for
|
:arg c: Specifies a pointer to a one element array that contains the new value for
|
||||||
the current color index.
|
the current color index.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glIndexMask(mask):
|
||||||
|
|
||||||
|
Control the writing of individual bits in the color index buffers
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man2/xhtml/glIndexMask.xml>`_
|
||||||
|
|
||||||
|
:type mask: int
|
||||||
|
:arg mask: Specifies a bit mask to enable and disable the writing of individual bits
|
||||||
|
in the color index buffers.
|
||||||
|
Initially, the mask is all 1's.
|
||||||
|
|
||||||
|
|
||||||
.. function:: glInitNames():
|
.. function:: glInitNames():
|
||||||
|
|
||||||
Initialize the name stack
|
Initialize the name stack
|
||||||
|
@ -1835,7 +1847,238 @@ OpenGL}" and the online NeHe tutorials are two of the best resources.
|
||||||
:arg objx, objy, objz: Return the computed object coordinates.
|
:arg objx, objy, objz: Return the computed object coordinates.
|
||||||
|
|
||||||
|
|
||||||
class Buffer:
|
.. function:: glUseProgram(program):
|
||||||
|
|
||||||
|
Installs a program object as part of current rendering state
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glUseProgram.xml>`_
|
||||||
|
|
||||||
|
:type program: int
|
||||||
|
:arg program: Specifies the handle of the program object whose executables are to be used as part of current rendering state.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glValidateProgram(program):
|
||||||
|
|
||||||
|
Validates a program object
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glValidateProgram.xml>`_
|
||||||
|
|
||||||
|
:type program: int
|
||||||
|
:arg program: Specifies the handle of the program object to be validated.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glLinkProgram(program):
|
||||||
|
|
||||||
|
Links a program object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glLinkProgram.xml>`_
|
||||||
|
|
||||||
|
:type program: int
|
||||||
|
:arg program: Specifies the handle of the program object to be linked.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glActiveTexture(texture):
|
||||||
|
|
||||||
|
Select active texture unit.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glActiveTexture.xml>`_
|
||||||
|
|
||||||
|
:type texture: int
|
||||||
|
:arg texture: Constant in ``GL_TEXTURE0`` 0 - 8
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glAttachShader(program, shader):
|
||||||
|
|
||||||
|
Attaches a shader object to a program object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glAttachShader.xml>`_
|
||||||
|
|
||||||
|
:type program: int
|
||||||
|
:arg program: Specifies the program object to which a shader object will be attached.
|
||||||
|
:type shader: int
|
||||||
|
:arg shader: Specifies the shader object that is to be attached.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glCompileShader(shader):
|
||||||
|
|
||||||
|
Compiles a shader object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glCompileShader.xml>`_
|
||||||
|
|
||||||
|
:type shader: int
|
||||||
|
:arg shader: Specifies the shader object to be compiled.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glCreateProgram():
|
||||||
|
|
||||||
|
Creates a program object
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glCreateProgram.xml>`_
|
||||||
|
|
||||||
|
:rtype: int
|
||||||
|
:return: The new program or zero if an error occurs.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glCreateShader(shaderType):
|
||||||
|
|
||||||
|
Creates a shader object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glCreateShader.xml>`_
|
||||||
|
|
||||||
|
:type shaderType: Specifies the type of shader to be created.
|
||||||
|
Must be one of ``GL_VERTEX_SHADER``,
|
||||||
|
``GL_TESS_CONTROL_SHADER``,
|
||||||
|
``GL_TESS_EVALUATION_SHADER``,
|
||||||
|
``GL_GEOMETRY_SHADER``,
|
||||||
|
or ``GL_FRAGMENT_SHADER``.
|
||||||
|
:arg shaderType:
|
||||||
|
:rtype: int
|
||||||
|
:return: 0 if an error occurs.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glDeleteProgram(program):
|
||||||
|
|
||||||
|
Deletes a program object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glDeleteProgram.xml>`_
|
||||||
|
|
||||||
|
:type program: int
|
||||||
|
:arg program: Specifies the program object to be deleted.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glDeleteShader(shader):
|
||||||
|
|
||||||
|
Deletes a shader object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glDeleteShader.xml>`_
|
||||||
|
|
||||||
|
:type shader: int
|
||||||
|
:arg shader: Specifies the shader object to be deleted.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glDetachShader(program, shader):
|
||||||
|
|
||||||
|
Detaches a shader object from a program object to which it is attached.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glDetachShader.xml>`_
|
||||||
|
|
||||||
|
:type program: int
|
||||||
|
:arg program: Specifies the program object from which to detach the shader object.
|
||||||
|
:type shader: int
|
||||||
|
:arg shader: pecifies the program object from which to detach the shader object.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glGetAttachedShaders(program, maxCount, count, shaders):
|
||||||
|
|
||||||
|
Returns the handles of the shader objects attached to a program object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glGetAttachedShaders.xml>`_
|
||||||
|
|
||||||
|
:type program: int
|
||||||
|
:arg program: Specifies the program object to be queried.
|
||||||
|
:type maxCount: int
|
||||||
|
:arg maxCount: Specifies the size of the array for storing the returned object names.
|
||||||
|
:type count: :class:`bgl.Buffer` int buffer.
|
||||||
|
:arg count: Returns the number of names actually returned in objects.
|
||||||
|
:type shaders: :class:`bgl.Buffer` int buffer.
|
||||||
|
:arg shaders: Specifies an array that is used to return the names of attached shader objects.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glGetProgramInfoLog(program, maxLength, length, infoLog):
|
||||||
|
|
||||||
|
Returns the information log for a program object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramInfoLog.xml>`_
|
||||||
|
|
||||||
|
:type program: int
|
||||||
|
:arg program: Specifies the program object whose information log is to be queried.
|
||||||
|
:type maxLength: int
|
||||||
|
:arg maxLength: Specifies the size of the character buffer for storing the returned information log.
|
||||||
|
:type length: :class:`bgl.Buffer` int buffer.
|
||||||
|
:arg length: Returns the length of the string returned in **infoLog** (excluding the null terminator).
|
||||||
|
:type infoLog: :class:`bgl.Buffer` char buffer.
|
||||||
|
:arg infoLog: Specifies an array of characters that is used to return the information log.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glGetShaderInfoLog(program, maxLength, length, infoLog):
|
||||||
|
|
||||||
|
Returns the information log for a shader object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glGetShaderInfoLog.xml>`_
|
||||||
|
|
||||||
|
:type shader: int
|
||||||
|
:arg shader: Specifies the shader object whose information log is to be queried.
|
||||||
|
:type maxLength: int
|
||||||
|
:arg maxLength: Specifies the size of the character buffer for storing the returned information log.
|
||||||
|
:type length: :class:`bgl.Buffer` int buffer.
|
||||||
|
:arg length: Returns the length of the string returned in **infoLog** (excluding the null terminator).
|
||||||
|
:type infoLog: :class:`bgl.Buffer` char buffer.
|
||||||
|
:arg infoLog: Specifies an array of characters that is used to return the information log.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glGetProgramiv(program, pname, params):
|
||||||
|
|
||||||
|
Returns a parameter from a program object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glGetProgram.xml>`_
|
||||||
|
|
||||||
|
:type program: int
|
||||||
|
:arg program: Specifies the program object to be queried.
|
||||||
|
:type pname: int
|
||||||
|
:arg pname: Specifies the object parameter.
|
||||||
|
:type params: :class:`bgl.Buffer` int buffer.
|
||||||
|
:arg params: Returns the requested object parameter.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glIsShader(shader):
|
||||||
|
|
||||||
|
Determines if a name corresponds to a shader object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glIsShader.xml>`_
|
||||||
|
|
||||||
|
:type shader: int
|
||||||
|
:arg shader: Specifies a potential shader object.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glIsProgram(program):
|
||||||
|
|
||||||
|
Determines if a name corresponds to a program object
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glIsProgram.xml>`_
|
||||||
|
|
||||||
|
:type program: int
|
||||||
|
:arg program: Specifies a potential program object.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glGetShaderSource(shader, bufSize, length, source):
|
||||||
|
|
||||||
|
Returns the source code string from a shader object
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glGetShaderSource.xml>`_
|
||||||
|
|
||||||
|
:type shader: int
|
||||||
|
:arg shader: Specifies the shader object to be queried.
|
||||||
|
:type bufSize: int
|
||||||
|
:arg bufSize: Specifies the size of the character buffer for storing the returned source code string.
|
||||||
|
:type length: :class:`bgl.Buffer` int buffer.
|
||||||
|
:arg length: Returns the length of the string returned in source (excluding the null terminator).
|
||||||
|
:type source: :class:`bgl.Buffer` char.
|
||||||
|
:arg source: Specifies an array of characters that is used to return the source code string.
|
||||||
|
|
||||||
|
|
||||||
|
.. function:: glShaderSource(shader, shader_string):
|
||||||
|
|
||||||
|
Replaces the source code in a shader object.
|
||||||
|
|
||||||
|
.. seealso:: `OpenGL Docs <http://www.opengl.org/sdk/docs/man/xhtml/glShaderSource.xml>`_
|
||||||
|
|
||||||
|
:type shader: int
|
||||||
|
:arg shader: Specifies the handle of the shader object whose source code is to be replaced.
|
||||||
|
:type shader_string: string
|
||||||
|
:arg shader_string: The shader string.
|
||||||
|
|
||||||
|
|
||||||
|
.. class:: Buffer
|
||||||
|
|
||||||
The Buffer object is simply a block of memory that is delineated and initialized by the
|
The Buffer object is simply a block of memory that is delineated and initialized by the
|
||||||
user. Many OpenGL functions return data to a C-style pointer, however, because this
|
user. Many OpenGL functions return data to a C-style pointer, however, because this
|
||||||
|
|
|
@ -262,10 +262,16 @@ The calculation of some of the uniforms is based on matrices available in the sc
|
||||||
|
|
||||||
.. data:: GPU_DYNAMIC_SAMPLER_2DSHADOW
|
.. data:: GPU_DYNAMIC_SAMPLER_2DSHADOW
|
||||||
|
|
||||||
|
The uniform is an float representing the bumpmap scaling.
|
||||||
|
|
||||||
|
:value: 14
|
||||||
|
|
||||||
|
.. data:: GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE
|
||||||
|
|
||||||
The uniform is an integer representing a shadow buffer corresponding to a lamp
|
The uniform is an integer representing a shadow buffer corresponding to a lamp
|
||||||
casting shadow.
|
casting shadow.
|
||||||
|
|
||||||
:value: 14
|
:value: 15
|
||||||
|
|
||||||
|
|
||||||
GLSL attribute type
|
GLSL attribute type
|
||||||
|
|
|
@ -1909,7 +1909,7 @@ PyObject *BPyInit_bgl(void)
|
||||||
|
|
||||||
static PyObject *Method_ShaderSource(PyObject *UNUSED(self), PyObject *args)
|
static PyObject *Method_ShaderSource(PyObject *UNUSED(self), PyObject *args)
|
||||||
{
|
{
|
||||||
int shader;
|
unsigned int shader;
|
||||||
char *source;
|
char *source;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "Is", &shader, &source))
|
if (!PyArg_ParseTuple(args, "Is", &shader, &source))
|
||||||
|
|
|
@ -29,6 +29,7 @@ exec(compile(open(filepath).read(), filepath, 'exec'))
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
THIS_DIR = os.path.dirname(__file__)
|
THIS_DIR = os.path.dirname(__file__)
|
||||||
RST_DIR = os.path.normpath(os.path.join(THIS_DIR, "..", "..", "doc", "python_api", "rst"))
|
RST_DIR = os.path.normpath(os.path.join(THIS_DIR, "..", "..", "doc", "python_api", "rst"))
|
||||||
|
|
||||||
|
@ -138,7 +139,6 @@ def main():
|
||||||
|
|
||||||
if bge is None:
|
if bge is None:
|
||||||
print("Skipping BGE modules!")
|
print("Skipping BGE modules!")
|
||||||
continue
|
|
||||||
|
|
||||||
for filename, modname, partial_ok in modules:
|
for filename, modname, partial_ok in modules:
|
||||||
if bge is None and modname.startswith("bge"):
|
if bge is None and modname.startswith("bge"):
|
||||||
|
|
|
@ -47,7 +47,8 @@ def parse_rst_py(filepath):
|
||||||
re_prefix = re.compile(r"^\.\.\s([a-zA-Z09\-]+)::\s*(.*)\s*$")
|
re_prefix = re.compile(r"^\.\.\s([a-zA-Z09\-]+)::\s*(.*)\s*$")
|
||||||
|
|
||||||
tree = collections.defaultdict(list)
|
tree = collections.defaultdict(list)
|
||||||
|
indent_map = {}
|
||||||
|
indent_prev = 0
|
||||||
f = open(filepath, encoding="utf-8")
|
f = open(filepath, encoding="utf-8")
|
||||||
indent_lists = []
|
indent_lists = []
|
||||||
for i, line in enumerate(f):
|
for i, line in enumerate(f):
|
||||||
|
@ -70,12 +71,11 @@ def parse_rst_py(filepath):
|
||||||
members=[])
|
members=[])
|
||||||
|
|
||||||
tree[indent].append(item)
|
tree[indent].append(item)
|
||||||
|
if indent_prev < indent:
|
||||||
|
indent_map[indent] = indent_prev
|
||||||
if indent > 0:
|
if indent > 0:
|
||||||
# get the previous indent, ok this isn't fast but no matter.
|
tree[indent_map[indent]][-1].members.append(item)
|
||||||
keys = list(sorted(tree.keys()))
|
indent_prev = indent
|
||||||
key_index = keys.index(indent)
|
|
||||||
parent_indent = keys[key_index - 1]
|
|
||||||
tree[parent_indent][-1].members.append(item)
|
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
return tree[0]
|
return tree[0]
|
||||||
|
|
Loading…
Reference in New Issue