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

Emma::Instance Class Reference

#include <EmmaInstance.h>

Inheritance diagram for Emma::Instance:

Emma::IInstance Emma::EventHandler List of all members.

Public Member Functions

 Instance (lua_State *L)
virtual ~Instance ()
virtual Fusion::ResultType setWindow (IWindow *)
 Sets the IWindow object for the rendering window that Emma should render into.
virtual Fusion::ResultType processEvent (const Event &event)
 Sends an event into the instance.
virtual Fusion::ResultType processEvent (const SDL_Event &event)
virtual Fusion::ResultType registerStreamHandler (const Fusion::UTF8String &, const Fusion::UTF8String &, Fusion::IObject *)
 Registers a handler for a given stream type.
virtual Fusion::ResultType unregisterStreamHandler (const Fusion::UTF8String &ext, const Fusion::UTF8String &mimetype)
 Unregisters the previously set handler for a given stream type.
virtual Fusion::ResultType registerProtocolHandler (const Fusion::UTF8String &protocol, Fusion::IDataStreamHandlerFactory *h)
 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 Fusion::ResultType unregisterProtocolHandler (const Fusion::UTF8String &protocol)
 Unregisters the previously set protocol handler for a given protocol type.
virtual Fusion::ResultType registerErrorLogHandler (ErrorLogHandler *handler)
 Registers a handler for errors.
virtual Fusion::ResultType unregisterErrorLogHandler (ErrorLogHandler *handler)
 Unregisters the previously set error handler.
virtual Fusion::ResultType setRenderManager (Fusion::IObject *)
 A module that implements the IRenderManager interface can become the renderer for Emma by setting itself as the rendermanager using this method.
virtual Fusion::ResultType setRenderManager2D (Fusion::IObject *)
 A module that implements the IRenderManager2D interface can become the 2Drenderer for Emma by setting itself as the rendermanager using this method.
virtual Fusion::ResultType registerEventHandler (uint32_t mask, EventHandler *handler, Fusion::Value *param=NULL)
 Registers a handler for given event type(s).
virtual Fusion::ResultType registerInternalEventHandler (uint32_t mask, EventHandler *handler)
 Registers a handler for given event type(s) that can be overridden by the content handlers.
virtual int32_t registerEventHandler (const Fusion::Value &self, const Fusion::UTF8String &name, const Fusion::Value &handler, const Fusion::Value &param)
virtual Fusion::ResultType unregisterEventHandler (uint32_t mask, EventHandler *handler, Fusion::Value *param=NULL)
 Unregisters the previously set handler for given event type(s).
virtual Fusion::ResultType unregisterInternalEventHandler (uint32_t mask, EventHandler *handler)
 Unregisters the previously set handler for given event type(s).
virtual void unregisterEventHandler (int32_t i)
virtual Fusion::ResultType registerExternalCallHandler (ExternalCallHandler *handler)
 Registers a handler for external calls (using the global call() function).
virtual Fusion::ResultType unregisterExternalCallHandler (ExternalCallHandler *handler)
 Unregisters the previously set external call handler.
virtual bool isFilterMode () const
 Return true is we are in filter mode (e.g., '-c' specified on command line).
virtual void saveScreenshotToFile (Fusion::UTF8String name)
 saves a screenshot of the current scene to a file
virtual IMutexcreateMutex ()
 create a Mutex
virtual IGatecreateGate ()
 create a Gate
virtual void logAndExitEmmaInstanceGracefully ()
 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
virtual bool handleEvent (const Event &event)
 Callback function that is implemented by the callee.
virtual IRenderManagergetRenderManager ()
 Returns the IRenderManager pointer to the currently registered node handler module.
virtual IRenderManager2DgetRenderManager2D ()
 Returns the IRenderManager2D pointer to the currently registered 2D render module.
virtual IWindowgetIWindow ()
 Returns the IWindow pointer for width, height, etc.
virtual double getCurrentTime () const
 Returns the current Emma system time, synchronized to the audio clock.
void toggleFrameRateDisplay ()
virtual const Fusion::UTF8StringgetRootFileName () const
 Returns the current asset's full file path and name.
virtual const Fusion::UTF8StringgetRootFileBase () const
 Returns the current asset's full file path ( without the name ).
LoggergetLogger ()
virtual void setThreadOwner (bool take)
virtual void requestTerminate ()
 terminates the instance.
virtual void addEventsProcessed (Fusion::IObject *obj)
 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 void addInitialize (Fusion::IObject *obj)
 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 Fusion::ResultType addDeferredEvent (Fusion::IObject *self, const Fusion::Id &id, const Fusion::Value &val)
 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 Fusion::ResultType addDeferredEvent (Fusion::IObject *self, const Fusion::Id &id, const Fusion::Vector< Fusion::Value > &vals)
virtual Fusion::ResultType addDeferredEvent (const char *str)
virtual Fusion::UTF8String resolveFileName (const Fusion::UTF8String &fileName, const Fusion::UTF8String &fileBase, int32_t i=0) const
 Resolve the passed filename string using the passed filebase.
virtual bool getRoot (Fusion::Value &val) const
 Return the "real" root of the object hierarchy.
virtual bool getSettingsValue (const Fusion::UTF8String &str, Fusion::Value &val) const
 Return the global settings value with the passed string.
void setRootFileName (const Fusion::UTF8String &filename)
virtual Fusion::ResultType run ()
 loads the root file, if needed, and runs the render loop
ErrorLogHandlergetErrorLogHandler ()
bool isTerminationRequested ()
virtual Fusion::IEnginegetIEngine ()
 Return the IEngine pointer for this instance.
void handleExternalCall (const Fusion::UTF8String &func, const Fusion::Vector< const char * > &vals)

Static Public Member Functions

static InstancegetInstance ()
static void setInstance (Instance *i)
static IInstancegetIInstance ()
 Return the IInstance pointer for the caller's thread This method does automatic thread-lookup to find the correct Instance object.
static void setIInstance (IInstance *i)
 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.
static void setAppEnvironment (const Fusion::UTF8String appName, const Fusion::UTF8String &appPath)
static void setLuaEnvironment (Fusion::Args &args)

Constructor & Destructor Documentation

Emma::Instance::Instance lua_State *  L  ) 
 

virtual Emma::Instance::~Instance  )  [virtual]
 


Member Function Documentation

virtual Fusion::ResultType Emma::Instance::addDeferredEvent const char *  str  )  [virtual]
 

Implements Emma::IInstance.

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

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::addDeferredEvent Fusion::IObject self,
const Fusion::Id id,
const Fusion::Value val
[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.

Implements Emma::IInstance.

virtual void Emma::Instance::addEventsProcessed Fusion::IObject obj  )  [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.

Implements Emma::IInstance.

virtual void Emma::Instance::addInitialize Fusion::IObject obj  )  [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.

Implements Emma::IInstance.

virtual IGate* Emma::Instance::createGate  )  [inline, virtual]
 

create a Gate

Implements Emma::IInstance.

virtual IMutex* Emma::Instance::createMutex  )  [inline, virtual]
 

create a Mutex

Implements Emma::IInstance.

virtual double Emma::Instance::getCurrentTime  )  const [inline, virtual]
 

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

Implements Emma::IInstance.

ErrorLogHandler* Emma::Instance::getErrorLogHandler  )  [inline]
 

virtual Fusion::IEngine* Emma::Instance::getIEngine  )  [inline, virtual]
 

Return the IEngine pointer for this instance.

Implements Emma::IInstance.

static IInstance* Emma::Instance::getIInstance  )  [inline, static]
 

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

Reimplemented from Emma::IInstance.

static Instance* Emma::Instance::getInstance  )  [inline, static]
 

virtual IWindow* Emma::Instance::getIWindow  )  [inline, virtual]
 

Returns the IWindow pointer for width, height, etc.

Implements Emma::IInstance.

Logger* Emma::Instance::getLogger  )  [inline]
 

virtual IRenderManager* Emma::Instance::getRenderManager  )  [inline, virtual]
 

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

Implements Emma::IInstance.

virtual IRenderManager2D* Emma::Instance::getRenderManager2D  )  [inline, virtual]
 

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

Implements Emma::IInstance.

virtual bool Emma::Instance::getRoot Fusion::Value val  )  const [virtual]
 

Return the "real" root of the object hierarchy.

Implements Emma::IInstance.

virtual const Fusion::UTF8String& Emma::Instance::getRootFileBase  )  const [inline, virtual]
 

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

Implements Emma::IInstance.

virtual const Fusion::UTF8String& Emma::Instance::getRootFileName  )  const [inline, virtual]
 

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

Implements Emma::IInstance.

virtual bool Emma::Instance::getSettingsValue const Fusion::UTF8String str,
Fusion::Value val
const [virtual]
 

Return the global settings value with the passed string.

Implements Emma::IInstance.

virtual bool Emma::Instance::handleEvent const Event event  )  [virtual]
 

Callback function that is implemented by the callee.

Parameters:
event specifies the time of the event. Event time will be the same for events occurring in the same render phase For example, PREUPDATE, POSTUPDATE, PRERENDER and POSTRENDER event callbacks will all pass the same event time for the same frame. Returning stop Emma from calling the rest of the handlers for this event If you return true, Emma will keep on calling rest of the handlers for this event

Implements Emma::EventHandler.

void Emma::Instance::handleExternalCall const Fusion::UTF8String func,
const Fusion::Vector< const char * > &  vals
 

virtual bool Emma::Instance::isFilterMode  )  const [inline, virtual]
 

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

Implements Emma::IInstance.

bool Emma::Instance::isTerminationRequested  )  [inline]
 

virtual void Emma::Instance::logAndExitEmmaInstanceGracefully  )  [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

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::processEvent const SDL_Event &  event  )  [inline, virtual]
 

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::processEvent const Event event  )  [virtual]
 

Sends an event into the instance.

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::registerErrorLogHandler ErrorLogHandler handler  )  [virtual]
 

Registers a handler for errors.

Implements Emma::IInstance.

virtual int32_t Emma::Instance::registerEventHandler const Fusion::Value self,
const Fusion::UTF8String name,
const Fusion::Value handler,
const Fusion::Value param
[virtual]
 

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

Registers a handler for given event type(s).

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::registerExternalCallHandler ExternalCallHandler handler  )  [virtual]
 

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

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::registerInternalEventHandler uint32_t  mask,
EventHandler handler
[virtual]
 

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

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::registerProtocolHandler const Fusion::UTF8String protocol,
Fusion::IDataStreamHandlerFactory h
[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.

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::registerStreamHandler const Fusion::UTF8String ,
const Fusion::UTF8String ,
Fusion::IObject
[virtual]
 

Registers a handler for a given stream type.

Implements Emma::IInstance.

virtual void Emma::Instance::requestTerminate  )  [virtual]
 

terminates the instance.

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

Implements Emma::IInstance.

virtual Fusion::UTF8String Emma::Instance::resolveFileName const Fusion::UTF8String fileName,
const Fusion::UTF8String fileBase,
int32_t  i = 0
const [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.

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::run  )  [virtual]
 

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

Implements Emma::IInstance.

virtual void Emma::Instance::saveScreenshotToFile Fusion::UTF8String  name  )  [virtual]
 

saves a screenshot of the current scene to a file

Implements Emma::IInstance.

static void Emma::Instance::setAppEnvironment const Fusion::UTF8String  appName,
const Fusion::UTF8String appPath
[static]
 

static void Emma::Instance::setIInstance IInstance i  )  [inline, 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 from Emma::IInstance.

static void Emma::Instance::setInstance Instance i  )  [inline, static]
 

static void Emma::Instance::setLuaEnvironment Fusion::Args args  )  [static]
 

virtual Fusion::ResultType Emma::Instance::setRenderManager Fusion::IObject  )  [virtual]
 

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

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::setRenderManager2D Fusion::IObject  )  [virtual]
 

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

Implements Emma::IInstance.

void Emma::Instance::setRootFileName const Fusion::UTF8String filename  ) 
 

virtual void Emma::Instance::setThreadOwner bool  take  )  [inline, virtual]
 

virtual Fusion::ResultType Emma::Instance::setWindow IWindow  )  [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

Implements Emma::IInstance.

void Emma::Instance::toggleFrameRateDisplay  )  [inline]
 

virtual Fusion::ResultType Emma::Instance::unregisterErrorLogHandler ErrorLogHandler handler  )  [virtual]
 

Unregisters the previously set error handler.

Implements Emma::IInstance.

virtual void Emma::Instance::unregisterEventHandler int32_t  i  )  [virtual]
 

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

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

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::unregisterExternalCallHandler ExternalCallHandler handler  )  [virtual]
 

Unregisters the previously set external call handler.

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::unregisterInternalEventHandler uint32_t  mask,
EventHandler handler
[virtual]
 

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

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::unregisterProtocolHandler const Fusion::UTF8String protocol  )  [virtual]
 

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

Implements Emma::IInstance.

virtual Fusion::ResultType Emma::Instance::unregisterStreamHandler const Fusion::UTF8String ext,
const Fusion::UTF8String mimetype
[virtual]
 

Unregisters the previously set handler for a given stream type.

Implements Emma::IInstance.


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