Urho3D::RenderSurface Class Reference

Color or depth-stencil surface that can be rendered into. More...

#include <Urho3D/Graphics/RenderSurface.h>

Inheritance diagram for Urho3D::RenderSurface:
[legend]
Collaboration diagram for Urho3D::RenderSurface:
[legend]

Public Member Functions

 RenderSurface (Texture *parentTexture)
 Construct with parent texture.
 
 ~RenderSurface ()
 Destruct.
 
void SetNumViewports (unsigned num)
 Set number of viewports.
 
void SetViewport (unsigned index, Viewport *viewport)
 Set viewport.
 
void SetUpdateMode (RenderSurfaceUpdateMode mode)
 Set viewport update mode. Default is to update when visible.
 
void SetLinkedRenderTarget (RenderSurface *renderTarget)
 Set linked color rendertarget.
 
void SetLinkedDepthStencil (RenderSurface *depthStencil)
 Set linked depth-stencil surface.
 
void QueueUpdate ()
 Queue manual update of the viewport(s).
 
void Release ()
 Release surface.
 
void OnDeviceLost ()
 Mark the GPU resource destroyed on graphics context destruction. Only used on OpenGL.
 
bool CreateRenderBuffer (unsigned width, unsigned height, unsigned format, int multiSample)
 Create renderbuffer that cannot be sampled as a texture. Only used on OpenGL.
 
int GetWidth () const
 Return width.
 
int GetHeight () const
 Return height.
 
TextureUsage GetUsage () const
 Return usage.
 
int GetMultiSample () const
 Return multisampling level.
 
bool GetAutoResolve () const
 Return multisampling autoresolve mode.
 
unsigned GetNumViewports () const
 Return number of viewports.
 
ViewportGetViewport (unsigned index) const
 Return viewport by index.
 
RenderSurfaceUpdateMode GetUpdateMode () const
 Return viewport update mode.
 
RenderSurfaceGetLinkedRenderTarget () const
 Return linked color rendertarget.
 
RenderSurfaceGetLinkedDepthStencil () const
 Return linked depth-stencil surface.
 
bool IsUpdateQueued () const
 Return whether manual update queued. Called internally.
 
void ResetUpdateQueued ()
 Reset update queued flag. Called internally.
 
TextureGetParentTexture () const
 Return parent texture.
 
void * GetSurface () const
 Return Direct3D9 surface.
 
void * GetRenderTargetView () const
 Return Direct3D11 rendertarget or depth-stencil view. Not valid on OpenGL.
 
void * GetReadOnlyView () const
 Return Direct3D11 read-only depth-stencil view. May be null if not applicable. Not valid on OpenGL.
 
unsigned GetTarget () const
 Return surface's OpenGL target.
 
unsigned GetRenderBuffer () const
 Return OpenGL renderbuffer if created.
 
bool IsResolveDirty () const
 Return whether multisampled rendertarget needs resolve.
 
void SetResolveDirty (bool enable)
 Set or clear the need resolve flag. Called internally by Graphics.
 
- Public Member Functions inherited from Urho3D::RefCounted
 RefCounted ()
 Construct. Allocate the reference count structure and set an initial self weak reference.
 
virtual ~RefCounted ()
 Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
 
void AddRef ()
 Increment reference count. Can also be called outside of a SharedPtr for traditional reference counting.
 
void ReleaseRef ()
 Decrement reference count and delete self if no more references. Can also be called outside of a SharedPtr for traditional reference counting.
 
int Refs () const
 Return reference count.
 
int WeakRefs () const
 Return weak reference count.
 
RefCountRefCountPtr ()
 Return pointer to the reference count structure.
 

Private Attributes

TextureparentTexture_
 Parent texture.
 
union {
   void *   surface_
 Direct3D9 surface.
 
   void *   renderTargetView_
 Direct3D11 rendertarget or depth-stencil view.
 
   unsigned   renderBuffer_
 OpenGL renderbuffer name.
 
}; 
 
union {
   void *   readOnlyView_
 Direct3D11 read-only depth-stencil view. Present only on depth-stencil surfaces.
 
   unsigned   target_
 OpenGL target.
 
}; 
 
Vector< SharedPtr< Viewport > > viewports_
 Viewports.
 
WeakPtr< RenderSurfacelinkedRenderTarget_
 Linked color buffer.
 
WeakPtr< RenderSurfacelinkedDepthStencil_
 Linked depth buffer.
 
RenderSurfaceUpdateMode updateMode_
 Update mode for viewports.
 
bool updateQueued_
 Update queued flag.
 
bool resolveDirty_
 Multisampled resolve dirty flag.
 

Friends

class Texture2D
 
class Texture2DArray
 
class TextureCube
 

Detailed Description

Color or depth-stencil surface that can be rendered into.


The documentation for this class was generated from the following files:
  • Source/Urho3D/Graphics/RenderSurface.h
  • Source/Urho3D/Graphics/OpenGL/OGLRenderSurface.cpp
  • Source/Urho3D/Graphics/RenderSurface.cpp