WindowBase.h
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
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_WINDOWBASE_H
26#define SFML_WINDOWBASE_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/Window/Vulkan.h>
37#include <SFML/System/Vector2.h>
38
39
44typedef enum
45{
46 sfNone = 0,
47 sfTitlebar = 1 << 0,
48 sfResize = 1 << 1,
49 sfClose = 1 << 2,
50 sfFullscreen = 1 << 3,
51 sfDefaultStyle = sfTitlebar | sfResize | sfClose
52} sfWindowStyle;
53
54
71CSFML_WINDOW_API sfWindowBase* sfWindowBase_create(sfVideoMode mode, const char* title, sfUint32 style);
72
89CSFML_WINDOW_API sfWindowBase* sfWindowBase_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style);
90
99CSFML_WINDOW_API sfWindowBase* sfWindowBase_createFromHandle(sfWindowHandle handle);
100
107CSFML_WINDOW_API void sfWindowBase_destroy(sfWindowBase* windowBase);
108
121CSFML_WINDOW_API void sfWindowBase_close(sfWindowBase* windowBase);
122
135CSFML_WINDOW_API sfBool sfWindowBase_isOpen(const sfWindowBase* windowBase);
136
152CSFML_WINDOW_API sfBool sfWindowBase_pollEvent(sfWindowBase* windowBase, sfEvent* event);
153
171CSFML_WINDOW_API sfBool sfWindowBase_waitEvent(sfWindowBase* windowBase, sfEvent* event);
172
181CSFML_WINDOW_API sfVector2i sfWindowBase_getPosition(const sfWindowBase* windowBase);
182
194CSFML_WINDOW_API void sfWindowBase_setPosition(sfWindowBase* windowBase, sfVector2i position);
195
207CSFML_WINDOW_API sfVector2u sfWindowBase_getSize(const sfWindowBase* windowBase);
208
216CSFML_WINDOW_API void sfWindowBase_setSize(sfWindowBase* windowBase, sfVector2u size);
217
225CSFML_WINDOW_API void sfWindowBase_setTitle(sfWindowBase* windowBase, const char* title);
226
234CSFML_WINDOW_API void sfWindowBase_setUnicodeTitle(sfWindowBase* windowBase, const sfUint32* title);
235
248CSFML_WINDOW_API void sfWindowBase_setIcon(sfWindowBase* windowBase, unsigned int width, unsigned int height, const sfUint8* pixels);
249
257CSFML_WINDOW_API void sfWindowBase_setVisible(sfWindowBase* windowBase, sfBool visible);
258
266CSFML_WINDOW_API void sfWindowBase_setMouseCursorVisible(sfWindowBase* windowBase, sfBool visible);
267
281CSFML_WINDOW_API void sfWindowBase_setMouseCursorGrabbed(sfWindowBase* windowBase, sfBool grabbed);
282
301CSFML_WINDOW_API void sfWindowBase_setMouseCursor(sfWindowBase* windowBase, const sfCursor* cursor);
302
316CSFML_WINDOW_API void sfWindowBase_setKeyRepeatEnabled(sfWindowBase* windowBase, sfBool enabled);
317
328CSFML_WINDOW_API void sfWindowBase_setJoystickThreshold(sfWindowBase* windowBase, float threshold);
329
341CSFML_WINDOW_API void sfWindowBase_requestFocus(sfWindowBase* windowBase);
342
353CSFML_WINDOW_API sfBool sfWindowBase_hasFocus(const sfWindowBase* windowBase);
354
369CSFML_WINDOW_API sfWindowHandle sfWindowBase_getSystemHandle(const sfWindowBase* windowBase);
370
382CSFML_WINDOW_API sfBool sfWindowBase_createVulkanSurface(sfWindowBase* windowBase, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator);
383
384#endif // SFML_WINDOWBASE_H
2-component vector of integers
Definition Vector2.h:39
2-component vector of unsigned integers
Definition Vector2.h:50
sfVideoMode defines a video mode (width, height, bpp, frequency) and provides functions for getting m...
Definition VideoMode.h:42
sfEvent defines a system event and its parameters
Definition Event.h:222