Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Emma::IInstance Class Reference

This interface is the main interface for using an Emma instance. More...

#include <EmmaIInstance.h>

Inheritance diagram for Emma::IInstance:

Emma::Instance List of all members.

Public Member Functions

virtual EMMA_EXPORT Fusion::ResultType setWindow (IWindow *w)=0
 Sets the IWindow object for the rendering window that Emma should render into.
virtual EMMA_EXPORT Fusion::ResultType registerEventHandler (uint32_t mask, EventHandler *handler, Fusion::Value *param=NULL)=0
 Registers a handler for given event type(s).
virtual EMMA_EXPORT Fusion::ResultType registerInternalEventHandler (uint32_t mask, EventHandler *handler)=0
 Registers a handler for given event type(s) that can be overridden by the content handlers.
virtual EMMA_EXPORT Fusion::ResultType unregisterEventHandler (uint32_t mask, EventHandler *handler, Fusion::Value *param=NULL)=0
 Unregisters the previously set handler for given event type(s).
virtual EMMA_EXPORT Fusion::ResultType unregisterInternalEventHandler (uint32_t mask, EventHandler *handler)=0
 Unregisters the previously set handler for given event type(s).
virtual EMMA_EXPORT Fusion::ResultType registerStreamHandler (const Fusion::UTF8String &, const Fusion::UTF8String &, Fusion::IObject *)=0
 Registers a handler for a given stream type.
virtual EMMA_EXPORT Fusion::ResultType unregisterStreamHandler (const Fusion::UTF8String &ext, const Fusion::UTF8String &mimetype)=0
 Unregisters the previously set handler for a given stream type.
virtual EMMA_EXPORT Fusion::ResultType registerProtocolHandler (const Fusion::UTF8String &protocol, Fusion::IDataStreamHandlerFactory *h)=0
 Registers a protocol handler for this instance For example, the mozilla plugin can register itself as the handler for the 'http' protocol so Emma uses Mozilla for downloading http assets.
virtual EMMA_EXPORT Fusion::ResultType unregisterProtocolHandler (const Fusion::UTF8String &protocol)=0
 Unregisters the previously set protocol handler for a given protocol type.
virtual EMMA_EXPORT Fusion::ResultType registerErrorLogHandler (ErrorLogHandler *handler)=0
 Registers a handler for errors.
virtual EMMA_EXPORT Fusion::ResultType unregisterErrorLogHandler (ErrorLogHandler *handler)=0
 Unregisters the previously set error handler.
virtual EMMA_EXPORT Fusion::ResultType registerExternalCallHandler (ExternalCallHandler *handler)=0
 Registers a handler for external calls (using the global call() function).
virtual EMMA_EXPORT Fusion::ResultType unregisterExternalCallHandler (ExternalCallHandler *handler)=0
 Unregisters the previously set external call handler.
virtual EMMA_EXPORT Fusion::ResultType processEvent (const Event &event)=0
 Sends an event into the instance.
virtual EMMA_EXPORT Fusion::ResultType processEvent (const SDL_Event &event)=0
virtual EMMA_EXPORT Fusion::ResultType addDeferredEvent (Fusion::IObject *self, const Fusion::Id &id, const Fusion::Value &val)=0
 Add an event to the queue which will be processed later to set the passed property of the passed object to the passed value.
virtual EMMA_EXPORT Fusion::ResultType addDeferredEvent (Fusion::IObject *self, const Fusion::Id &id, const Fusion::Vector< Fusion::Value > &vals)=0
virtual EMMA_EXPORT Fusion::ResultType addDeferredEvent (const char *str)=0
virtual EMMA_EXPORT Fusion::ResultType run ()=0
 loads the root file, if needed, and runs the render loop
virtual EMMA_EXPORT Fusion::IEnginegetIEngine ()=0
 Return the IEngine pointer for this instance.
virtual EMMA_EXPORT Fusion::ResultType setRenderManager (Fusion::IObject *)=0
 A module that implements the IRenderManager interface can become the renderer for Emma by setting itself as the rendermanager using this method.
virtual EMMA_EXPORT Fusion::ResultType setRenderManager2D (Fusion::IObject *)=0
 A module that implements the IRenderManager2D interface can become the 2Drenderer for Emma by setting itself as the rendermanager using this method.
virtual EMMA_EXPORT IRenderManagergetRenderManager ()=0
 Returns the IRenderManager pointer to the currently registered node handler module.
virtual EMMA_EXPORT IRenderManager2DgetRenderManager2D ()=0
 Returns the IRenderManager2D pointer to the currently registered 2D render module.
virtual EMMA_EXPORT IWindowgetIWindow ()=0
 Returns the IWindow pointer for width, height, etc.
virtual EMMA_EXPORT double getCurrentTime () const =0
 Returns the current Emma system time, synchronized to the audio clock.
virtual EMMA_EXPORT const
Fusion::UTF8String
getRootFileName () const =0
 Returns the current asset's full file path and name.
virtual EMMA_EXPORT const
Fusion::UTF8String
getRootFileBase () const =0
 Returns the current asset's full file path ( without the name ).
virtual EMMA_EXPORT bool isFilterMode () const =0
 Return true is we are in filter mode (e.g., '-c' specified on command line).
virtual EMMA_EXPORT void saveScreenshotToFile (Fusion::UTF8String name)=0
 saves a screenshot of the current scene to a file
virtual EMMA_EXPORT void requestTerminate ()=0
 terminates the instance.
virtual EMMA_EXPORT void addEventsProcessed (Fusion::IObject *obj)=0
 Add the passed object to the list of objects whose eventsProcessed() methods will get called at the end of the next event processing cycle.
virtual EMMA_EXPORT void addInitialize (Fusion::IObject *obj)=0
 Add the passed object to the list of objects whose initialize() methods will get called at the start of the next event processing cycle.
virtual EMMA_EXPORT Fusion::UTF8String resolveFileName (const Fusion::UTF8String &fileName, const Fusion::UTF8String &fileBase, int32_t i=0) const =0
 Resolve the passed filename string using the passed filebase.
virtual EMMA_EXPORT bool getRoot (Fusion::Value &val) const =0
 Return the "real" root of the object hierarchy.
virtual EMMA_EXPORT bool getSettingsValue (const Fusion::UTF8String &str, Fusion::Value &val) const =0
 Return the global settings value with the passed string.
virtual EMMA_EXPORT IMutexcreateMutex ()=0
 create a Mutex
virtual EMMA_EXPORT IGatecreateGate ()=0
 create a Gate
virtual EMMA_EXPORT void logAndExitEmmaInstanceGracefully ()=0
 write a crash log file and exit this instance gracefully only to be called in a non-recoverable error situation to exit emma gracefully without crashing and burning

Static Public Member Functions

static EMMA_EXPORT void log (Fusion::LogLevelType, const char *module, const char *,...)
 Logs a message for this instance This method does automatic thread-lookup to find the correct Instance object.
static EMMA_EXPORT IInstancegetIInstance ()
 Return the IInstance pointer for the caller's thread This method does automatic thread-lookup to find the correct Instance object.
static EMMA_EXPORT void setIInstance (IInstance *)
 This method sets the IInstance pointer for this thread This can be used by applications that start a thread on their own and then need to access the instance pointer on that thread.

Detailed Description

This interface is the main interface for using an Emma instance.


Member Function Documentation

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::addDeferredEvent const char *  str  )  [pure virtual]
 

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::addDeferredEvent Fusion::IObject self,
const Fusion::Id id,
const Fusion::Vector< Fusion::Value > &  vals
[pure virtual]
 

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::addDeferredEvent Fusion::IObject self,
const Fusion::Id id,
const Fusion::Value val
[pure virtual]
 

Add an event to the queue which will be processed later to set the passed property of the passed object to the passed value.

Implemented in Emma::Instance.

virtual EMMA_EXPORT void Emma::IInstance::addEventsProcessed Fusion::IObject obj  )  [pure virtual]
 

Add the passed object to the list of objects whose eventsProcessed() methods will get called at the end of the next event processing cycle.

Implemented in Emma::Instance.

virtual EMMA_EXPORT void Emma::IInstance::addInitialize Fusion::IObject obj  )  [pure virtual]
 

Add the passed object to the list of objects whose initialize() methods will get called at the start of the next event processing cycle.

Implemented in Emma::Instance.

virtual EMMA_EXPORT IGate* Emma::IInstance::createGate  )  [pure virtual]
 

create a Gate

Implemented in Emma::Instance.

virtual EMMA_EXPORT IMutex* Emma::IInstance::createMutex  )  [pure virtual]
 

create a Mutex

Implemented in Emma::Instance.

virtual EMMA_EXPORT double Emma::IInstance::getCurrentTime  )  const [pure virtual]
 

Returns the current Emma system time, synchronized to the audio clock.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::IEngine* Emma::IInstance::getIEngine  )  [pure virtual]
 

Return the IEngine pointer for this instance.

Implemented in Emma::Instance.

static EMMA_EXPORT IInstance* Emma::IInstance::getIInstance  )  [static]
 

Return the IInstance pointer for the caller's thread This method does automatic thread-lookup to find the correct Instance object.

Reimplemented in Emma::Instance.

virtual EMMA_EXPORT IWindow* Emma::IInstance::getIWindow  )  [pure virtual]
 

Returns the IWindow pointer for width, height, etc.

Implemented in Emma::Instance.

virtual EMMA_EXPORT IRenderManager* Emma::IInstance::getRenderManager  )  [pure virtual]
 

Returns the IRenderManager pointer to the currently registered node handler module.

Implemented in Emma::Instance.

virtual EMMA_EXPORT IRenderManager2D* Emma::IInstance::getRenderManager2D  )  [pure virtual]
 

Returns the IRenderManager2D pointer to the currently registered 2D render module.

Implemented in Emma::Instance.

virtual EMMA_EXPORT bool Emma::IInstance::getRoot Fusion::Value val  )  const [pure virtual]
 

Return the "real" root of the object hierarchy.

Implemented in Emma::Instance.

virtual EMMA_EXPORT const Fusion::UTF8String& Emma::IInstance::getRootFileBase  )  const [pure virtual]
 

Returns the current asset's full file path ( without the name ).

Implemented in Emma::Instance.

virtual EMMA_EXPORT const Fusion::UTF8String& Emma::IInstance::getRootFileName  )  const [pure virtual]
 

Returns the current asset's full file path and name.

Implemented in Emma::Instance.

virtual EMMA_EXPORT bool Emma::IInstance::getSettingsValue const Fusion::UTF8String str,
Fusion::Value val
const [pure virtual]
 

Return the global settings value with the passed string.

Implemented in Emma::Instance.

virtual EMMA_EXPORT bool Emma::IInstance::isFilterMode  )  const [pure virtual]
 

Return true is we are in filter mode (e.g., '-c' specified on command line).

Implemented in Emma::Instance.

static EMMA_EXPORT void Emma::IInstance::log Fusion::LogLevelType  ,
const char *  module,
const char *  ,
  ...
[static]
 

Logs a message for this instance This method does automatic thread-lookup to find the correct Instance object.

virtual EMMA_EXPORT void Emma::IInstance::logAndExitEmmaInstanceGracefully  )  [pure virtual]
 

write a crash log file and exit this instance gracefully only to be called in a non-recoverable error situation to exit emma gracefully without crashing and burning

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::processEvent const SDL_Event &  event  )  [pure virtual]
 

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::processEvent const Event event  )  [pure virtual]
 

Sends an event into the instance.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::registerErrorLogHandler ErrorLogHandler handler  )  [pure virtual]
 

Registers a handler for errors.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::registerEventHandler uint32_t  mask,
EventHandler handler,
Fusion::Value param = NULL
[pure virtual]
 

Registers a handler for given event type(s).

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::registerExternalCallHandler ExternalCallHandler handler  )  [pure virtual]
 

Registers a handler for external calls (using the global call() function).

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::registerInternalEventHandler uint32_t  mask,
EventHandler handler
[pure virtual]
 

Registers a handler for given event type(s) that can be overridden by the content handlers.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::registerProtocolHandler const Fusion::UTF8String protocol,
Fusion::IDataStreamHandlerFactory h
[pure virtual]
 

Registers a protocol handler for this instance For example, the mozilla plugin can register itself as the handler for the 'http' protocol so Emma uses Mozilla for downloading http assets.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::registerStreamHandler const Fusion::UTF8String ,
const Fusion::UTF8String ,
Fusion::IObject
[pure virtual]
 

Registers a handler for a given stream type.

Implemented in Emma::Instance.

virtual EMMA_EXPORT void Emma::IInstance::requestTerminate  )  [pure virtual]
 

terminates the instance.

When complete a TERM_COMPLETE event is sent to the main thread.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::UTF8String Emma::IInstance::resolveFileName const Fusion::UTF8String fileName,
const Fusion::UTF8String fileBase,
int32_t  i = 0
const [pure virtual]
 

Resolve the passed filename string using the passed filebase.

The result is the resolved string. The passed i gives the index of the path to use, if there are multiple paths. If there is no path with the passed index, the empty string is returned. See Filename Resolution for more details.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::run  )  [pure virtual]
 

loads the root file, if needed, and runs the render loop

Implemented in Emma::Instance.

virtual EMMA_EXPORT void Emma::IInstance::saveScreenshotToFile Fusion::UTF8String  name  )  [pure virtual]
 

saves a screenshot of the current scene to a file

Implemented in Emma::Instance.

static EMMA_EXPORT void Emma::IInstance::setIInstance IInstance  )  [static]
 

This method sets the IInstance pointer for this thread This can be used by applications that start a thread on their own and then need to access the instance pointer on that thread.

Reimplemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::setRenderManager Fusion::IObject  )  [pure virtual]
 

A module that implements the IRenderManager interface can become the renderer for Emma by setting itself as the rendermanager using this method.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::setRenderManager2D Fusion::IObject  )  [pure virtual]
 

A module that implements the IRenderManager2D interface can become the 2Drenderer for Emma by setting itself as the rendermanager using this method.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::setWindow IWindow w  )  [pure virtual]
 

Sets the IWindow object for the rendering window that Emma should render into.

Parameters:
w The container application should create an object that implements the IWindow interface to return handle, width and height information

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::unregisterErrorLogHandler ErrorLogHandler handler  )  [pure virtual]
 

Unregisters the previously set error handler.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::unregisterEventHandler uint32_t  mask,
EventHandler handler,
Fusion::Value param = NULL
[pure virtual]
 

Unregisters the previously set handler for given event type(s).

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::unregisterExternalCallHandler ExternalCallHandler handler  )  [pure virtual]
 

Unregisters the previously set external call handler.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::unregisterInternalEventHandler uint32_t  mask,
EventHandler handler
[pure virtual]
 

Unregisters the previously set handler for given event type(s).

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::unregisterProtocolHandler const Fusion::UTF8String protocol  )  [pure virtual]
 

Unregisters the previously set protocol handler for a given protocol type.

Implemented in Emma::Instance.

virtual EMMA_EXPORT Fusion::ResultType Emma::IInstance::unregisterStreamHandler const Fusion::UTF8String ext,
const Fusion::UTF8String mimetype
[pure virtual]
 

Unregisters the previously set handler for a given stream type.

Implemented in Emma::Instance.


The documentation for this class was generated from the following file:
Generated on Sat Apr 1 06:08:22 2006 for Emma SDK Guide by  doxygen 1.4.3