NvSampleAppGL Class Reference

Base class for GL sample apps. More...

#include <NvSampleAppGL.h>

Inheritance diagram for NvSampleAppGL:

NvSampleApp NvAppBase NvInputCallbacks

List of all members.

Public Member Functions

 NvSampleAppGL ()
 Constructor Do NOT make rendering API calls in the constructor The rendering context is not bound until the entry into initRendering.
virtual ~NvSampleAppGL ()
 Destructor.
bool requireExtension (const char *ext, bool exitOnFailure=true)
 Extension requirement declaration.
bool requireMinAPIVersion (const NvGLAPIVersion &minApi, bool exitOnFailure=true)
 GL Minimum API requirement declaration.
virtual void configurationCallback (NvGLConfiguration &config)
 GL configuration request callback.
NvAppContextGLgetGLContext ()
 Return the GL-specific app context structure for easy use in the app.
GLuint getMainFBO () const
 Retrieve the main "onscreen" framebuffer; this may actually be an offscreen FBO that the framework uses internally, and then resolves to the window.


Detailed Description

Base class for GL sample apps.

Member Function Documentation

virtual void NvSampleAppGL::configurationCallback ( NvGLConfiguration config  )  [inline, virtual]

GL configuration request callback.

This function passes in the default set of GL configuration requests The app can override this function and change the defaults before returning. These are still requests, and may not be met. If the platform supports requesting GL options, this function will be called before initGL. Optional.

Parameters:
[in,out] config the default config to be used is passed in. If the application wishes anything different in the GL configuration, it should change those values before returning from the function. These are merely requests.

NvAppContextGL* NvSampleAppGL::getGLContext (  )  [inline]

Return the GL-specific app context structure for easy use in the app.

Returns:
Pointer to the GL-specific app context or NULL if not initialized

GLuint NvSampleAppGL::getMainFBO (  )  const [inline]

Retrieve the main "onscreen" framebuffer; this may actually be an offscreen FBO that the framework uses internally, and then resolves to the window.

Apps should ALWAYS use this value when binding the onscreen FBO and NOT use FBO ID 0 in order to ensure that they are compatible with test mode, etc. This should be queried on a per-frame basis. It may change every frame

Returns:
the GL ID of the main, "onscreen" FBO

bool NvSampleAppGL::requireExtension ( const char *  ext,
bool  exitOnFailure = true 
)

Extension requirement declaration.

Allow an app to declare an extension as "required".

Parameters:
[in] ext the extension name to be required
[in] exitOnFailure if true, then errorExit is called to indicate the issue and exit
Returns:
true if the extension string is exported and false if it is not

bool NvSampleAppGL::requireMinAPIVersion ( const NvGLAPIVersion minApi,
bool  exitOnFailure = true 
)

GL Minimum API requirement declaration.

Parameters:
[in] minApi the minimum API that is required
[in] exitOnFailure if true, then errorExit is called to indicate the issue and exit
Returns:
true if the platform's GL[ES] API version is at least as new as the given minApi. Otherwise, returns false


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