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> | |
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 () |
std::wstring Gosu::Win::appDirectory | ( | ) |
Returns the executable's containing directory.
std::wstring Gosu::Win::appFilename | ( | ) |
Returns the executable's filename.
T Gosu::Win::check | ( | T | 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.
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().