00001
00002
00003
00004 #ifndef GOSU_WINDOW_HPP
00005 #define GOSU_WINDOW_HPP
00006
00007 #include <Gosu/Fwd.hpp>
00008 #include <Gosu/Platform.hpp>
00009 #include <Gosu/Input.hpp>
00010 #include <boost/scoped_ptr.hpp>
00011 #include <boost/shared_ptr.hpp>
00012 #include <boost/function.hpp>
00013 #include <string>
00014
00015 #ifdef GOSU_IS_WIN
00016 #include <windows.h>
00017 #endif
00018
00019 namespace Gosu
00020 {
00024 class Window
00025 {
00026 struct Impl;
00027 boost::scoped_ptr<Impl> pimpl;
00028
00029 public:
00033 Window(unsigned width, unsigned height, bool fullscreen,
00034 double updateInterval = 16.666666);
00035 virtual ~Window();
00036
00037 std::wstring caption() const;
00038 void setCaption(const std::wstring& caption);
00039
00041 void show();
00043 void close();
00044
00047 virtual void update() {}
00050 virtual void draw() {}
00051
00054 virtual void buttonDown(Gosu::Button) {}
00056 virtual void buttonUp(Gosu::Button) {}
00057
00058
00059 #ifndef SWIG
00060 const Graphics& graphics() const;
00061 Graphics& graphics();
00062
00063 const Audio& audio() const;
00064 Audio& audio();
00065
00066 const Input& input() const;
00067 Input& input();
00068
00069 #ifdef GOSU_IS_WIN
00070
00071 HWND handle() const;
00072 virtual LRESULT handleMessage(UINT message, WPARAM wparam,
00073 LPARAM lparam);
00074 #else
00075
00076 typedef boost::shared_ptr<boost::function<void()> > SharedContext;
00077 SharedContext createSharedContext();
00078 #endif
00079
00080 #endif
00081 };
00082 }
00083
00084 #endif