WinUtility.hpp File Reference

Contains some functions which are used to implement Gosu on Windows and might be useful for advanced users who try to integrate Gosu in a Win32 application. More...

Go to the source code of this file.


Namespaces

namespace  Gosu
 The library's main namespace.
namespace  Gosu::Win
 Implementation helpers for the Windows platform.

Functions

HINSTANCE Gosu::Win::instance ()
 Returns the instance handle of the application.
void Gosu::Win::handleMessage ()
 Blocking function which waits for the next message, processes it, then returns.
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.
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: ".
template<typename T >
Gosu::Win::check (T valToCheck, const std::string &action="")
 Small helper function that throws an exception whenever the value passed through is false.
template<typename T >
void Gosu::Win::releaseComPtr (T *ptr)
template<typename T >
boost::shared_ptr< T > Gosu::Win::shareComPtr (T *ptr)
 Small helper function that transfers ownership of a COM interface to a boost::shared_ptr.
std::wstring Gosu::Win::appFilename ()
 Returns the executable's filename.
std::wstring Gosu::Win::appDirectory ()
 Returns the executable's containing directory.


Detailed Description

Contains some functions which are used to implement Gosu on Windows and might be useful for advanced users who try to integrate Gosu in a Win32 application.

Definition in file WinUtility.hpp.