IND_Render Class Reference
[IND_Render]

List of all members.

Public Member Functions

bool Init (IND_Window *pWindow)
bool Init (LPDIRECT3D9 pDirect3d, IDirect3DDevice9 *pD3dDevice)
bool Reset (char *pTitle, int pWidth, int pHeight, int pBpp, bool pVsync, bool pFullscreen)
bool ToggleFullScreen ()
void End ()
void BeginScene ()
void EndScene ()
void ShowFpsInWindowTitle ()
Viewport clearing (both for 2d and 3d viewports)
void ClearViewPort (byte pR, byte pG, byte pB)
Viewport and camera 2d
bool SetViewPort2d (int pX, int pY, int pWidth, int pHeight)
void SetCamera2d (IND_Camera2d *pCamera2d)
Viewport and camera 3d
bool SetViewPort3d (int pX, int pY, int pWidth, int pHeight)
void SetCamera3d (IND_Camera3d *pCamera3d)
Bliting primitives (you can also use IND_Entity2d instead this methods)
void BlitPixel (int pX, int pY, byte pR, byte pG, byte pB, byte pA)
void BlitLine (int pX1, int pY1, int pX2, int pY2, byte pR, byte pG, byte pB, byte pA)
void BlitRectangle (int pX1, int pY1, int pX2, int pY2, byte pR, byte pG, byte pB, byte pA)
void BlitFillRectangle (int pX1, int pY1, int pX2, int pY2, byte pR, byte pG, byte pB, byte pA)
void BlitColoredTriangle (int pX1, int pY1, int pX2, int pY2, int pX3, int pY3, byte pR1, byte pG1, byte pB1, byte pR2, byte pG2, byte pB2, byte pR3, byte pG3, byte pB3, byte pA)
bool BlitPoly2d (IND_Point *pPixel, int pNumLines, byte pR, byte pG, byte pB, byte pA)
bool BlitRegularPoly (int pX, int pY, int pRadius, int pN, float pAngle, byte pR, byte pG, byte pB, byte pA)
Advanced transformations methods (it's preferible to use IND_Entity2d and IND_Entity3d instead)
void SetTransform2d (int pX, int pY, float pAngleX, float pAngleY, float pAngleZ, float pScaleX, float pScaleY, int pAxisCalX, int pAxisCalY, bool pMirrorX, bool pMirrorY, int pWidth, int pHeight, IND_Matrix *pMatrix)
void SetTransform3d (float pX, float pY, float pZ, float pAngleX, float pAngleY, float pAngleZ, float pScaleX, float pScaleY, float pScaleZ, IND_Matrix *pMatrix)
void SetRainbow2d (IND_Type pType, bool pCull, bool pMirrorX, bool pMirrorY, IND_Filter pFilter, byte pR, byte pG, byte pB, byte pA, byte pFadeR, byte pFadeG, byte pFadeB, byte pFadeA, IND_BlendingType pSo, IND_BlendingType pDs)
void SetRainbow3d (bool pCull, bool pFlipNormals, IND_Filter pFilter, byte pR, byte pG, byte pB, byte pA, byte pFadeR, byte pFadeG, byte pFadeB, byte pFadeA, IND_BlendingType pSo, IND_BlendingType pDs)
void LookAt (float pEyeX, float pEyeY, float pEyeZ, float pLookAtX, float pLookAtY, float pLookAtZ, float pUpX, float pUpY, float pUpZ)
void PerspectiveFov (float pFov, float pAspect, float pNearClippingPlane, float pFarClippingPlane)
void PerspectiveOrtho (float pWidth, float pHeight, float pNearClippingPlane, float pFarClippingPlane)
Advanced 2d bliting methods (it's preferible to use IND_Entity2d together with IND_Entity2dManager instead)
void BlitSurface (IND_Surface *pSu)
void BlitGrid (IND_Surface *pSu, byte pR, byte pG, byte pB, byte pA)
bool BlitRegionSurface (IND_Surface *pSu, int pX, int pY, int pWidth, int pHeight)
bool BlitWrapSurface (IND_Surface *pSu, int pWidth, int pHeight, float pUDisplace, float pVDisplace)
int BlitAnimation (IND_Animation *pAn, int pSequence, int pX, int pY, int pWidth, int pHeight, bool pToggleWrap, float pUDisplace, float pVDisplace)
void BlitText (IND_Font *pFo, char *pText, int pX, int pY, int pOffset, int pLineSpacing, byte pR, byte pG, byte pB, byte pA, byte pFadeR, byte pFadeG, byte pFadeB, byte pFadeA, IND_Filter pFilter, IND_BlendingType pSo, IND_BlendingType pDs, IND_Align pAlign)
Advanced 3d bliting methods (it's preferible to use IND_Entity3d together with IND_Entity3dManager instead)
void Blit3dMesh (IND_3dMesh *p3dMesh)
void Set3dMeshSequence (IND_3dMesh *p3dMesh, unsigned int pIndex)
Gets
int GetViewPortX ()
 This function returns the x position of the actual viewport.
int GetViewPortY ()
 This function returns the y position of the actual viewport.
int GetViewPortWidth ()
 This function returns the width position of the actual viewport.
int GetViewPortHeight ()
 This function returns the width position of the actual viewport.
char * GetVersion ()
 This function returns the actual version of Direct3d that is using IndieLib.
char * GetVendor ()
 This function returns the name of the graphic card vendor.
char * GetRenderer ()
 This function returns the name of the graphic card.
int GetMaxTextureSize ()
 This function returns the maximum texture size allowed by the graphic card.
LPDIRECT3D9 GetDirect3d ()
 This function returns the pointer to Direct3d.
IDirect3DDevice9 * GetDevice ()
 This function returns the pointer to the Direct3d device.
char * GetFpsString ()
 This function returns the actual fps (frames per second) in a string of chars.
int GetFpsInt ()
 This function returns the actual fps (frames per second) in an int.
IND_WindowGetWindow ()
 This function returns a pointer to the IND_Window object where the render has been created.
float GetFrameTime ()
 This function returns in miliseconds the time that took the previous frame.

Friends

class IND_Entity2dManager
class IND_Input


Detailed Description

The methods of this class are used for preparing the render area, viewport, etc.

Important: You can use the methods IND_Render::GetDirect3d() and IND_Render::GetDevice() in order to get the Direct3d pointers. This can be useful if you want to extend the features of the engine using Direct3d directly.


Member Function Documentation

bool IND_Render::Init ( IND_Window pWindow  ) 

Parameters:

Operation:

This function returns 1 (true) if the render is initialized sucessfully, 0 (false) otherwise.

bool IND_Render::Init ( LPDIRECT3D9  pDirect3d,
IDirect3DDevice9 *  pD3dDevice 
)

Parameters:

Operation:

This function returns 1 (true) if the render is initialized sucessfully, 0 (false) otherwise.

bool IND_Render::Reset ( char *  pTitle,
int  pWidth,
int  pHeight,
int  pBpp,
bool  pVsync,
bool  pFullscreen 
)

Parameters:

Operation:

This function returns 1 (true) if the application window resets to the attributes passed as parameters. This method is useful when you want to change the application window on runtime, 0 (false) if it is not possible to create the new window.

bool IND_Render::ToggleFullScreen (  ) 

Operation:

This function returns 1 (true) if the application window toggle to fullscreen or windowed, 0 (false) if it is not possible to create the new window.

void IND_Render::End (  ) 

Operation:

This function frees the manager and all the objetcts that it contains.

void IND_Render::BeginScene (  )  [inline]

Operation:

Preparing for render. This function must be called before drawing any graphical object.

void IND_Render::EndScene (  )  [inline]

Operation:

Finish the scene. This function must be called after drawing all the graphical objects.

void IND_Render::ShowFpsInWindowTitle (  )  [inline]

Operation:

This function shows the fps (frames per second) as the title of the window.

NOTE: The updating of the window title is quite time-consuming, so this is not the correct method for checking the FPS. It's better to use the methods IND_Render::GetFpsInt() or IND_Render::GetFpsString() and drawing the result using an IND_Font object.

void IND_Render::ClearViewPort ( byte  pR,
byte  pG,
byte  pB 
) [inline]

Parameters:

Funcionamiento:

Clean the viewport with a color expressed in RGB

bool IND_Render::SetViewPort2d ( int  pX,
int  pY,
int  pWidth,
int  pHeight 
) [inline]

Parameters:

Operation:

This function returns 1 (true) if a 2d ViewPort is created in the specified area.

The ViewPort is the drawing region. By default, IndieLib is initialized with a Viewport that has the same area as the window. Using this method you can define different viewports before calling to IND_Entity2dManager::RenderEntities2d().

After using this method, all the bliting methods will render the graphical objects inside the Viewport. Objects or blocks drawn outside the viewport will be discarded.

This method returns 0 (false) if the user tries to create a Viewport outside the window area.

void IND_Render::SetCamera2d ( IND_Camera2d *  pCamera2d  )  [inline]

Parameters:

Operation:

This function sets a 2d camera. See the methods of IND_Camera2d in order to see how you can manipulate the camera.

bool IND_Render::SetViewPort3d ( int  pX,
int  pY,
int  pWidth,
int  pHeight 
) [inline]

Parameters:

Operation:

This function returns 1 (true) if a 3d ViewPort is created in the specified area.

The ViewPort is the drawing region. You have to call to this method before calling to IND_Entity3dManager::RenderEntities3d().

After using this method, all the 3d bliting methods will render the graphical objects inside this Viewport.

This method returns 0 (false) if the user tries to create a Viewport outside the window area.

void IND_Render::SetCamera3d ( IND_Camera3d *  pCamera3d  )  [inline]

Parameters:

Operation:

This function sets a 3d camera. See the methods of IND_Camera3d in order to see how you can manipulate the camera.

float IND_Render::GetFrameTime (  )  [inline]

This function returns in miliseconds the time that took the previous frame.

It is very useful to indicate transformations along the timeline.

For example, making Position_X += Speed * Render.GetFrameTime() / 1000.0f we would get one x position that would go moving along the time with a given speed.


The documentation for this class was generated from the following files:
Generated on Fri Jan 2 17:16:47 2009 for IndieLib by  doxygen 1.5.4