Avara3D 0.2.0
C++ API reference
a3d::RenderContext Class Referenceabstract

Abstract rendering destination used by VisualWorld. More...

#include <a3d/render/context/RenderContext.h>

Inheritance diagram for a3d::RenderContext:
[legend]

Public Types

enum class  Antialiasing : uint8_t {
  None = 0 , Msaa2X = 2 , Msaa4X = 4 , Msaa8X = 8 ,
  Msaa16X = 16
}
 Selects multisample antialiasing requested for the rendering target. More...
 

Public Member Functions

virtual bool vSyncEnabled () const =0
 Returns whether presentation synchronization is enabled for this context. More...
 
virtual void vSyncEnabled (bool enabled)=0
 Enables or disables presentation synchronization when supported by the concrete context. More...
 
Antialiasing antialiasing () const
 Returns the antialiasing mode selected when the rendering target was created. More...
 
std::unique_ptr< Imagesnapshot () const
 Captures the current framebuffer into a new Image at framebuffer resolution. More...
 
VisualWorldvisualWorld () const
 Returns the attached VisualWorld, or nullptr if none is attached. More...
 

Detailed Description

Abstract rendering destination used by VisualWorld.

A RenderContext owns the renderer resources associated with a rendering target. A VisualWorld constructed with the context registers itself with the context; visualWorld() exposes the currently registered attachment non-owningly.

Definition at line 34 of file RenderContext.h.

Member Enumeration Documentation

◆ Antialiasing

enum class a3d::RenderContext::Antialiasing : uint8_t
strong

Selects multisample antialiasing requested for the rendering target.

Enumerator
None 

No multisample antialiasing.

Msaa2X 

Two samples per pixel.

Msaa4X 

Four samples per pixel.

Msaa8X 

Eight samples per pixel.

Msaa16X 

Sixteen samples per pixel.

Definition at line 40 of file RenderContext.h.

Member Function Documentation

◆ antialiasing()

Antialiasing a3d::RenderContext::antialiasing ( ) const

Returns the antialiasing mode selected when the rendering target was created.

◆ snapshot()

std::unique_ptr< Image > a3d::RenderContext::snapshot ( ) const

Captures the current framebuffer into a new Image at framebuffer resolution.

Returns
The captured Image, or nullptr if no renderer is available.

◆ visualWorld()

VisualWorld * a3d::RenderContext::visualWorld ( ) const

Returns the attached VisualWorld, or nullptr if none is attached.

◆ vSyncEnabled() [1/2]

virtual bool a3d::RenderContext::vSyncEnabled ( ) const
pure virtual

Returns whether presentation synchronization is enabled for this context.

Implemented in a3d::Window.

◆ vSyncEnabled() [2/2]

virtual void a3d::RenderContext::vSyncEnabled ( bool  enabled)
pure virtual

Enables or disables presentation synchronization when supported by the concrete context.

Implemented in a3d::Window.


The documentation for this class was generated from the following file: