Gosu::Win Namespace Reference

Implementation helpers for the Windows platform. More...


Functions

HINSTANCE instance ()
void handleMessage ()
void processMessages ()
void registerMessageHook (const boost::function< bool(MSG &)> &hook)
GOSU_NORETURN void throwLastError (const std::string &action="")
template<typename T>
check (T valToCheck, const std::string &action="")
template<typename T>
void releaseComPtr (T *ptr)
template<typename T>
boost::shared_ptr< T > shareComPtr (T *ptr)
std::wstring appFilename ()
std::wstring appDirectory ()


Detailed Description

Implementation helpers for the Windows platform.

Function Documentation

std::wstring Gosu::Win::appDirectory (  ) 

Returns the executable's containing directory.

std::wstring Gosu::Win::appFilename (  ) 

Returns the executable's filename.

template<typename T>
T Gosu::Win::check ( valToCheck,
const std::string &  action = "" 
) [inline]

Small helper function that throws an exception whenever the value passed through is false.

Note that this doesn't make sense for all Windows API functions, but for most of them.

References throwLastError().

void Gosu::Win::handleMessage (  ) 

Blocking function which waits for the next message, processes it, then returns.

HINSTANCE Gosu::Win::instance (  ) 

Returns the instance handle of the application.

void Gosu::Win::processMessages (  ) 

Non-blocking function which processes all waiting messages but does not wait for further incoming messages.

void Gosu::Win::registerMessageHook ( const boost::function< bool(MSG &)> &  hook  ) 

Registers a function to be called by handleMessage and processMessages.

Every message is passed to the hooks and not processed further if any hook function returns true.

template<typename T>
boost::shared_ptr<T> Gosu::Win::shareComPtr ( T *  ptr  )  [inline]

Small helper function that transfers ownership of a COM interface to a boost::shared_ptr.

GOSU_NORETURN void Gosu::Win::throwLastError ( const std::string &  action = ""  ) 

Throws an exception according to the error which GetLastError() returns, optionally prefixed with "While <action>, the following error occured: ".

Referenced by check().


Generated on Sat Feb 7 22:34:54 2009 for Gosu by  doxygen 1.5.5