C# Class Vector.Gpu.OpenGL.Gl

Exibir arquivo Open project: sinclairzx81/vector-cs

Public Methods

Method Description
GetDelegateForExtensionMethod ( string name, Type signature ) : Delegate

Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.

GetDelegateForMethod ( string methodName, Type signature ) : Delegate

Creates a callable delegate for the specified OpenGL function (core or extension), if it exists.

GetFunctionPointerForExtensionMethod ( string name ) : IntPtr

Retrieves the entry point for a dynamically exported OpenGL function.

The Marshal.GetDelegateForFunctionPointer method can be used to turn the return value into a call-able delegate.

This function is cross-platform. It determines the underlying platform and uses the correct wgl, glx or agl GetAddress function to retrieve the function pointer.

Marshal.GetDelegateForFunctionPointer Gl.GetDelegateForExtensionMethod
IsExtensionSupported ( string name ) : bool

Determines whether the specified OpenGL extension category is available in the current OpenGL context. Equivalent to IsExtensionSupported(name, true)

IsExtensionSupported ( string name, bool useCache ) : bool

Determines whether the specified OpenGL extension category is available in the current OpenGL context.

ReloadFunction ( string name ) : bool

Tries to reload the given OpenGL function (core or extension).

Use this function if you require greater granularity when loading OpenGL entry points.

While the automatic initialisation will load all OpenGL entry points, in some cases the initialisation can take place before an OpenGL Context has been established. In this case, use this function to load the entry points for the OpenGL functions you will need, or use ReloadFunctions() to load all available entry points.

This function will return true if the given OpenGL function exists, false otherwise. A return value of "true" does not mean that any specific OpenGL function is supported; rather it means that the string passed to this function denotes a known OpenGL function.

To query supported extensions use the IsExtensionSupported() function instead.

ReloadFunctions ( ) : void

Reloads all OpenGL functions (core and extensions).

Call this function to reload all OpenGL entry points. This should be done whenever you change the pixelformat/visual, or in the case you cannot (or do not want) to use the automatic initialisation.

Calling this function before the automatic initialisation has taken place will result in the Gl class being initialised twice. This is harmless, but, given the choice, the automatic initialisation should be preferred.

Private Methods

Method Description
NSAddressOfSymbol ( IntPtr symbol ) : IntPtr
NSIsSymbolNameDefined ( string s ) : bool
NSLookupAndBindSymbol ( string s ) : IntPtr
ParseAvailableExtensions ( ) : void

Builds a cache of the supported extensions to speed up searches.

aglGetProcAddress ( string s ) : IntPtr
glxGetProcAddress ( string s ) : IntPtr
glxGetProcAddressARB ( string s ) : IntPtr
wglGetProcAddress ( string s ) : IntPtr

Method Details

GetDelegateForExtensionMethod() public static method

Creates a System.Delegate that can be used to call a dynamically exported OpenGL function.
public static GetDelegateForExtensionMethod ( string name, Type signature ) : Delegate
name string The function string for the OpenGL function (eg. "glNewList")
signature Type The signature of the OpenGL function.
return Delegate

GetDelegateForMethod() public static method

Creates a callable delegate for the specified OpenGL function (core or extension), if it exists.
public static GetDelegateForMethod ( string methodName, Type signature ) : Delegate
methodName string The OpenGL function name (e.g. glVertex3f)
signature Type The signature of the delegate to return.
return Delegate

GetFunctionPointerForExtensionMethod() public static method

Retrieves the entry point for a dynamically exported OpenGL function.

The Marshal.GetDelegateForFunctionPointer method can be used to turn the return value into a call-able delegate.

This function is cross-platform. It determines the underlying platform and uses the correct wgl, glx or agl GetAddress function to retrieve the function pointer.

Marshal.GetDelegateForFunctionPointer Gl.GetDelegateForExtensionMethod
public static GetFunctionPointerForExtensionMethod ( string name ) : IntPtr
name string The function string for the OpenGL function (eg. "glNewList")
return IntPtr

IsExtensionSupported() public static method

Determines whether the specified OpenGL extension category is available in the current OpenGL context. Equivalent to IsExtensionSupported(name, true)
public static IsExtensionSupported ( string name ) : bool
name string The string for the OpenGL extension category (eg. "GL_ARB_multitexture")
return bool

IsExtensionSupported() public static method

Determines whether the specified OpenGL extension category is available in the current OpenGL context.
public static IsExtensionSupported ( string name, bool useCache ) : bool
name string The string for the OpenGL extension category (eg. "GL_ARB_multitexture")
useCache bool If true, the results will be cached to speed up future results.
return bool

ReloadFunction() public static method

Tries to reload the given OpenGL function (core or extension).

Use this function if you require greater granularity when loading OpenGL entry points.

While the automatic initialisation will load all OpenGL entry points, in some cases the initialisation can take place before an OpenGL Context has been established. In this case, use this function to load the entry points for the OpenGL functions you will need, or use ReloadFunctions() to load all available entry points.

This function will return true if the given OpenGL function exists, false otherwise. A return value of "true" does not mean that any specific OpenGL function is supported; rather it means that the string passed to this function denotes a known OpenGL function.

To query supported extensions use the IsExtensionSupported() function instead.

public static ReloadFunction ( string name ) : bool
name string The name of the OpenGL function (i.e. glShaderSource)
return bool

ReloadFunctions() public static method

Reloads all OpenGL functions (core and extensions).

Call this function to reload all OpenGL entry points. This should be done whenever you change the pixelformat/visual, or in the case you cannot (or do not want) to use the automatic initialisation.

Calling this function before the automatic initialisation has taken place will result in the Gl class being initialised twice. This is harmless, but, given the choice, the automatic initialisation should be preferred.

public static ReloadFunctions ( ) : void
return void