Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | List of all members
G3D::Surface2D Class Referenceabstract

Primarily for use in GUI rendering. More...

Inherits G3D::ReferenceCountedObject.

Inherited by G3D::Widget.

Public Member Functions

virtual Rect2D bounds () const =0
 Conservative 2D rendering bounds. More...
 
virtual float depth () const =0
 
2D objects are drawn from back to front, creating the perception of overlap. More...
 
virtual void render (RenderDevice *rd) const =0
 Assumes that the RenderDevice is configured in in RenderDevice::push2D mode. More...
 

Static Public Member Functions

static void sort (Array< shared_ptr< Surface2D >> &array)
 Sorts from farthest to nearest. More...
 
static void sortAndRender (RenderDevice *rd, Array< shared_ptr< Surface2D >> &array)
 Calls sort, RenderDevice::push2D, and then render on all elements. More...
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Detailed Description

Primarily for use in GUI rendering.

Member Function Documentation

◆ bounds()

virtual Rect2D G3D::Surface2D::bounds ( ) const
pure virtual

Conservative 2D rendering bounds.

Implemented in G3D::GuiWindow, G3D::GConsole, G3D::FullScreenWidget, and G3D::Widget.

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ depth()

virtual float G3D::Surface2D::depth ( ) const
pure virtual


2D objects are drawn from back to front, creating the perception of overlap.

0 = closest to the front, 1 = closest to the back.

Implemented in G3D::GuiWindow, G3D::GConsole, G3D::FullScreenWidget, and G3D::Widget.

◆ render()

virtual void G3D::Surface2D::render ( RenderDevice rd) const
pure virtual

Assumes that the RenderDevice is configured in in RenderDevice::push2D mode.

Implemented in G3D::GConsole, G3D::GuiWindow, G3D::GuiMenu, G3D::Widget, and G3D::DebugTextWidget.

◆ sort()

static void G3D::Surface2D::sort ( Array< shared_ptr< Surface2D >> &  array)
static

Sorts from farthest to nearest.

◆ sortAndRender()

static void G3D::Surface2D::sortAndRender ( RenderDevice rd,
Array< shared_ptr< Surface2D >> &  array 
)
static

Calls sort, RenderDevice::push2D, and then render on all elements.


documentation generated on Wed Nov 24 2021 08:02:00 using doxygen 1.8.15