1'''OpenGL extension ARB.program_interface_query
2
3This module customises the behaviour of the
4OpenGL.raw.GL.ARB.program_interface_query to provide a more
5Python-friendly API
6
7Overview (from the spec)
8
9	This extension provides a single unified set of query commands that can be
10	used by applications to determine properties of various interfaces and
11	resources used by program objects to communicate with application code,
12	fixed-function OpenGL pipeline stages, and other programs.  In unextended
13	OpenGL 4.2, there is a separate set of query commands for each different
14	type of interface or resource used by the program.  These different sets
15	of queries are structured nearly identically, but the queries for some
16	interfaces have limited capability (e.g., there is no ability to enumerate
17	fragment shader outputs).
18
19	With the single set of query commands provided by this extension, a
20	consistent set of queries is available for all interfaces, and a new
21	interface can be added without having to introduce a completely new set of
22	query commands.  These queries are intended to provide a superset of the
23	capabilities provided by similar queries in OpenGL 4.2, and should allow
24	for the deprecation of the existing queries.
25
26	This extension defines two terms:  interfaces and active resources.  Each
27	interface of a program object provides a way for the program to
28	communicate with application code, fixed-function OpenGL pipeline stages,
29	and other programs.  Examples of interfaces for a program object include
30	inputs (receiving values from vertex attributes or outputs of other
31	programs), outputs (sending values to other programs or per-fragment
32	operations), uniforms (receiving values from API calls), uniform blocks
33	(receiving values from bound buffer objects), subroutines and subroutine
34	uniforms (receiving API calls to indicate functions to call during program
35	execution), and atomic counter buffers (holding values to be manipulated
36	by atomic counter shader functions).  Each interface of a program has a
37	set of active resources used by the program.  For example, the resources
38	of a program's input interface includes all active input variables used by
39	the first stage of the program.  The resources of a program's uniform
40	block interface consists of the set of uniform blocks with at least one
41	member used by any shader in the program.
42
43The official definition of this extension is available here:
44http://www.opengl.org/registry/specs/ARB/program_interface_query.txt
45'''
46from OpenGL import platform, constant, arrays
47from OpenGL import extensions, wrapper
48import ctypes
49from OpenGL.raw.GL import _types, _glgets
50from OpenGL.raw.GL.ARB.program_interface_query import *
51from OpenGL.raw.GL.ARB.program_interface_query import _EXTENSION_NAME
52
53def glInitProgramInterfaceQueryARB():
54    '''Return boolean indicating whether this extension is available'''
55    from OpenGL import extensions
56    return extensions.hasGLExtension( _EXTENSION_NAME )
57
58# INPUT glGetProgramInterfaceiv.params size not checked against 'pname'
59glGetProgramInterfaceiv=wrapper.wrapper(glGetProgramInterfaceiv).setInputArraySize(
60    'params', None
61)
62# INPUT glGetProgramResourceIndex.name size not checked against 'name'
63glGetProgramResourceIndex=wrapper.wrapper(glGetProgramResourceIndex).setInputArraySize(
64    'name', None
65)
66# INPUT glGetProgramResourceName.name size not checked against bufSize
67glGetProgramResourceName=wrapper.wrapper(glGetProgramResourceName).setInputArraySize(
68    'length', 1
69).setInputArraySize(
70    'name', None
71)
72# INPUT glGetProgramResourceiv.params size not checked against bufSize
73# INPUT glGetProgramResourceiv.props size not checked against propCount
74glGetProgramResourceiv=wrapper.wrapper(glGetProgramResourceiv).setInputArraySize(
75    'length', 1
76).setInputArraySize(
77    'params', None
78).setInputArraySize(
79    'props', None
80)
81# INPUT glGetProgramResourceLocation.name size not checked against 'name'
82glGetProgramResourceLocation=wrapper.wrapper(glGetProgramResourceLocation).setInputArraySize(
83    'name', None
84)
85# INPUT glGetProgramResourceLocationIndex.name size not checked against 'name'
86glGetProgramResourceLocationIndex=wrapper.wrapper(glGetProgramResourceLocationIndex).setInputArraySize(
87    'name', None
88)
89### END AUTOGENERATED SECTION