Loading...
Searching...
No Matches
WindowBase.h
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2024 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>
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,
53
54
72
90
100
108
122
136
153
172
182
195
208
217
225CSFML_WINDOW_API void sfWindowBase_setTitle(sfWindowBase* windowBase, const char* title);
226
235
248CSFML_WINDOW_API void sfWindowBase_setIcon(sfWindowBase* windowBase, unsigned int width, unsigned int height, const sfUint8* pixels);
249
258
267
282
302
317
329
342
354
370
383
384#endif // SFML_WINDOWBASE_H
unsigned int sfUint32
Definition Config.h:176
int sfBool
Definition Config.h:153
unsigned char sfUint8
Definition Config.h:168
struct VkInstance_T * VkInstance
Definition Vulkan.h:32
struct VkAllocationCallbacks VkAllocationCallbacks
Definition Vulkan.h:44
sfUint64 VkSurfaceKHR
Definition Vulkan.h:40
sfVector2i sfWindowBase_getPosition(const sfWindowBase *windowBase)
Get the position of a window.
sfBool sfWindowBase_createVulkanSurface(sfWindowBase *windowBase, const VkInstance *instance, VkSurfaceKHR *surface, const VkAllocationCallbacks *allocator)
Create a Vulkan rendering surface.
void sfWindowBase_setKeyRepeatEnabled(sfWindowBase *windowBase, sfBool enabled)
Enable or disable automatic key-repeat.
void sfWindowBase_setSize(sfWindowBase *windowBase, sfVector2u size)
Change the size of the rendering region of a window.
sfBool sfWindowBase_isOpen(const sfWindowBase *windowBase)
Tell whether or not a window is opened.
void sfWindowBase_close(sfWindowBase *windowBase)
Close a window and destroy all the attached resources.
void sfWindowBase_destroy(sfWindowBase *windowBase)
Destroy a window.
sfVector2u sfWindowBase_getSize(const sfWindowBase *windowBase)
Get the size of the rendering region of a window.
void sfWindowBase_setIcon(sfWindowBase *windowBase, unsigned int width, unsigned int height, const sfUint8 *pixels)
Change a window's icon.
sfWindowStyle
Enumeration of window creation styles.
Definition WindowBase.h:45
@ sfResize
Titlebar + resizable border + maximize button.
Definition WindowBase.h:48
@ sfDefaultStyle
Default window style.
Definition WindowBase.h:51
@ sfFullscreen
Fullscreen mode (this flag and all others are mutually exclusive)
Definition WindowBase.h:50
@ sfNone
No border / title bar (this flag and all others are mutually exclusive)
Definition WindowBase.h:46
@ sfTitlebar
Title bar + fixed border.
Definition WindowBase.h:47
@ sfClose
Titlebar + close button.
Definition WindowBase.h:49
void sfWindowBase_setMouseCursorGrabbed(sfWindowBase *windowBase, sfBool grabbed)
Grab or release the mouse cursor.
sfBool sfWindowBase_hasFocus(const sfWindowBase *windowBase)
Check whether the window has the input focus.
sfWindowHandle sfWindowBase_getSystemHandle(const sfWindowBase *windowBase)
Get the OS-specific handle of the window.
sfWindowBase * sfWindowBase_createFromHandle(sfWindowHandle handle)
Construct a window from an existing control.
void sfWindowBase_setPosition(sfWindowBase *windowBase, sfVector2i position)
Change the position of a window on screen.
void sfWindowBase_setTitle(sfWindowBase *windowBase, const char *title)
Change the title of a window.
void sfWindowBase_requestFocus(sfWindowBase *windowBase)
Request the current window to be made the active foreground window.
void sfWindowBase_setJoystickThreshold(sfWindowBase *windowBase, float threshold)
Change the joystick threshold.
sfBool sfWindowBase_waitEvent(sfWindowBase *windowBase, sfEvent *event)
Wait for an event and return it.
void sfWindowBase_setMouseCursor(sfWindowBase *windowBase, const sfCursor *cursor)
Set the displayed cursor to a native system cursor.
void sfWindowBase_setVisible(sfWindowBase *windowBase, sfBool visible)
Show or hide a window.
sfBool sfWindowBase_pollEvent(sfWindowBase *windowBase, sfEvent *event)
Pop the event on top of event queue, if any, and return it.
void sfWindowBase_setMouseCursorVisible(sfWindowBase *windowBase, sfBool visible)
Show or hide the mouse cursor.
sfWindowBase * sfWindowBase_createUnicode(sfVideoMode mode, const sfUint32 *title, sfUint32 style)
Construct a new window (with a UTF-32 title)
sfWindowBase * sfWindowBase_create(sfVideoMode mode, const char *title, sfUint32 style)
Construct a new window.
void sfWindowBase_setUnicodeTitle(sfWindowBase *windowBase, const sfUint32 *title)
Change the title of a window (with a UTF-32 string)
#define CSFML_WINDOW_API
struct sfCursor sfCursor
struct sfWindowBase sfWindowBase
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