GLBase
Description
Full source code is included in the Tinman 3D SDK download. |
Abstract base class for NativeLibrary implementations that access a native GL-style API.
Public constants define enumeration items that may be passed to or returned from API commands. The documentation links to the API version or API extension that has introduced the enumeration item.
For example:
Public constant BLEND_SRC_ALPHA
for API enumeration item GL_BLEND_SRC_ALPHA
(32971), introduced by API version GL_VERSION_1_4
(i.e. OpenGL 1.4).
Public attributes of type bool
are used to indicate the availability of those API extensions that can be accessed directly through the wrapper. The documentation links to the API enumeration items and commands that are used by the API extension. The full list of available extensions may be queried via Extensions.
For example:
Public attribute GL_NV_mesh_shader
.
Public methods represent the API commands, where method signatures closely model the command parameters, without imposing convenience layers dealing with marshalling or abstraction. Use the Wrap
methods to pass per-reference arguments.
Calling an API command may generate zero or more errors, which must be reported by subclasses by implementing the FetchLastError method. Use the ResetErrors and ThrowOnError methods to perform error handling.
Public / Constructors
Create
Creates a GLBase object for the given api in, using the specified context in for function pointer retrieval.
This method requires that there is a current render context for the calling thread.
Public / Methods
ResetErrors
Resets all GL errors that have been recorded so far.
This method calls FetchLastError repeatedly until it returns 0
.
- See also
ThrowOnError
Throws an exception if the GL has recorded an error.
This method calls FetchLastError repeatedly until it returns 0
. If at least one call has returned a non-zero error value, an exception is thrown. Otherwise it returns normally.
- RenderException
-
If a non-zero error value has been recorded.
- See also
Wrap
12 overloads
Wraps the given value in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
Wraps the given values in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
Wraps the given values in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
Wraps the given values in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
Wraps the given value in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
Wraps the given values in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
Wraps the given values in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
Wraps the given values in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
Wraps the given value in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
Wraps the given values in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
Wraps the given values in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
Wraps the given values in an array.
The returned array will remain valid until a Wrap*
method is called again.
- See also
WrapFloat
Returns a wrapper array.
The returned array will remain valid until a Wrap*
method is called again.
Protected / Methods
Has
Checks if the given extension is present.
This is a convenience method intended for use by implementations of NativeLibrary.InitializeFunctionPointers.
LookupExtensions
Returns the supported API extensions.
This method is called repeatedly during the first time the Extensions property is accessed or the Has method is called, until it returns null
.