Rasterfarm-SDK
Loading...
Searching...
No Matches
Engine::Application Class Referenceabstract

This class abstracts-away user callbacks, events, and window-management. More...

#include <application.h>

Inheritance diagram for Engine::Application:
Implementation

Public Types

enum  RenderState {
  INITIALIZING = 0 ,
  INITIALIZED ,
  DRAWING ,
  BLOCKED_BY_EXECUTABLE ,
  BLOCKED_BY_ENGINE ,
  STOPPED_BY_ENGINE ,
  EXITING
}
 
typedef void * Window
 
typedef void * Display
 
typedef List< Raster::Scene * > SceneList
 
- Public Types inherited from Implementation
typedef void GL_APIENTRY(* GLDeleteVertexArrays_func) (GLsizei n, const GLuint *arrays)
 
typedef void GL_APIENTRY(* GLGenVertexArrays_func) (GLsizei n, GLuint *arrays)
 
typedef GLboolean GL_APIENTRY(* GLIsVertexArray_func) (GLuint array)
 
typedef void GL_APIENTRY(* GLInvalidateFramebuffer_func) (GLenum target, GLsizei numAttachments, const GLenum *attachments)
 
typedef UnorderedMap< int, intImplementationIntegerMap
 
typedef UnorderedMap< int, HeapArray< int > > ImplementationIntegerArrayMap
 
typedef UnorderedMap< int, Vector2iImplementationIntegerPairMap
 
typedef UnorderedMap< int, Vector4iImplementationIntegerGroupMap
 
typedef UnorderedMap< int, floatImplementationFloatMap
 
typedef UnorderedMap< int, Vector2fImplementationFloatPairMap
 
typedef UnorderedMap< int, Vector4fImplementationFloatGroupMap
 

Public Member Functions

void render ()
 
void renderScene (Raster::Display *pScene)
 
void initialize (Raster::GeometricBase *pObject, Raster::Scene *pScene, bool addObjectToScene)
 
- Public Member Functions inherited from Implementation
const StateUnorderedSetgetStateSet ()
 
void enableState (const StateUnorderedSet &stateSubSet)
 
void enableState (PipelineState glState)
 
void disableState (PipelineState glState)
 
const HeapArray< String > & getExtensions ()
 
void setDepthRange (float nearClip, float farClip)
 
void setPolygonOffset (float factor, float units)
 
void setLineWidth (float width)
 
void setSampleCoverage (float value, bool invert)
 
FrameBufferHandle getRenderingFrameBuffer ()
 
void bindFramebuffer (FrameBufferHandle frameBuffer)
 
void bindRenderbuffer (RenderBufferHandle renderBuffer)
 
void useProgram (Program *pProgram)
 
void setCullFaceMode (CullFace mode)
 
void setDepthTestFunction (CompareOperation function)
 
void setDepthTestWriteMask (GLuint mask)
 
void activeTextureUnit (GLuint textureUnit)
 
uint textureUnitSize ()
 
Handle createShaderProgram ()
 
void destroyShaderProgram (ProgramHandle handle)
 
ShaderHandle createShader (ShaderType type)
 
void destroyShader (ShaderHandle handle)
 
TextureHandle createTexture ()
 
HeapArray< TextureHandlecreateTextureArray (size_t size)
 
void destroyTexture (TextureHandle handle)
 
void destroyTextureArray (const HeapArray< TextureHandle > &array)
 
uint renderBufferSize ()
 
RenderBufferHandle createRenderBuffer ()
 
HeapArray< RenderBufferHandlecreateRenderBufferArray (size_t size)
 
void destroyRenderBuffer (RenderBufferHandle handle)
 
void destroyRenderBufferArray (const HeapArray< RenderBufferHandle > &array)
 
FrameBuffergetPresentFrameBuffer ()
 
FrameBufferHandle getPresentFrameBufferHandle ()
 
FrameBufferHandle createFrameBuffer ()
 
HeapArray< FrameBufferHandlecreateFrameBufferArray (size_t size)
 
void destroyFrameBuffer (FrameBufferHandle handle)
 
void destroyFrameBufferArray (const HeapArray< FrameBufferHandle > &array)
 
VertexBufferHandle createVertexBuffer ()
 
HeapArray< VertexBufferHandlecreateVertexBufferArray (size_t size)
 
void destroyVertexBuffer (VertexBufferHandle handle)
 
void destroyVertexBufferArray (const HeapArray< VertexBufferHandle > &array)
 
bool vertexArrayObjectSupport ()
 
VertexArrayHandle createVertexArrayObject ()
 
HeapArray< VertexArrayHandlecreateVertexArrayObjectArray (size_t size)
 
void destroyVertexArrayObject (VertexArrayHandle handle)
 
void destroyVertexArrayObjectArray (const HeapArray< VertexArrayHandle > &array)
 
bool hasDepthTexture ()
 
void bindTexture2D (GLuint id)
 
void bindTextureCubeMap (GLuint id)
 
void setBlendAlphaFunctions (BlendFactor sBlendFactor, BlendFactor dBlendFactor)
 
void setFrontFaceOrientation (VertexOrientation orientation)
 
void setViewport (int x, int y, int width, int height)
 
void clearColor (const Vector4f &color)
 
void bindAttributeBuffer (VertexBufferHandle vbo)
 
void bindElementBuffer (VertexBufferHandle vbo)
 
void bindVertexArray (VertexArrayHandle vao)
 
uint uniformVectorSize (GLenum type)
 
uint vertexAttributeSize ()
 
uint varyingVectorSize ()
 
void clearBuffers (uint mask=COLOR_BUFFER|STENCIL_BUFFER|DEPTH_BUFFER)
 
void swapBuffers ()
 
void scissorBuffer (uint offsetX, uint offsetY, uint width, uint height)
 
void setStencilOperations (StencilOperation fail, StencilOperation depthFail, StencilOperation depthPass)
 
void setStencilFunctions (CompareOperation function, int value, uint mask)
 
void exportCurrentFrameToPng (const char *filename)
 
bool hasMemoryType (MemoryType memoryType)
 
const VkMemoryHeap & getMemoryHeap (uint memoryHeapIndex)
 
const VkMemoryHeap & getMemoryHeap (MemoryType memoryType)
 
const VkMemoryType & getMemoryType (uint heapIndex)
 
uint getMemoryTypeIndex (MemoryType type, uint heapIndex)
 
MemoryAllocatorgetMemoryAllocator (MemoryType memoryType)
 
const VkPhysicalDeviceMemoryProperties & getPhysicalDeviceMemoryProperties ()
 
PixelFormat getPresentColorFormat ()
 
PixelFormat getPresentDepthFormat ()
 
uint getSwapIndex ()
 
uint getFrameSize ()
 
uint getAdvanceFrameSize ()
 
VkDescriptorPool createUniformDescriptorPool (const HeapArray< Pair< UniformDescriptorType, uint > > &descriptorType)
 
VkSemaphore createSemaphore ()
 
void destroySemaphore (VkSemaphore semaphore)
 
VkFence createFence (VkFenceCreateFlags flags=0)
 
void destroyFence (VkFence semaphore)
 
uint getQueueFamilyPropertyIndex ()
 
VkCommandPool createCommandPool ()
 
void destroyCommandPool (VkCommandPool commandPool)
 
VkCommandPool getCommandPool ()
 
VkCommandBuffer createCommandBuffer (VkCommandPool commandPool, VkCommandBufferLevel bufferLevel)
 
void destroySurface (VkSurfaceKHR surface)
 
VkRenderPass createRenderPass (FrameBuffer *pFrameBuffer, bool display)
 
void destroyRenderPass (VkRenderPass renderPass)
 
VkFramebuffer createFrameBuffer (RenderBuffer *pRenderBuffer, HeapArray< VkImageView > vkImageView, uint width, uint height)
 
FrameBuffergetPresentFrameBuffer ()
 
FrameBufferHandle getPresentFrameBufferHandle ()
 
FrameBufferHandle getRenderingFrameBuffer ()
 
RenderBuffer * getRenderingRenderBuffer ()
 
void destroyFrameBuffer (FrameBufferHandle frameBufferHandle)
 
void destroyPipeline (VkPipeline pipeline)
 
void destroyPipelineLayout (VkPipelineLayout layout)
 
void destroyDescriptorSetLayout (VkDescriptorSetLayout layout)
 
void destroyDescriptorPool (VkDescriptorPool pool)
 
void presentQueueSubmit (Pair< uint, VkSemaphore > swapIndex)
 
void queueSubmit (CommandBuffer *pCommandBuffer)
 
void queueSubmit (const HeapArray< CommandBuffer * > &pCommandBuffer)
 
void createMipmaps (Texture *pTexture, TextureType type)
 
void createGraphicsPipeline (Program *pProgram)
 
bool hasGraphicsPipeline (Program *pProgram)
 
GraphicsPipelinegetGraphicsPipeline (Program *pProgram)
 
GraphicsPipelinegetRenderingGraphicsPipeline ()
 
void destroyGraphicsPipeline (Program *pProgram)
 
VkSampler createSampler (VkImageViewType imageViewType)
 
bool hasImageSampler (TextureHandle textureHandle)
 
bool hasImageSampler (Texture *pTexture)
 
VkImage createImage (const VkImageCreateInfo &createInfo)
 
VkImageView createImageView (VkImage image, VkFormat format, TextureType textureType, uint mipLevels=1)
 
void destroyBuffer (VkBuffer buffer)
 
void destroyImage (VkImage image)
 
void destroyImageView (VkImageView view)
 
void destroySampler (VkSampler sampler)
 
void createImageSampler (Texture *pTexture, TextureType textureType)
 
void destroyImageSampler (Texture *pTexture)
 
VkDescriptorImageInfo & getImageSampler (TextureHandle textureHandle)
 
RenderBuffer * getCurrentRenderBuffer ()
 
void destroyMemory (Memory *pMemory)
 
VkPhysicalDevice getPhysicalDevice ()
 
VkDevice getLogicalDevice ()
 
const HeapArray< const char * > & getInstanceExtensions ()
 
const HeapArray< const char * > & getDeviceExtensions ()
 
void setSampleCoverage (float value, bool invert)
 
void bindFramebuffer (FrameBufferHandle frameBuffer)
 
void bindRenderbuffer (RenderBuffer *pRenderBuffer)
 
void useProgram (Program *pProgram)
 
ProgramgetRenderingProgram ()
 
RenderBuffer * getPresentRenderBuffer ()
 
void activeTextureUnit (uint textureUnit)
 
uint textureUnitSize ()
 
ProgramHandle createProgram ()
 
void destroyProgram (ProgramHandle handle)
 
ShaderHandle createShader (ShaderType type)
 
void destroyShader (ShaderHandle shader)
 
VkShaderModule createShaderModule (const HeapArray< uint > &irCode)
 
bool hasShaderModule (Shader *pShader)
 
VkShaderModule acquireShaderModule (Shader *pShader)
 
void releaseShaderModule (Shader *pShader)
 
void destroyShaderModule (VkShaderModule handle)
 
VkPipelineCache getPipelineCache ()
 
VkPipelineCache createPipelineCache (uint size=0, void *pBuffer=nullptr)
 
void destroyPipelineCache (VkPipelineCache pipelineCache)
 
void clearColor (const Vector4f &color)
 
const VkPhysicalDeviceProperties & getPhysicalDeviceProperties ()
 
const VkPhysicalDeviceFeatures & getPhysicalDeviceFeatures ()
 
VkFormatProperties getPhysicalDeviceFormatProperties (PixelFormat format)
 
void clearBuffers (uint mask=COLOR_BUFFER|STENCIL_BUFFER|DEPTH_BUFFER)
 
void swapBuffers ()
 
void setDepthRange (float nearClip, float farClip)
 
void exportCurrentFrameToPng (const char *filename)
 

Static Public Member Functions

static void initialize (UintRectangle rect, int argc, char **argv)
 
static Applicationinstance ()
 
static Thread::id getRenderThreadID ()
 
static RenderState getState ()
 
static void setAppPath (const char *appPath)
 
static void setFontPath (const char *appPath)
 
static void setImagePath (const char *appPath)
 
static void setSoundPath (const char *appPath)
 
static void setIqmPath (const char *appPath)
 
static void setConfigPath (const char *appPath)
 
static void setAppName (const char *name)
 
static const StringgetAppName ()
 
static const StringgetAppPath ()
 
static const StringgetFontPath ()
 
static const StringgetImagePath ()
 
static const StringgetSoundPath ()
 
static const StringgetIqmPath ()
 
static const StringgetConfigPath ()
 
static void drawFrame ()
 
static void addFrameHandler (Schedule::Frame *pPreRenderHandler, Schedule::RenderSchedule renderSchedule)
 
static void addAnimation (Schedule::Frame *pFrameHandler)
 
static void addFrameTask (Schedule::Task *pFrameTask)
 
static void removeFrameHandler (Schedule::Frame *pPreRenderHandler, Schedule::RenderSchedule renderSchedule)
 
static void removeAnimation (Schedule::Frame *pFrameHandler)
 
static void removeFrameTask (Schedule::Task *pFrameTask)
 
static void resize (uint width, uint height)
 
static void run ()
 
static void stop ()
 
static void resume ()
 
static void exit ()
 
static uint getWidth ()
 
static uint getHeight ()
 
static float getAspectRatio ()
 
static double currentTimeInSeconds ()
 
static unsigned long currentTimeInUSeconds ()
 
static uint getFrameRate ()
 
static void calculateFrameRate ()
 
static void displayFrameRate ()
 
static const List< Raster::Display * > & getDisplaySceneList ()
 
static void addScene (Raster::Display *pScene)
 
static void removeScene (Raster::Display *pScene)
 
static void sendEvent (const Event &event)
 
static Vector4f getBackgroundColor ()
 
static void setBackgroundColor (const Vector4f &color)
 
static void addEventHandler (EventHandler *pObject)
 
static void removeEventHandler (EventHandler *pObject)
 
static bool doesFileExist (const char *filename)
 
static size_t getFileSize (const char *filename)
 
template<typename T >
static TallocAndFetchFileData (const char *filename, size_t &dataSize)
 
template<typename T >
static TallocAndFetchPartialFileData (const char *filename, size_t dataSize)
 
template<typename T >
static void writeFileData (const char *filename, T *pData, size_t dataSize)
 
template<typename T >
static void writeFileData (const char *filename, Initializer< T * > pData, Initializer< size_t > dataSize)
 
static Handle loadSound (const char *filename)
 
static bool isPlaying (Handle handle)
 
static void playSound (Handle handle, bool loop=false, bool fadeIn=false)
 
static void stopSound (Handle handle, bool fadeOut=false)
 
static void setVolume (float volume)
 
static void addTimer (Timer *pTimer)
 
static void removeTimer (Timer *pTimer)
 
static bool isLibraryLoaded (const char *library)
 
static void loadLibrary (const char *library)
 
static void unloadLibrary (const char *library)
 

Protected Types

typedef UnorderedMap< Timer *, HandleTimerIDMap
 

Protected Member Functions

 Application ()
 
void initializeInstance (const UintRectangle &rect, int argc, char **argv)
 
void operator= (const Application &)
 
 Application (const Application &)
 
virtual ~Application ()
 
virtual void platformCleanup ()=0
 
virtual void runEventLoop ()=0
 
virtual void event ()=0
 
- Protected Member Functions inherited from Implementation
void initialize ()
 
bool getGlExtension (const char *str)
 
int getGlStateInteger (GLenum state)
 
HeapArray< int > & getGlStateTextureBinding (GLenum state)
 
Vector2i getGlStateIntegerPair (GLenum state)
 
Vector4i getGlStateIntegerGroup (GLenum state)
 
float getGlStateFloat (GLenum state)
 
Vector2f getGlStateFloatPair (GLenum state)
 
Vector4f getGlStateFloatGroup (GLenum state)
 
 Implementation ()
 
 ~Implementation ()
 
void finish ()
 
void uninitialize ()
 
void initialize ()
 
 Implementation ()
 
 ~Implementation ()
 
void finish ()
 
void uninitialize ()
 
VkInstance createInstance (bool singleton=true)
 
VkSurfaceKHR createSurface ()
 
VkSwapchainKHR createSwapChain (const HeapArray< PixelFormat > &preferredPixelFormat, VkSurfaceKHR vkSurace, uint advanceFrameSize=1)
 
void destroySwapChain (VkSwapchainKHR swapChain)
 

Protected Attributes

Thread::id renderThreadID
 
int argc
 
char ** argv
 
uint frameRate
 
int width
 
int height
 
int xOffset
 
int yOffset
 
Vector4f backgroundColor
 
List< Raster::Display * > pDisplayScene
 
EventHandlerList pEventHandler
 
HeapArray< Surface::Material::InitializermaterialInitializer
 
TimerIDMap timer
 
- Protected Attributes inherited from Implementation
HeapArray< String > extension
 
UnorderedSet< VertexBufferHandleallocatedVertexBufferHandles
 
UnorderedSet< VertexArrayHandleallocatedVertexArrayObjectHandles
 
UnorderedSet< TextureHandleallocatedTextureObjectHandles
 
UnorderedSet< ProgramHandleallocatedShaderProgramHandles
 
UnorderedSet< ShaderHandleallocatedShaderHandles
 
UnorderedSet< RenderBufferHandleallocatedRenderBufferHandles
 
UnorderedSet< FrameBufferHandleallocatedFrameBufferHandles
 
FrameBufferpPresentFrameBuffer
 
ProgrampRenderingProgram
 
uint baseFrameBuffer
 
uint baseRenderBuffer
 
StateEnabledUnorderedMap state
 
HeapArray< const char * > instanceExtension
 
HeapArray< const char * > deviceExtension
 
PixelFormat presentColorFormat
 
PixelFormat presentDepthFormat
 
VkInstance instance
 
VkSurfaceKHR surface
 
VkPhysicalDevice physicalDevice
 
VkPhysicalDeviceProperties physicalDeviceProperties
 
VkPhysicalDeviceFeatures physicalDeviceFeatures
 
VkPhysicalDeviceMemoryProperties physicalDeviceMemoryProperties
 
UnorderedMap< PixelFormat, VkFormatProperties > physicalDeviceFormatProperties
 
VkDevice logicalDevice
 
VkSwapchainKHR swapChain
 
VkPipelineCache pipelineCache
 
VkFence queueSubmitFence
 
UnorderedMap< size_t, VkShaderModule > shaderModule
 
UnorderedMap< VkShaderModule, uint > shaderModuleReferenceCount
 
UnorderedMap< Program *, GraphicsPipeline * > pGraphicsPipeline
 
UnorderedMap< TextureHandle, VkDescriptorImageInfo > imageSampler
 
Queue< CommandBuffer * > queueSubmitCommandBuffer
 
RenderBuffer * pCurrentRenderBuffer
 
HeapArray< CommandBuffer * > pCompletedCommandBuffer
 
HeapArray< RenderBuffer * > pCompletedRenderBuffer
 
FrameBufferHandle renderingFrameBuffer
 
uint swapIndex
 
uint advanceFrameSize
 
Queue< Pair< uint, VkSemaphore > > presentSwapIndex
 
HeapArray< VkSemaphore > presentImageAcquiredSemaphore
 
Circulator< HeapArray< VkSemaphore > > ciPresentImageAcquiredSemaphore
 
VkImageUsageFlags presentUsageFlags
 
HeapArray< SwapChainImageswapChainImage
 
VkClearColorValue swapChainClearColorValue
 
VkClearDepthStencilValue swapChainClearDepthStencilValue
 
HeapArray< VkQueue > presentGraphicsQueue
 
HeapArray< MutexpresentGraphicsQueueMutex
 
UnorderedMap< MemoryType, uint > memoryHeapIndex
 
UnorderedMap< MemoryType, HeapArray< uint > > memoryTypeIndex
 
HeapArray< MemoryAllocator * > memoryAllocator
 
uint queueFamilyPropertyIndex
 
Thread dynamicDestroyServerThread
 
Mutex dynamicDestroyServerMutex
 
Queue< Memory * > pMemoryQueue
 
Queue< ProgramHandledestroyProgramHandleQueue
 
Queue< ShaderHandledestroyShaderHandleQueue
 
Queue< VkShaderModule > destroyShaderModuleQueue
 
Queue< VkFramebuffer > destroyFrameBufferQueue
 
Queue< VkRenderPass > destroyRenderPassQueue
 
Queue< VkPipelineCache > destroyPipelineCacheQueue
 
Queue< VkPipeline > destroyPipelineQueue
 
Queue< VkPipelineLayout > destroyPipelineLayoutQueue
 
Queue< VkDescriptorSetLayout > destroyDescriptorSetLayoutQueue
 
Queue< VkDescriptorPool > destroyDescriptorPoolQueue
 
Queue< VkSemaphore > destroySemaphoreQueue
 
Queue< VkCommandPool > destroyCommandPoolQueue
 
Queue< VkFence > destroyFenceQueue
 
Queue< VkBuffer > destroyBufferQueue
 
Queue< VkImage > destroyImageQueue
 
Queue< VkImageView > destroyImageViewQueue
 
Queue< VkSampler > destroyImageSamplerQueue
 
Queue< Pair< Texture *, TextureType > > mipmapServerImageQueue
 
Thread mipmapServerThread
 
Mutex mipmapServerMutex
 
Thread presentQueueServerThread
 
Mutex presentQueueServerMutex
 
Thread queueSubmitServerThread
 
Mutex queueSubmitServerMutex
 

Static Protected Attributes

static RenderState state
 
static String appName
 
static String appPath
 
static String fontPath
 
static String imagePath
 
static String soundPath
 
static String iqmPath
 
static String configPath
 
static List< Schedule::Frame * > pPreRenderHandler
 
static List< Schedule::Frame * > pPostRenderHandler
 
static Mutex newMaterialMutex
 
static Mutex preRenderMutex
 
static Mutex postRenderMutex
 
static ApplicationpInstance
 

Additional Inherited Members

- Public Attributes inherited from Implementation
const GLStateUnorderedSet glStateIntegerSet
 
const GLStateUnorderedSet glStateTextureBindingSet
 
const GLStateUnorderedSet glStateFloatSet
 
const GLStateUnorderedSet glStateIntegerPairSet = { GL_MAX_VIEWPORT_DIMS }
 
const GLStateUnorderedSet glStateFloatPairSet
 
const GLStateUnorderedSet glStateIntegerGroupSet = { GL_VIEWPORT }
 
const GLStateUnorderedSet glStateFloatGroupSet = { GL_COLOR_CLEAR_VALUE }
 
const StateUnorderedSet stateSet
 
- Static Public Attributes inherited from Implementation
static GLDeleteVertexArrays_func deleteVertexArrays
 
static GLGenVertexArrays_func generateVertexArrays
 
static GLIsVertexArray_func isVertexArray
 
static GLInvalidateFramebuffer_func invalidateFramebuffer
 
static const UnorderedMap< PixelFormat, uint > pixelFormatStride
 
- Static Protected Member Functions inherited from Implementation
static int getGlInteger (GLenum glState)
 
static Vector2i getGlIntegerPair (GLenum value)
 
static Vector4i getGlIntegerGroup (GLenum value)
 
static float getGlFloat (GLenum glState)
 
static Vector2f getGlFloatPair (GLenum value)
 
static Vector4f getGlFloatGroup (GLenum value)
 
static void mipmapServer ()
 
static void presentQueueServer ()
 
static void queueSubmitServer ()
 
static void dynamicDestroyServer ()
 

Detailed Description

This class abstracts-away user callbacks, events, and window-management.

Member Typedef Documentation

◆ Display

◆ SceneList

typedef List< Raster::Scene * > Engine::Application::SceneList

◆ TimerIDMap

Maps a Timer pointer to a platform-specific timer handle.

◆ Window

Member Enumeration Documentation

◆ RenderState

Application rendering state.

Enumerator
INITIALIZING 
INITIALIZED 
DRAWING 
BLOCKED_BY_EXECUTABLE 
BLOCKED_BY_ENGINE 
STOPPED_BY_ENGINE 
EXITING 

Constructor & Destructor Documentation

◆ Application() [1/2]

Engine::Application::Application ( )
protected

Singleton constructor.

◆ Application() [2/2]

Engine::Application::Application ( const Application & )
protected

Not implemented, not copyable

◆ ~Application()

virtual Engine::Application::~Application ( )
protectedvirtual

Member Function Documentation

◆ addAnimation()

static void Engine::Application::addAnimation ( Schedule::Frame * pFrameHandler)
inlinestatic

◆ addEventHandler()

static void Engine::Application::addEventHandler ( EventHandler * pObject)
static

◆ addFrameHandler()

static void Engine::Application::addFrameHandler ( Schedule::Frame * pPreRenderHandler,
Schedule::RenderSchedule renderSchedule )
static

Register an object to be notified of a new frame about to be rendered.

Parameters
Pointerto FrameHandler object.
Returns
void.

◆ addFrameTask()

static void Engine::Application::addFrameTask ( Schedule::Task * pFrameTask)
static

◆ addScene()

static void Engine::Application::addScene ( Raster::Display * pScene)
static

Add a Scene to the application's so it's rendered.

Parameters
Thepointer to the Scene.
Returns
void.

◆ addTimer()

static void Engine::Application::addTimer ( Timer * pTimer)
static

/param Pointer to a Timer object.

◆ allocAndFetchFileData()

template<typename T >
static T * Engine::Application::allocAndFetchFileData ( const char * filename,
size_t & dataSize )
static

◆ allocAndFetchPartialFileData()

template<typename T >
static T * Engine::Application::allocAndFetchPartialFileData ( const char * filename,
size_t dataSize )
static
Parameters
Thefilename to fetch data.
Thesize in bytes of allocated data fetched.
Returns
Pointer to allocated data.

◆ calculateFrameRate()

static void Engine::Application::calculateFrameRate ( )
static

Calculate application's current frame-rate.

Returns
void.

◆ currentTimeInSeconds()

static double Engine::Application::currentTimeInSeconds ( )
static

Gets the current time in seconds, used in FPS calulations.

Returns
void.

◆ currentTimeInUSeconds()

static unsigned long Engine::Application::currentTimeInUSeconds ( )
static

Gets the current time in microseconds, used in FPS calulations.

Returns
void.

◆ displayFrameRate()

static void Engine::Application::displayFrameRate ( )
static

Display's the application's current frame-rate to the console.

Returns
void.

◆ doesFileExist()

static bool Engine::Application::doesFileExist ( const char * filename)
static

◆ drawFrame()

static void Engine::Application::drawFrame ( )
static

Draw a single frame.

◆ event()

virtual void Engine::Application::event ( )
protectedpure virtual

◆ exit()

static void Engine::Application::exit ( )
static

Stops the drawing loop, exits and cleans-up the program.

Returns
void.

◆ getAppName()

static const String & Engine::Application::getAppName ( )
static

◆ getAppPath()

static const String & Engine::Application::getAppPath ( )
static

◆ getAspectRatio()

static float Engine::Application::getAspectRatio ( )
static
Returns
The application's width / height

◆ getBackgroundColor()

static Vector4f Engine::Application::getBackgroundColor ( )
static

◆ getConfigPath()

static const String & Engine::Application::getConfigPath ( )
static

◆ getDisplaySceneList()

static const List< Raster::Display * > & Engine::Application::getDisplaySceneList ( )
inlinestatic
Returns
The list of currently rendering display-scenes.

◆ getFileSize()

static size_t Engine::Application::getFileSize ( const char * filename)
static

◆ getFontPath()

static const String & Engine::Application::getFontPath ( )
static

◆ getFrameRate()

static uint Engine::Application::getFrameRate ( )
inlinestatic

◆ getHeight()

static uint Engine::Application::getHeight ( )
static

Gets the application height.

Returns
The application's height.

◆ getImagePath()

static const String & Engine::Application::getImagePath ( )
static

◆ getIqmPath()

static const String & Engine::Application::getIqmPath ( )
static

◆ getRenderThreadID()

static Thread::id Engine::Application::getRenderThreadID ( )
inlinestatic

◆ getSoundPath()

static const String & Engine::Application::getSoundPath ( )
static

◆ getState()

static RenderState Engine::Application::getState ( )
static

◆ getWidth()

static uint Engine::Application::getWidth ( )
static

Gets the application width.

Returns
The application's width.

◆ initialize() [1/2]

void Engine::Application::initialize ( Raster::GeometricBase * pObject,
Raster::Scene * pScene,
bool addObjectToScene )

Initialize all the Materials for the given GeometricBase object and add it the Scene when completed.

Parameters
TheGeometricBase object containing the Materials to initialize.
TheScene to add the GeometricBase object.

◆ initialize() [2/2]

static void Engine::Application::initialize ( UintRectangle rect,
int argc,
char ** argv )
static

Initializes the application. GPU resources will not be available until this method is complete. If an application has already been constructed, the application singleton object is then initialized.

Parameters
thedesired screen geometry
Returns
void.

◆ initializeInstance()

void Engine::Application::initializeInstance ( const UintRectangle & rect,
int argc,
char ** argv )
protected
Parameters
thescreen geometry
theapplication argument length
theapplication argument array

◆ instance()

static Application * Engine::Application::instance ( )
inlinestatic

◆ isLibraryLoaded()

static bool Engine::Application::isLibraryLoaded ( const char * library)
static
Parameters
Libraryname and optional path.
Returns
True if the given library has been loaded into the executable.

◆ isPlaying()

static bool Engine::Application::isPlaying ( Handle handle)
static

/return True if this handle is already playing.

◆ loadLibrary()

static void Engine::Application::loadLibrary ( const char * library)
static
Parameters
Libraryname and optional path.

◆ loadSound()

static Handle Engine::Application::loadSound ( const char * filename)
static
Parameters
Thefilename of the sound sample.
Returns
Handle for the given sound.

◆ operator=()

void Engine::Application::operator= ( const Application & )
protected

Not implemented, not copyable

◆ platformCleanup()

virtual void Engine::Application::platformCleanup ( )
protectedpure virtual

◆ playSound()

static void Engine::Application::playSound ( Handle handle,
bool loop = false,
bool fadeIn = false )
static

/param The handle of the sound sample returned-by loadSound.

◆ removeAnimation()

static void Engine::Application::removeAnimation ( Schedule::Frame * pFrameHandler)
inlinestatic

◆ removeEventHandler()

static void Engine::Application::removeEventHandler ( EventHandler * pObject)
static

◆ removeFrameHandler()

static void Engine::Application::removeFrameHandler ( Schedule::Frame * pPreRenderHandler,
Schedule::RenderSchedule renderSchedule )
static

Unregister an object prior notified of a new frame about to be rendered.

Parameters
Pointerto FrameHandler object.
Returns
void.

◆ removeFrameTask()

static void Engine::Application::removeFrameTask ( Schedule::Task * pFrameTask)
static

◆ removeScene()

static void Engine::Application::removeScene ( Raster::Display * pScene)
static

◆ removeTimer()

static void Engine::Application::removeTimer ( Timer * pTimer)
static

/param Pointer to a Timer object.

◆ render()

void Engine::Application::render ( )

Performs the buffer swapping and draw calls.

Returns
void.

◆ renderScene()

void Engine::Application::renderScene ( Raster::Display * pScene)

Renders the scene to specific framebuffer.

Returns
void.

◆ resize()

static void Engine::Application::resize ( uint width,
uint height )
static

Gets the application GL program object.

Parameters
widthThe width of this application.
heightThe height of this application.
Returns
void.

◆ resume()

static void Engine::Application::resume ( )
static

Stops the drawing loop

Returns
void.

◆ run()

static void Engine::Application::run ( )
static

Starts the drawing loop.

Returns
void.

◆ runEventLoop()

virtual void Engine::Application::runEventLoop ( )
protectedpure virtual

Starts the main rendering loop. This will keep running until the application is stopped or stop() is called.

Returns
void.

◆ sendEvent()

static void Engine::Application::sendEvent ( const Event & event)
static

Utility method for sending a new event to the graphics loop. NOTE: This is primarily used for unit-testing

Parameters
Arefence to the Event.

◆ setAppName()

static void Engine::Application::setAppName ( const char * name)
static

◆ setAppPath()

static void Engine::Application::setAppPath ( const char * appPath)
static

◆ setBackgroundColor()

static void Engine::Application::setBackgroundColor ( const Vector4f & color)
static

◆ setConfigPath()

static void Engine::Application::setConfigPath ( const char * appPath)
static

◆ setFontPath()

static void Engine::Application::setFontPath ( const char * appPath)
static

◆ setImagePath()

static void Engine::Application::setImagePath ( const char * appPath)
static

◆ setIqmPath()

static void Engine::Application::setIqmPath ( const char * appPath)
static

◆ setSoundPath()

static void Engine::Application::setSoundPath ( const char * appPath)
static

◆ setVolume()

static void Engine::Application::setVolume ( float volume)
static

/param Value [0.0, 1.0].

◆ stop()

static void Engine::Application::stop ( )
static

Stops the drawing loop

Returns
void.

◆ stopSound()

static void Engine::Application::stopSound ( Handle handle,
bool fadeOut = false )
static

/param The handle of the sound sample returned-by loadSound.

◆ unloadLibrary()

static void Engine::Application::unloadLibrary ( const char * library)
static
Parameters
Libraryname and optional path.

◆ writeFileData() [1/2]

template<typename T >
static void Engine::Application::writeFileData ( const char * filename,
Initializer< T * > pData,
Initializer< size_t > dataSize )
static
Parameters
Thefilename to write data.
Thedata buffers to read.
Thesize of the data buffers in bytes to write.
Offset.

◆ writeFileData() [2/2]

template<typename T >
static void Engine::Application::writeFileData ( const char * filename,
T * pData,
size_t dataSize )
static
Parameters
Thefilename to write data.
Thedata buffer to read.
Thesize of the data buffer in bytes to write.
Offset.

Member Data Documentation

◆ appName

String Engine::Application::appName
staticprotected

◆ appPath

String Engine::Application::appPath
staticprotected

◆ argc

int Engine::Application::argc
protected

Application argument array-length.

◆ argv

char** Engine::Application::argv
protected

Application argument array

◆ backgroundColor

Vector4f Engine::Application::backgroundColor
protected

Backgound color for the window-system framebuffer.

◆ configPath

String Engine::Application::configPath
staticprotected

◆ fontPath

String Engine::Application::fontPath
staticprotected

◆ frameRate

uint Engine::Application::frameRate
protected

The refresh-rate of the monitor.

◆ height

int Engine::Application::height
protected

The height of this application. This should be the same height as the rendering surface.

◆ imagePath

String Engine::Application::imagePath
staticprotected

◆ iqmPath

String Engine::Application::iqmPath
staticprotected

◆ materialInitializer

HeapArray< Surface::Material::Initializer > Engine::Application::materialInitializer
protected

◆ newMaterialMutex

Mutex Engine::Application::newMaterialMutex
staticprotected

Ensure thread-saftey as calls to add and remove frameHandlers can be invoked from any threads.

◆ pDisplayScene

List< Raster::Display * > Engine::Application::pDisplayScene
protected

List of scenes that will be rendered to a visual display. Orthographic scenes are rendered post perspective ones.

◆ pEventHandler

EventHandlerList Engine::Application::pEventHandler
protected

Objects registered for Event callbacks.

◆ pInstance

Application* Engine::Application::pInstance
staticprotected

The singleton application object, instantiated globally in derived platform.

◆ postRenderMutex

Mutex Engine::Application::postRenderMutex
staticprotected

Ensure thread-saftey as calls to add and remove frameHandlers can be invoked from any threads.

◆ pPostRenderHandler

List< Schedule::Frame * > Engine::Application::pPostRenderHandler
staticprotected

Set of objects that are to be called-back after to each call (frame) to render.

◆ pPreRenderHandler

List< Schedule::Frame * > Engine::Application::pPreRenderHandler
staticprotected

Set of objects that are to be called-back prior to each call (frame) to render.

◆ preRenderMutex

Mutex Engine::Application::preRenderMutex
staticprotected

Ensure thread-saftey as calls to add and remove frameHandlers can be invoked from any threads.

◆ renderThreadID

Thread::id Engine::Application::renderThreadID
protected

◆ soundPath

String Engine::Application::soundPath
staticprotected

◆ state

RenderState Engine::Application::state
staticprotected

◆ timer

TimerIDMap Engine::Application::timer
protected

The currently running timers.

◆ width

int Engine::Application::width
protected

The width of this application. This should be the same width as the rendering surface.

◆ xOffset

int Engine::Application::xOffset
protected

The horizontal offset of the application window.

◆ yOffset

int Engine::Application::yOffset
protected

The vertical offset of the application window.


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