Device ClassDelta Engine Documentation
The graphics device clears everything via at the beginning of each frame and shows the render buffer on screen at the end of each frame via . Clear Present View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Graphics Device
    DeltaEngine.Graphics.BaseOpenGL11 OpenGL11Device
    DeltaEngine.Graphics.BaseOpenGL20 OpenGL20Device
    DeltaEngine.Graphics.Mocks MockDevice
    DeltaEngine.Graphics.SharpDX SharpDXDevice
    DeltaEngine.Graphics.SlimDX SlimDXDevice
    DeltaEngine.Graphics.Xna XnaDevice

Namespace: DeltaEngine.Graphics
Assembly: DeltaEngine.Graphics (in DeltaEngine.Graphics.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public abstract class Device : IDisposable

The Device type exposes the following members.

Constructors

  NameDescription
Protected methodDevice
Initializes a new instance of the Device class
Top
Methods

  NameDescription
Public methodClear
Public methodCreateCircularBuffer
Protected methodDisableCulling
Public methodDisableDepthTest
Public methodDispose
Releases all resources used by the Device
Protected methodEnableClockwiseBackfaceCulling
Public methodEnableDepthTest
Protected methodOnFullscreenChanged
Public methodPresent
Public methodSet2DMode
Public methodSet3DMode
Public methodSetBlendMode
Public methodSetModelViewProjectionMatrixFor2D
Public methodSetViewport
Top
Fields

  NameDescription
Protected fieldwindow
Top
Properties

  NameDescription
Public propertyCameraInvertedViewMatrix
Public propertyCameraProjectionMatrix
Public propertyCameraViewMatrix
Public propertyCullingMode
Public propertyCurrentlyUsedShader
Public propertyModelViewProjectionMatrix
Top
Events

  NameDescription
Public eventOnSet3DMode
Top
Remarks

Tests: DeltaEngine.Graphics.Tests.DeviceTests
Examples

6 unit tests call DeltaEngine.Graphics.Device
[Test, ApproveFirstFrameScreenshot]
public void DrawRedBackground()
{
    Resolve<Window>().BackgroundColor = Color.Red;
}
[Test]
public void SizeChanged()
{
    Resolve<Window>().ViewportPixelSize = new Size(200, 100);
    Assert.AreEqual(new Size(200, 100), Resolve<Window>().ViewportPixelSize);
}
[Test, ApproveFirstFrameScreenshot]
public void SetFullscreenModeToJustWindowWithoutDeviceAndShowRedBackground()
{
    var settings = Resolve<Settings>();
    settings.StartInFullscreen = true; // does not mean we really go fullscreen without device!
    Resolve<Window>().BackgroundColor = Color.Red;
    settings.StartInFullscreen = false;
}
See Also