My Project
|
a region of view port to render into. More...
#include <Viewport.h>
Classes | |
struct | ZOrderLessCompare |
Public Member Functions | |
CViewport (CViewportManager *pViewportManager) | |
virtual int | GetAttributeClassID () |
attribute class ID should be identical, unless one knows how overriding rules work. More... | |
virtual const char * | GetAttributeClassName () |
a static string, describing the attribute class object's name | |
virtual const char * | GetAttributeClassDescription () |
a static string, describing the attribute class object | |
virtual int | InstallFields (CAttributeClass *pClass, bool bOverride) |
this class should be implemented if one wants to add new attribute. More... | |
ATTRIBUTE_METHOD1 (CViewport, SetAlignment_s, const char *) | |
ATTRIBUTE_METHOD1 (CViewport, SetLeft_s, int) | |
ATTRIBUTE_METHOD1 (CViewport, GetLeft_s, int *) | |
ATTRIBUTE_METHOD1 (CViewport, SetTop_s, int) | |
ATTRIBUTE_METHOD1 (CViewport, GetTop_s, int *) | |
ATTRIBUTE_METHOD1 (CViewport, SetWidth_s, int) | |
ATTRIBUTE_METHOD1 (CViewport, GetWidth_s, int *) | |
ATTRIBUTE_METHOD1 (CViewport, SetHeight_s, int) | |
ATTRIBUTE_METHOD1 (CViewport, GetHeight_s, int *) | |
ATTRIBUTE_METHOD (CViewport, ApplyViewport_s) | |
ATTRIBUTE_METHOD1 (CViewport, GetRenderScript_s, const char **) | |
ATTRIBUTE_METHOD1 (CViewport, SetRenderScript_s, const char *) | |
ATTRIBUTE_METHOD1 (CViewport, GetRenderTargetName_s, const char **) | |
ATTRIBUTE_METHOD1 (CViewport, SetRenderTargetName_s, const char *) | |
ATTRIBUTE_METHOD1 (CViewport, GetPipelineOrder_s, int *) | |
ATTRIBUTE_METHOD1 (CViewport, SetPipelineOrder_s, int) | |
HRESULT | Render (double dTimeDelta, int nPipelineOrder) |
build the render list, and render the entire scene. More... | |
void | ApplyCamera (CAutoCamera *pCamera) |
void | OnParentSizeChanged (int nWidth, int nHeight) |
called when back buffer size changed. More... | |
void | SetActive () |
make this viewport the current active one. More... | |
virtual const std::string & | GetIdentifier () |
virtual void | SetIdentifier (const std::string &sID) |
CSceneObject * | GetScene () |
void | SetScene (CSceneObject *val) |
CAutoCamera * | GetCamera () |
void | SetCamera (CAutoCamera *val) |
CGUIRoot * | GetGUIRoot () |
void | SetGUIRoot (CGUIRoot *val) |
const std::string & | GetRenderScript () const |
void | SetRenderScript (const std::string &&val) |
const std::string & | GetRenderTargetName () const |
render target to use. More... | |
void | SetRenderTargetName (const std::string &val) |
int | GetPipelineOrder () const |
-1 or RENDER_PIPELINE_ORDER. More... | |
void | SetPipelineOrder (int val) |
void | SetPosition (const char *alignment, int left, int top, int width, int height) |
reposition the control using the same parameter definition used when control is created. More... | |
void | SetModified () |
void | GetPointOnViewport (int &x, int &y, int *pWidth, int *pHeight) |
bool | IsPointOnViewport (int x, int y) |
int | GetWidth () |
int | GetHeight () |
float | GetAspectRatio () |
void | SetAlignment (const char *alignment) |
void | SetLeft (int left) |
int | GetLeft () |
void | SetTop (int top) |
int | GetTop () |
void | SetWidth (int width) |
void | SetHeight (int height) |
ParaEngine::STEREO_EYE | GetEyeMode () const |
void | SetEyeMode (ParaEngine::STEREO_EYE val) |
ParaViewport | ApplyViewport () |
return last viewport | |
ParaViewport | SetViewport (DWORD x, DWORD y, DWORD width, DWORD height) |
void | UpdateRect () |
ParaViewport | GetTextureViewport (float fTexWidth, float fTexHeight) |
get the viewport as used for a given render target of given size. More... | |
int | GetZOrder () const |
void | SetZOrder (int val) |
bool | IsEnabled () const |
void | SetIsEnabled (bool val) |
bool | DrawQuad () |
draw post processing quad for this viewport's area. More... | |
void | GetViewportTransform (Vector2 *pvScale, Vector2 *pvOffset=NULL) |
get viewport transform in terms of scale and offset | |
![]() | |
virtual int | GetChildAttributeColumnCount () |
we support multi-dimensional child object. More... | |
virtual int | GetChildAttributeObjectCount (int nColumnIndex=0) |
get the number of child objects (row count) in the given column. More... | |
virtual IAttributeFields * | GetChildAttributeObject (int nRowIndex, int nColumnIndex=0) |
virtual IAttributeFields * | GetChildAttributeObject (const std::string &sName) |
get attribute by child object. More... | |
ATTRIBUTE_METHOD1 (IAttributeFields, GetName_s, const char **) | |
ATTRIBUTE_METHOD1 (IAttributeFields, SetName_s, const char *) | |
ATTRIBUTE_METHOD (IAttributeFields, PrintObject_s) | |
ATTRIBUTE_METHOD (IAttributeFields, AddRef_s) | |
ATTRIBUTE_METHOD1 (IAttributeFields, GetRefCount_s, int *) | |
ATTRIBUTE_METHOD1 (IAttributeFields, SetTime_s, int) | |
ATTRIBUTE_METHOD1 (IAttributeFields, GetTime_s, int *) | |
ATTRIBUTE_METHOD (IAttributeFields, Release_s) | |
virtual bool | IsModified () |
whether some of the fields are modified.It is up to the implementation class to provide this functionality if necessary. More... | |
virtual void | SetModified (bool bModified) |
set whether any field has been modified. More... | |
virtual bool | ValidateFields () |
validate all fields and return true if validation passed. More... | |
virtual string | GetValidationMessage () |
get the recent validation message due to the most recent call to ValidateFields() | |
virtual bool | ResetField (int nFieldID) |
Reset the field to its initial or default value. More... | |
virtual bool | InvokeEditor (int nFieldID, const std::string &sParameters) |
Invoke an (external) editor for a given field. More... | |
virtual bool | AddChildAttributeObject (IAttributeFields *pChild, int nRowIndex=-1, int nColumnIndex=0) |
add child object. More... | |
virtual void * | QueryObjectByName (const std::string &sObjectType) |
convert to object of a given type. More... | |
virtual void * | QueryObject (int nObjectType) |
convert to object of a given type. More... | |
virtual int | GetTime () |
get the current local time in case it is animated in milli seconds frames. More... | |
virtual void | SetTime (int nTime) |
virtual CDynamicAttributeField * | GetDynamicField (const std::string &sName) |
Get a dynamic field with a given name. More... | |
virtual CDynamicAttributeField * | GetDynamicField (int nIndex) |
Get a dynamic field with a given index. More... | |
virtual const char * | GetDynamicFieldNameByIndex (int nIndex) |
get field name by index | |
virtual int | GetDynamicFieldCount () |
how many dynamic field this object currently have. More... | |
virtual int | SetDynamicField (const std::string &sName, const CVariable &value) |
set a dynamic field with a given name. More... | |
virtual int | AddDynamicField (const std::string &sName, ATTRIBUTE_FIELDTYPE dwType) |
add dynamic field and return field index | |
virtual void | RemoveAllDynamicFields () |
remove all dynamic fields | |
virtual int | SaveDynamicFieldsToString (std::string &output) |
save only text dynamic fields to fieldname = value text strings. More... | |
virtual int | LoadDynamicFieldsFromString (const std::string &input) |
load only text dynamic fields from string More... | |
CAttributeClass * | GetAttributeClass () |
get the main attribute class object. More... | |
void | PrintObject () |
print the content of this object to a text file at temp/doc/[ClassName].txt. More... | |
![]() | |
virtual void | Clone (IObject *obj) const |
Clone the object's contains to a pointer. More... | |
virtual IObject * | Clone () const |
Clone the object's contains and return a pointer to the newly created object. More... | |
virtual bool | Equals (const IObject *obj) const |
Compare the object with another object. More... | |
virtual const IType * | GetType () const |
virtual std::string | ToString () const |
WeakPtr_type & | GetWeakReference () |
get weak reference object. More... | |
virtual int | ProcessObjectEvent (const ObjectEvent &event) |
this function is only used to backward compatibility of ParaObject:AddEvent() function. More... | |
![]() | |
void | addref () const |
add reference count of the object. More... | |
bool | delref () const |
decrease reference count of the object. More... | |
int | GetRefCount () const |
get the reference count | |
virtual int | Release () |
CRefCounted * | AddToAutoReleasePool () |
addref and releases the ownership sometime soon automatically (usually at the end of the current frame). More... | |
Protected Member Functions | |
float | GetStereoEyeSeparation () |
![]() | |
virtual CAttributeClass * | CreateAttributeClass () |
initialize fields | |
virtual CDynamicAttributesSet * | GetDynamicAttributes (bool bCreateIfNotExist=false) |
Additional Inherited Members | |
![]() | |
typedef ParaEngine::weak_ptr< IObject, IAttributeFields > | WeakPtr_type |
![]() | |
typedef ParaEngine::weak_ptr< IObject > | WeakPtr_type |
![]() | |
static HRESULT | GetAttributeClassID_s (IAttributeFields *cls, int *p1) |
static HRESULT | GetAttributeClassName_s (IAttributeFields *cls, const char **p1) |
static bool | OpenWithDefaultEditor (const char *sFilename, bool bWaitOnReturn=false) |
Open a given file with the default registered editor in the game engine. More... | |
![]() | |
WeakPtr_type | m_weak_reference |
![]() | |
int | m_refcount |
a region of view port to render into.
bool ParaEngine::CViewport::DrawQuad | ( | ) |
draw post processing quad for this viewport's area.
|
inlinevirtual |
attribute class ID should be identical, unless one knows how overriding rules work.
Reimplemented from ParaEngine::IAttributeFields.
int ParaEngine::CViewport::GetPipelineOrder | ( | ) | const |
-1 or RENDER_PIPELINE_ORDER.
if -1, it will be rendered for all pipeline stage
void ParaEngine::CViewport::GetPointOnViewport | ( | int & | x, |
int & | y, | ||
int * | pWidth, | ||
int * | pHeight | ||
) |
x,y | [in|out] a position on back buffer. If it is screen position, it should be multiplied by UI scaling. |
pWidth,pHeight | the view port's size is returned. |
const std::string & ParaEngine::CViewport::GetRenderTargetName | ( | ) | const |
render target to use.
if "", default to current back buffer
ParaViewport ParaEngine::CViewport::GetTextureViewport | ( | float | fTexWidth, |
float | fTexHeight | ||
) |
get the viewport as used for a given render target of given size.
such as shadow map.
|
virtual |
this class should be implemented if one wants to add new attribute.
This function is always called internally.
Reimplemented from ParaEngine::IAttributeFields.
void ParaEngine::CViewport::OnParentSizeChanged | ( | int | nWidth, |
int | nHeight | ||
) |
called when back buffer size changed.
HRESULT ParaEngine::CViewport::Render | ( | double | dTimeDelta, |
int | nPipelineOrder | ||
) |
build the render list, and render the entire scene.
dTimeDelta | fAnimation delta time in seconds. |
nPipelineOrder | the current pipeline order, default to PIPELINE_3D_SCENE, which is anything before UI. specify over PIPELINE_POST_UI_3D_SCENE for anything after UI is drawn. |
Scene root: Draw next scene
void ParaEngine::CViewport::SetActive | ( | ) |
make this viewport the current active one.
void ParaEngine::CViewport::SetPosition | ( | const char * | alignment, |
int | left, | ||
int | top, | ||
int | width, | ||
int | height | ||
) |
reposition the control using the same parameter definition used when control is created.
see InitObject() for parameter definition.