NvPlatformContext Class Reference
Basic platform functionality interface. More...
#include <NvPlatformContext.h>
Public Member Functions | |
virtual bool | isAppRunning ()=0 |
Mainloop active query. | |
virtual void | requestExit ()=0 |
Request exit. | |
virtual bool | pollEvents (NvInputCallbacks *callbacks)=0 |
Update event system. | |
virtual bool | isContextLost ()=0 |
Context lost query. | |
virtual bool | isContextBound ()=0 |
Context bound query. | |
virtual bool | shouldRender ()=0 |
Rendering query. | |
virtual bool | hasWindowResized ()=0 |
Window resize query. | |
virtual NvRedrawMode::Enum | getRedrawMode ()=0 |
Redraw mode query Returns the current redraw mode. | |
virtual void | setRedrawMode (NvRedrawMode::Enum mode)=0 |
Set redraw mode query Attempts to set the current redraw mode. | |
virtual void | requestRedraw ()=0 |
Request redraw When the system is in NvRedrawMode::ON_DEMAND, this function requests a redraw be queued. | |
virtual NvGamepad * | getGamepad ()=0 |
Gamepad access. | |
virtual void | setAppTitle (const char *title)=0 |
Set app title. | |
virtual void * | getPlatformApp () |
Platform-specific application context access. |
Detailed Description
Basic platform functionality interface.Interface class representing basic platform functionalities. This is merely the interface; the application framework must implement the platform-dependent functionalities along with a method of retrieving an instance
Member Function Documentation
virtual NvGamepad* NvPlatformContext::getGamepad | ( | ) | [pure virtual] |
Gamepad access.
Returns the gamepad class instance if available
- Returns:
- a pointer to the platform's gamepad implementation, or NULL if there is no gamepad support
virtual void* NvPlatformContext::getPlatformApp | ( | ) | [inline, virtual] |
Platform-specific application context access.
Most apps should remain cross-platform, but for developers wishing to create platform-specific applications, this function returns a platform-specific type that is likely to be the most useful for an application Currently, this is only supported on Android, and returns the NvAppBase source-internal object of type android_app as declared in extensions/src/NvAppBase/nvAndroidNativeAppGlue.h Currently, all other platforms return NULL.
- Returns:
- a per-platform application object, or NULL if not supported on the platform
virtual NvRedrawMode::Enum NvPlatformContext::getRedrawMode | ( | ) | [pure virtual] |
Redraw mode query Returns the current redraw mode.
Depending on support, this may NOT match the requested mode
- Returns:
- the currently implemented mode
virtual bool NvPlatformContext::hasWindowResized | ( | ) | [pure virtual] |
Window resize query.
Returns whether the application's window has resized since the last call to this query
- Returns:
- true if the window has been resized and false if not
virtual bool NvPlatformContext::isAppRunning | ( | ) | [pure virtual] |
Mainloop active query.
Query to determine if the application should continue to parse events, or can return from its mainloop.
- Returns:
- true if the app must continue processing events via pollEvents, false if the application can exit its mainloop and return from its "main" function
virtual bool NvPlatformContext::isContextBound | ( | ) | [pure virtual] |
Context bound query.
Returns whether the application's graphics context is bound and thus the app can make GL calls
- Returns:
- true if the context is bound, false if the context is not bound. A true return value does not in and of itself indicate that the app should be rendering actively. That requires the use of shouldRender
virtual bool NvPlatformContext::isContextLost | ( | ) | [pure virtual] |
Context lost query.
Returns whether the application's graphics context has been "lost" (i.e. all existing graphics resources have been deleted and will need to be recreated before rendering again)
- Returns:
- true if the context has been lost, false if the context is intact. A false return value does not in and of itself indicate that the system is entirely ready to render. That requires the use of shouldRender
virtual bool NvPlatformContext::pollEvents | ( | NvInputCallbacks * | callbacks | ) | [pure virtual] |
Update event system.
Function allowing the application to pass its input callback implementation to the platform in order to process any new events.
- Parameters:
-
[in] callbacks an implementation of the input callbacks interface to be used to process any new events.
- Returns:
- true on success and false on failure. This return value does NOT indicate the presence or absence of new events.
virtual void NvPlatformContext::requestExit | ( | ) | [pure virtual] |
Request exit.
Function to allow the app to request to exit. Applications should NOT assume that they will immediately exit. Applications cannot stop processing events in their mainloop until isAppRunning returns false.
virtual void NvPlatformContext::requestRedraw | ( | ) | [pure virtual] |
Request redraw When the system is in NvRedrawMode::ON_DEMAND, this function requests a redraw be queued.
The redraw will not be done immediately in this call, so the call is safe to make inside of the application's rendering function. In any other redraw mode, this function is a NO-OP.
virtual void NvPlatformContext::setAppTitle | ( | const char * | title | ) | [pure virtual] |
Set app title.
Allows an application to set the title to be used by the platform and framework as needed. param[in] title a null-terminated string containing a user-readable application name
virtual void NvPlatformContext::setRedrawMode | ( | NvRedrawMode::Enum | mode | ) | [pure virtual] |
Set redraw mode query Attempts to set the current redraw mode.
Depending on support, the requested mode may NOT be matched. Call getRedrawMode to confirm.
- Parameters:
-
[in] mode declares the desired mode
virtual bool NvPlatformContext::shouldRender | ( | ) | [pure virtual] |
Rendering query.
Returns whether the application in in a state such that it should be rendering at its normal, interactive rate (i.e. visible, focused, etc)
- Returns:
- true if the application is expected to be rendering, false if it should skip rendering at this time
The documentation for this class was generated from the following file: