Gosu
Namespaces | Functions
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

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

Functions

HINSTANCE Gosu::Win::instance ()
 Returns the instance handle of the application. More...
 
void Gosu::Win::handleMessage ()
 Blocking function which waits for the next message, processes it, then returns. More...
 
void Gosu::Win::processMessages ()
 Non-blocking function which processes all waiting messages but does not wait for further incoming messages. More...
 
void Gosu::Win::registerMessageHook (const std::tr1::function< bool(MSG &)> &hook)
 Registers a function to be called by handleMessage and processMessages. More...
 
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: ". More...
 
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. More...
 
template<typename T >
void Gosu::Win::releaseComPtr (T *ptr)
 
template<typename T >
std::tr1::shared_ptr< T > Gosu::Win::shareComPtr (T *ptr)
 Small helper function that transfers ownership of a COM interface to a std::tr1::shared_ptr. More...
 
std::wstring Gosu::Win::appFilename ()
 Returns the executable's filename. More...
 
std::wstring Gosu::Win::appDirectory ()
 Returns the executable's containing directory. More...
 

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.