CSFML

- Main Page
- Data Structures
- Files

- File List
- Globals

Window/Window.h
Go to the documentation of this file.
1 //
3 // SFML - Simple and Fast Multimedia Library
4 // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24
25 #ifndef SFML_WINDOW_H
26 #define SFML_WINDOW_H
27
29 // Headers
31 #include <SFML/Window/Export.h>
32 #include <SFML/Window/Event.h>
33 #include <SFML/Window/VideoMode.h>
34 #include <SFML/Window/WindowHandle.h>
35 #include <SFML/Window/Types.h>
36 #include <SFML/System/Vector2.h>
37
38
43 enum
44 {
45 sfNone = 0,
46 sfTitlebar = 1 << 0,
47 sfResize = 1 << 1,
48 sfClose = 1 << 2,
49 sfFullscreen = 1 << 3,
50 sfDefaultStyle = sfTitlebar | sfResize | sfClose
51 };
52
53
58 typedef struct
59 {
60 unsigned int depthBits;
61 unsigned int stencilBits;
62 unsigned int antialiasingLevel;
63 unsigned int majorVersion;
64 unsigned int minorVersion;
65 } sfContextSettings;
66
67
89 CSFML_WINDOW_API sfWindow* sfWindow_create(sfVideoMode mode, const char* title, sfUint32 style, const sfContextSettings* settings);
90
112 CSFML_WINDOW_API sfWindow* sfWindow_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style, const sfContextSettings* settings);
113
130 CSFML_WINDOW_API sfWindow* sfWindow_createFromHandle(sfWindowHandle handle, const sfContextSettings* settings);
131
138 CSFML_WINDOW_API void sfWindow_destroy(sfWindow* window);
139
152 CSFML_WINDOW_API void sfWindow_close(sfWindow* window);
153
166 CSFML_WINDOW_API sfBool sfWindow_isOpen(const sfWindow* window);
167
181 CSFML_WINDOW_API sfContextSettings sfWindow_getSettings(const sfWindow* window);
182
198 CSFML_WINDOW_API sfBool sfWindow_pollEvent(sfWindow* window, sfEvent* event);
199
217 CSFML_WINDOW_API sfBool sfWindow_waitEvent(sfWindow* window, sfEvent* event);
218
227 CSFML_WINDOW_API sfVector2i sfWindow_getPosition(const sfWindow* window);
228
240 CSFML_WINDOW_API void sfWindow_setPosition(sfWindow* window, sfVector2i position);
241
253 CSFML_WINDOW_API sfVector2u sfWindow_getSize(const sfWindow* window);
254
262 CSFML_WINDOW_API void sfWindow_setSize(sfWindow* window, sfVector2u size);
263
271 CSFML_WINDOW_API void sfWindow_setTitle(sfWindow* window, const char* title);
272
280 CSFML_WINDOW_API void sfWindow_setUnicodeTitle(sfWindow* window, const sfUint32* title);
281
294 CSFML_WINDOW_API void sfWindow_setIcon(sfWindow* window, unsigned int width, unsigned int height, const sfUint8* pixels);
295
303 CSFML_WINDOW_API void sfWindow_setVisible(sfWindow* window, sfBool visible);
304
312 CSFML_WINDOW_API void sfWindow_setMouseCursorVisible(sfWindow* window, sfBool visible);
313
326 CSFML_WINDOW_API void sfWindow_setVerticalSyncEnabled(sfWindow* window, sfBool enabled);
327
341 CSFML_WINDOW_API void sfWindow_setKeyRepeatEnabled(sfWindow* window, sfBool enabled);
342
359 CSFML_WINDOW_API sfBool sfWindow_setActive(sfWindow* window, sfBool active);
360
372 CSFML_WINDOW_API void sfWindow_display(sfWindow* window);
373
385 CSFML_WINDOW_API void sfWindow_setFramerateLimit(sfWindow* window, unsigned int limit);
386
397 CSFML_WINDOW_API void sfWindow_setJoystickThreshold(sfWindow* window, float threshold);
398
413 CSFML_WINDOW_API sfWindowHandle sfWindow_getSystemHandle(const sfWindow* window);
414
415
416 #endif // SFML_WINDOW_H