Class GLGraphicsContext
Manages all graphical functionality.
Inherited Members
Namespace: Evergine.OpenGL
Assembly: Evergine.OpenGL.dll
Syntax
public class GLGraphicsContext : GraphicsContext, IDisposable, IGetNativePointers
  Constructors
GLGraphicsContext()
Initializes a new instance of the GLGraphicsContext class.
Declaration
public GLGraphicsContext()
  GLGraphicsContext(GraphicsBackend?)
Initializes a new instance of the GLGraphicsContext class.
Declaration
public GLGraphicsContext(GraphicsBackend? targetGraphicsBackend)
  Parameters
| Type | Name | Description | 
|---|---|---|
| GraphicsBackend? | targetGraphicsBackend | The target graphics backend with this graphic context.  | 
      
Fields
ComputePipelineStateCache
Compute pipeline state cache.
Declaration
protected GLComputePipelineStateCache ComputePipelineStateCache
  Field Value
| Type | Description | 
|---|---|
| GLComputePipelineStateCache | 
Extensions
OpenGL extensions.
Declaration
public GLExtensions Extensions
  Field Value
| Type | Description | 
|---|---|
| GLExtensions | 
GraphicsContext
Graphics context.
Declaration
protected IOpenGLContext GraphicsContext
  Field Value
| Type | Description | 
|---|---|
| IOpenGLContext | 
GraphicsPipelineStateCache
Graphics pipeline state cache.
Declaration
protected GLGraphicsPipelineStateCache GraphicsPipelineStateCache
  Field Value
| Type | Description | 
|---|---|
| GLGraphicsPipelineStateCache | 
Properties
BackendType
Gets the backend type (DirectX, OpenGL ...)
Declaration
public override GraphicsBackend BackendType { get; }
  Property Value
| Type | Description | 
|---|---|
| GraphicsBackend | 
Overrides
Capabilities
Gets the capabilities of this graphics context.
Declaration
public override GraphicsContextCapabilities Capabilities { get; }
  Property Value
| Type | Description | 
|---|---|
| GraphicsContextCapabilities | 
Overrides
NativeDevicePointer
Gets the native device pointer.
Declaration
public override IntPtr NativeDevicePointer { get; }
  Property Value
| Type | Description | 
|---|---|
| IntPtr | 
Overrides
Methods
CreateDefaultSampler()
Create the default sampler.
Declaration
protected override void CreateDefaultSampler()
  Overrides
CreateDeviceInternal()
Initialize the graphics context to be used in a compute shader.
Declaration
public override void CreateDeviceInternal()
  Overrides
CreateSwapChain(SwapChainDescription)
Initialize the swapchain.
Declaration
public override SwapChain CreateSwapChain(SwapChainDescription description)
  Parameters
| Type | Name | Description | 
|---|---|---|
| SwapChainDescription | description | The swapchain descriptor.  | 
      
Returns
| Type | Description | 
|---|---|
| SwapChain | Created Swapchain.  | 
      
Overrides
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
Declaration
protected override void Dispose(bool disposing)
  Parameters
| Type | Name | Description | 
|---|---|---|
| bool | disposing | 
  | 
      
Overrides
GenerateTextureMipmapping(Texture)
Generate mipmapping texture levels.
Declaration
public override bool GenerateTextureMipmapping(Texture texture)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Texture | texture | The texture to generate mipmapping.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | True if the mipmapping has been generated.  | 
      
Overrides
GetNativePointer(string, out IntPtr)
Obtain a native pointer of this graphics context using the given key.
Declaration
public override bool GetNativePointer(string pointerKey, out IntPtr nativePointer)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | pointerKey | The pointer key.  | 
      
| IntPtr | nativePointer | The native pointer.  | 
      
Returns
| Type | Description | 
|---|---|
| bool | True if there are an available pointer with this key.  | 
      
Overrides
InternalUpdateBufferData(Buffer, IntPtr, uint, uint)
Fill the buffer from a pointer.
Declaration
protected override void InternalUpdateBufferData(Buffer buffer, IntPtr source, uint sourceSizeInBytes, uint destinationOffsetInBytes = 0)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Buffer | buffer | Buffer instance.  | 
      
| IntPtr | source | The data pointer.  | 
      
| uint | sourceSizeInBytes | The size in bytes.  | 
      
| uint | destinationOffsetInBytes | The offset in bytes.  | 
      
Overrides
MapMemory(GraphicsResource, MapMode, uint)
Declaration
public override MappedResource MapMemory(GraphicsResource resource, MapMode mode, uint subResource = 0)
  Parameters
| Type | Name | Description | 
|---|---|---|
| GraphicsResource | resource | The graphics resource to map.  | 
      
| MapMode | mode | The MapMode used to map the resource.  | 
      
| uint | subResource | The subresource to map. Subresources are indexed first by mip slice and then by array layer. Only for Textures.  | 
      
Returns
| Type | Description | 
|---|---|
| MappedResource | A MappedResource structure describing the mapped data region.  | 
      
Overrides
ShaderCompile(string, string, ShaderStages, CompilerParameters)
Converts the shader source into bytecode.
Declaration
public override CompilationResult ShaderCompile(string shaderSource, string entryPoint, ShaderStages stage, CompilerParameters parameters)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | shaderSource | The shader source text.  | 
      
| string | entryPoint | The entrypoint function name.  | 
      
| ShaderStages | stage | The shader stage, ShaderStages.  | 
      
| CompilerParameters | parameters | The compiler parameters.  | 
      
Returns
| Type | Description | 
|---|---|
| CompilationResult | The shader bytecodes.  | 
      
Overrides
ToOpenGL(ElementFormat, out int, out bool)
Converts from ElementFormat to VertexAttribPointerType.
Declaration
protected VertexAttribPointerType ToOpenGL(ElementFormat format, out int size, out bool normalized)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ElementFormat | format | The element format.  | 
      
| int | size | The number of components per generic vertex attribute. Must be 1, 2, 3, 4.  | 
      
| bool | normalized | If this is a normalized format.  | 
      
Returns
| Type | Description | 
|---|---|
| VertexAttribPointerType | The VertexAttribPointerType.  | 
      
UnmapMemory(GraphicsResource, uint)
Declaration
public override void UnmapMemory(GraphicsResource resource, uint subResource = 0)
  Parameters
| Type | Name | Description | 
|---|---|---|
| GraphicsResource | resource | The graphics resource to map.  | 
      
| uint | subResource | The subresource to map. Subresources are indexed first by mip slice and then by array layer. Only for Textures.  | 
      
Overrides
UpdateTextureData(Texture, IntPtr, uint, uint)
Fill the buffer from a pointer.
Declaration
public override void UpdateTextureData(Texture texture, IntPtr source, uint sourceSizeInBytes, uint subResource = 0)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Texture | texture | Texture instance.  | 
      
| IntPtr | source | The data pointer.  | 
      
| uint | sourceSizeInBytes | The size in bytes.  | 
      
| uint | subResource | The subResource index.  |