]> git.sesse.net Git - casparcg/blob - SFML-1.6/include/SFML/Graphics/RenderWindow.hpp
Removed GLEE from dependencies.
[casparcg] / SFML-1.6 / include / SFML / Graphics / RenderWindow.hpp
1 ////////////////////////////////////////////////////////////\r
2 //\r
3 // SFML - Simple and Fast Multimedia Library\r
4 // Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)\r
5 //\r
6 // This software is provided 'as-is', without any express or implied warranty.\r
7 // In no event will the authors be held liable for any damages arising from the use of this software.\r
8 //\r
9 // Permission is granted to anyone to use this software for any purpose,\r
10 // including commercial applications, and to alter it and redistribute it freely,\r
11 // subject to the following restrictions:\r
12 //\r
13 // 1. The origin of this software must not be misrepresented;\r
14 //    you must not claim that you wrote the original software.\r
15 //    If you use this software in a product, an acknowledgment\r
16 //    in the product documentation would be appreciated but is not required.\r
17 //\r
18 // 2. Altered source versions must be plainly marked as such,\r
19 //    and must not be misrepresented as being the original software.\r
20 //\r
21 // 3. This notice may not be removed or altered from any source distribution.\r
22 //\r
23 ////////////////////////////////////////////////////////////\r
24 \r
25 #ifndef SFML_RENDERWINDOW_HPP\r
26 #define SFML_RENDERWINDOW_HPP\r
27 \r
28 ////////////////////////////////////////////////////////////\r
29 // Headers\r
30 ////////////////////////////////////////////////////////////\r
31 #include <SFML/Graphics/Image.hpp>\r
32 #include <SFML/Graphics/RenderTarget.hpp>\r
33 #include <SFML/Window/Window.hpp>\r
34 #include <string>\r
35 \r
36 \r
37 namespace sf\r
38 {\r
39 class Drawable;\r
40 \r
41 ////////////////////////////////////////////////////////////\r
42 /// Simple wrapper for sf::Window that allows easy\r
43 /// 2D rendering\r
44 ////////////////////////////////////////////////////////////\r
45 class SFML_API RenderWindow : public Window, public RenderTarget\r
46 {\r
47 public :\r
48 \r
49     ////////////////////////////////////////////////////////////\r
50     /// Default constructor\r
51     ///\r
52     ////////////////////////////////////////////////////////////\r
53     RenderWindow();\r
54 \r
55     ////////////////////////////////////////////////////////////\r
56     /// Construct the window\r
57     ///\r
58     /// \param Mode :        Video mode to use\r
59     /// \param Title :       Title of the window\r
60     /// \param WindowStyle : Window style, see sf::Style (Resize | Close by default)\r
61     /// \param Params :      Creation parameters (see default constructor for default values)\r
62     ///\r
63     ////////////////////////////////////////////////////////////\r
64     RenderWindow(VideoMode Mode, const std::string& Title, unsigned long WindowStyle = Style::Resize | Style::Close, const WindowSettings& Params = WindowSettings());\r
65 \r
66     ////////////////////////////////////////////////////////////\r
67     /// Construct the window from an existing control\r
68     ///\r
69     /// \param Handle : Platform-specific handle of the control\r
70     /// \param Params : Creation parameters (see default constructor for default values)\r
71     ///\r
72     ////////////////////////////////////////////////////////////\r
73     RenderWindow(WindowHandle Handle, const WindowSettings& Params = WindowSettings());\r
74 \r
75     ////////////////////////////////////////////////////////////\r
76     /// Destructor\r
77     ///\r
78     ////////////////////////////////////////////////////////////\r
79     virtual ~RenderWindow();\r
80 \r
81     ////////////////////////////////////////////////////////////\r
82     /// Get the width of the rendering region of the window\r
83     ///\r
84     /// \return Width in pixels\r
85     ///\r
86     ////////////////////////////////////////////////////////////\r
87     virtual unsigned int GetWidth() const;\r
88 \r
89     ////////////////////////////////////////////////////////////\r
90     /// Get the height of the rendering region of the window\r
91     ///\r
92     /// \return Height in pixels\r
93     ///\r
94     ////////////////////////////////////////////////////////////\r
95     virtual unsigned int GetHeight() const;\r
96 \r
97     ////////////////////////////////////////////////////////////\r
98     /// Save the content of the window to an image\r
99     ///\r
100     /// \return Image instance containing the contents of the screen\r
101     ///\r
102     ////////////////////////////////////////////////////////////\r
103     Image Capture() const;\r
104 \r
105     ////////////////////////////////////////////////////////////\r
106     /// Convert a point in window coordinates into view coordinates\r
107     ///\r
108     /// \param WindowX :    X coordinate of the point to convert, relative to the window\r
109     /// \param WindowY :    Y coordinate of the point to convert, relative to the window\r
110     /// \param TargetView : Target view to convert the point to (NULL by default -- uses the current view)\r
111     ///\r
112     /// \return Converted point\r
113     ///\r
114     ////////////////////////////////////////////////////////////\r
115     sf::Vector2f ConvertCoords(unsigned int WindowX, unsigned int WindowY, const View* TargetView = NULL) const;\r
116 \r
117 private :\r
118 \r
119     ////////////////////////////////////////////////////////////\r
120     /// /see Window::OnCreate\r
121     ///\r
122     ////////////////////////////////////////////////////////////\r
123     virtual void OnCreate();\r
124 \r
125     ////////////////////////////////////////////////////////////\r
126     /// /see RenderTarget::Activate\r
127     ///\r
128     ////////////////////////////////////////////////////////////\r
129     virtual bool Activate(bool Active);\r
130 };\r
131 \r
132 } // namespace sf\r
133 \r
134 \r
135 #endif // SFML_RENDERWINDOW_HPP\r