PowerVR Software Development Kit


Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

PVRShell Class Reference

Inherited by the application; responsible for abstracting the OS and API. More...

#include <PVRShell.h>

Collaboration diagram for PVRShell:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PVRShell ()
virtual ~PVRShell ()
virtual bool InitApplication ()
virtual bool QuitApplication ()
virtual bool InitView ()
virtual bool ReleaseView ()
virtual bool RenderScene ()
bool PVRShellSet (const prefNameBoolEnum prefName, const bool value)
bool PVRShellSet (const prefNameFloatEnum prefName, const float value)
bool PVRShellSet (const prefNameIntEnum prefName, const int value)
bool PVRShellSet (const prefNamePtrEnum prefName, const void *const ptrValue)
bool PVRShellSet (const prefNameConstPtrEnum prefName, const void *const ptrValue)
bool PVRShellGet (const prefNameBoolEnum prefName) const
float PVRShellGet (const prefNameFloatEnum prefName) const
int PVRShellGet (const prefNameIntEnum prefName) const
void * PVRShellGet (const prefNamePtrEnum prefName) const
const void * PVRShellGet (const prefNameConstPtrEnum prefName) const
bool PVRShellScreenCaptureBuffer (const int Width, const int Height, unsigned char **pLines)
int PVRShellScreenSave (const char *const fname, const unsigned char *const pLines, char *const ofname=NULL)
int PVRShellWriteBMPFile (const char *const pszFilename, const unsigned long uWidth, const unsigned long uHeight, const void *const pImageData)
void PVRShellOutputDebug (char const *const format,...) const
unsigned long PVRShellGetTime ()
bool PVRShellIsKeyPressed (const PVRShellKeyName key)

Friends

class PVRShellInitOS
class PVRShellInit

Detailed Description

Inherited by the application; responsible for abstracting the OS and API.

Description:
PVRShell is the main Shell class that an application uses. An application should supply a class which inherits PVRShell and supplies implementations of the virtual functions of PVRShell (InitApplication(), QuitApplication(), InitView(), ReleaseView(), RenderScene()). Default stub functions are supplied; this means that an application is not required to supply a particular function if it does not need to do anything in it. The other, non-virtual, functions of PVRShell are utility functions that the application may call.


Constructor & Destructor Documentation



PVRShell


PVRShell::PVRShell  ) 
 

Description:
Constructor



~PVRShell


PVRShell::~PVRShell  )  [virtual]
 

Description:
Destructor

Member Function Documentation



InitApplication


virtual bool PVRShell::InitApplication  )  [inline, virtual]
 

Returns:
true for success, false to exit the application
Description:
This function can be overloaded by the application. It will be called by PVRShell once only at the beginning of the PVRShell WinMain()/main() function. This function enables the user to perform any initialisation before the render API is initialised. From this function the user can call PVRShellSet() to change default values, e.g. requesting a particular resolution or device setting.



InitView


virtual bool PVRShell::InitView  )  [inline, virtual]
 

Returns:
true for success, false to exit the application
Description:
This function can be overloaded by the application. It will be called by PVRShell after the OS and rendering API are initialised, before entering the RenderScene() loop. It is called any time the rendering API is initialised, i.e. once at the beginning, and possibly again if the resolution changes, or a power management even occurs, or if the app requests a reinialisation. The application should check here the configuration of the rendering API; it is possible that requests made in InitApplication() were not successful. Since everything is initialised when this function is called, you can load textures and perform rendering API functions.



PVRShellGet


const void * PVRShell::PVRShellGet const prefNameConstPtrEnum  prefName  )  const
 

Here is the call graph for this function:



PVRShellGet


void * PVRShell::PVRShellGet const prefNamePtrEnum  prefName  )  const
 

Here is the call graph for this function:



PVRShellGet


int PVRShell::PVRShellGet const prefNameIntEnum  prefName  )  const
 



PVRShellGet


float PVRShell::PVRShellGet const prefNameFloatEnum  prefName  )  const
 



PVRShellGet


bool PVRShell::PVRShellGet const prefNameBoolEnum  prefName  )  const
 

Inputs:
prefName Name of preference to set to value
Returns:
Value asked for.
Description:
This function is used to get parameters from the PVRShell It can be called from any where in the program.



PVRShellGetTime


unsigned long PVRShell::PVRShellGetTime  ) 
 

Returns:
A value which increments once per millisecond.
Description:
The number itself should be considered meaningless; an application should use this function to determine how much time has passed between two points (e.g. between each frame).



PVRShellIsKeyPressed


bool PVRShell::PVRShellIsKeyPressed const PVRShellKeyName  key  ) 
 

Inputs:
key Code of the key to test
Returns:
true if key was pressed
Description:
Check if a key was pressed. The keys on various devices are mapped to the PVRShell-supported keys (listed in PVRShellKeyName) in a platform-dependent manner, since most platforms have different input devices. Check the SDK release notes for details on how the enum values map to your device's input device.



PVRShellOutputDebug


void PVRShell::PVRShellOutputDebug char const *const  format,
... 
const
 

Inputs:
format printf style format followed by arguments it requires
Description:
Writes the resultant string to the debug output (e.g. using printf(), OutputDebugString(), ...). Check the SDK release notes for details on how the string is output.



PVRShellScreenCaptureBuffer


bool PVRShell::PVRShellScreenCaptureBuffer const int  Width,
const int  Height,
unsigned char **  pLines
 

Inputs:
Width size of image to capture (relative to 0,0)
Height size of image to capture (relative to 0,0)
Modified:
pLines receives a pointer to an area of memory containing the screen buffer.
Returns:
true for success
Description:
It will be stored as 24-bit per pixel, 8-bit per chanel RGB. The memory should be freed with free() when no longer needed.



PVRShellScreenSave


int PVRShell::PVRShellScreenSave const char *const  fname,
const unsigned char *const  pLines,
char *const  ofname = NULL
 

Inputs:
fname base of file to save screen to
Outputs:
ofname If non-NULL, receives the filename actually used
Modified:
pLines image data to write out (24bpp, 8-bit per channel RGB)
Returns:
true for success
Description:
Writes out the image data to a BMP file with basename fname. The file written will be fname suffixed with a number to make the file unique. For example, if fname is "abc", this function will attempt to save to "abc0000.bmp"; if that file already exists, it will try "abc0001.bmp", repeating until a new filename is found. The final filename used is returned in ofname.

Here is the call graph for this function:



PVRShellSet


bool PVRShell::PVRShellSet const prefNameConstPtrEnum  prefName,
const void *const  ptrValue
 



PVRShellSet


bool PVRShell::PVRShellSet const prefNamePtrEnum  prefName,
const void *const  ptrValue
 



PVRShellSet


bool PVRShell::PVRShellSet const prefNameIntEnum  prefName,
const int  value
 



PVRShellSet


bool PVRShell::PVRShellSet const prefNameFloatEnum  prefName,
const float  value
 



PVRShellSet


bool PVRShell::PVRShellSet const prefNameBoolEnum  prefName,
const bool  value
 

Inputs:
prefName Name of preference to set to value
value Boolean value
Returns:
true for success
Description:
This function is used to pass preferences to the PVRShell If used, it must be called from InitApplication().



PVRShellWriteBMPFile


int PVRShell::PVRShellWriteBMPFile const char *const  pszFilename,
const unsigned long  uWidth,
const unsigned long  uHeight,
const void *const  pImageData
 

Inputs:
pszFilename file to save screen to
uWidth the width of the data
uHeight the height of the data
pImageData image data to write out (24bpp, 8-bit per channel RGB)
Returns:
success or failure
Description:
Writes out the image data to a BMP file with name fname.

Here is the call graph for this function:



QuitApplication


virtual bool PVRShell::QuitApplication  )  [inline, virtual]
 

Returns:
true for success, false to exit the application
Description:
This function can be overloaded by the application. It will be called by PVRShell just before finishing the program. It enables the application to release any memory/resources acquired in InitApplication().



ReleaseView


virtual bool PVRShell::ReleaseView  )  [inline, virtual]
 

Returns:
true for success, false to exit the application
Description:
This function can be overloaded by the application. It will be called after the RenderScene() loop, before shutting down the render API. It enables the application to release any memory/resources acquired in InitView().



RenderScene


virtual bool PVRShell::RenderScene  )  [inline, virtual]
 

Returns:
true for success, false to exit the application
Description:
This function can be overloaded by the application. It is main application function in which you have to do your own rendering. Will be called repeatedly until the application exits.

Friends And Related Function Documentation



PVRShellInit


friend class PVRShellInit [friend]
 



PVRShellInitOS


friend class PVRShellInitOS [friend]
 


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

Copyright © 1999-2006, PowerVR Technologies and partners. PowerVR Technologies is a division of Imagination Technologies Ltd.


Generated by DOXYGEN 1.3.6