CSFML 2.6.1

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

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>
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
44 typedef 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
71 CSFML_WINDOW_API sfWindowBase* sfWindowBase_create(sfVideoMode mode, const char* title, sfUint32 style);
72
89 CSFML_WINDOW_API sfWindowBase* sfWindowBase_createUnicode(sfVideoMode mode, const sfUint32* title, sfUint32 style);
90
99 CSFML_WINDOW_API sfWindowBase* sfWindowBase_createFromHandle(sfWindowHandle handle);
100
107 CSFML_WINDOW_API void sfWindowBase_destroy(sfWindowBase* windowBase);
108
121 CSFML_WINDOW_API void sfWindowBase_close(sfWindowBase* windowBase);
122
135 CSFML_WINDOW_API sfBool sfWindowBase_isOpen(const sfWindowBase* windowBase);
136
152 CSFML_WINDOW_API sfBool sfWindowBase_pollEvent(sfWindowBase* windowBase, sfEvent* event);
153
171 CSFML_WINDOW_API sfBool sfWindowBase_waitEvent(sfWindowBase* windowBase, sfEvent* event);
172
181 CSFML_WINDOW_API sfVector2i sfWindowBase_getPosition(const sfWindowBase* windowBase);
182
194 CSFML_WINDOW_API void sfWindowBase_setPosition(sfWindowBase* windowBase, sfVector2i position);
195
207 CSFML_WINDOW_API sfVector2u sfWindowBase_getSize(const sfWindowBase* windowBase);
208
216 CSFML_WINDOW_API void sfWindowBase_setSize(sfWindowBase* windowBase, sfVector2u size);
217
225 CSFML_WINDOW_API void sfWindowBase_setTitle(sfWindowBase* windowBase, const char* title);
226
234 CSFML_WINDOW_API void sfWindowBase_setUnicodeTitle(sfWindowBase* windowBase, const sfUint32* title);
235
248 CSFML_WINDOW_API void sfWindowBase_setIcon(sfWindowBase* windowBase, unsigned int width, unsigned int height, const sfUint8* pixels);
249
257 CSFML_WINDOW_API void sfWindowBase_setVisible(sfWindowBase* windowBase, sfBool visible);
258
266 CSFML_WINDOW_API void sfWindowBase_setMouseCursorVisible(sfWindowBase* windowBase, sfBool visible);
267
281 CSFML_WINDOW_API void sfWindowBase_setMouseCursorGrabbed(sfWindowBase* windowBase, sfBool grabbed);
282
301 CSFML_WINDOW_API void sfWindowBase_setMouseCursor(sfWindowBase* windowBase, const sfCursor* cursor);
302
316 CSFML_WINDOW_API void sfWindowBase_setKeyRepeatEnabled(sfWindowBase* windowBase, sfBool enabled);
317
328 CSFML_WINDOW_API void sfWindowBase_setJoystickThreshold(sfWindowBase* windowBase, float threshold);
329
341 CSFML_WINDOW_API void sfWindowBase_requestFocus(sfWindowBase* windowBase);
342
353 CSFML_WINDOW_API sfBool sfWindowBase_hasFocus(const sfWindowBase* windowBase);
354
369 CSFML_WINDOW_API sfWindowHandle sfWindowBase_getSystemHandle(const sfWindowBase* windowBase);
370
382 CSFML_WINDOW_API sfBool sfWindowBase_createVulkanSurface(sfWindowBase* windowBase, const VkInstance* instance, VkSurfaceKHR* surface, const VkAllocationCallbacks* allocator);
383
384#endif // SFML_WINDOWBASE_H
sfUint32
unsigned int sfUint32
Definition Config.h:176
sfBool
int sfBool
Definition Config.h:153
sfUint8
unsigned char sfUint8
Definition Config.h:168
Event.h
Vector2.h
VideoMode.h
Vulkan.h
VkInstance
struct VkInstance_T * VkInstance
Definition Vulkan.h:32
VkAllocationCallbacks
struct VkAllocationCallbacks VkAllocationCallbacks
Definition Vulkan.h:44
VkSurfaceKHR
sfUint64 VkSurfaceKHR
Definition Vulkan.h:40
sfWindowBase_getPosition
sfVector2i sfWindowBase_getPosition(const sfWindowBase *windowBase)
Get the position of a window.
sfWindowBase_createVulkanSurface
sfBool sfWindowBase_createVulkanSurface(sfWindowBase *windowBase, const VkInstance *instance, VkSurfaceKHR *surface, const VkAllocationCallbacks *allocator)
Create a Vulkan rendering surface.
sfWindowBase_setKeyRepeatEnabled
void sfWindowBase_setKeyRepeatEnabled(sfWindowBase *windowBase, sfBool enabled)
Enable or disable automatic key-repeat.
sfWindowBase_setSize
void sfWindowBase_setSize(sfWindowBase *windowBase, sfVector2u size)
Change the size of the rendering region of a window.
sfWindowBase_isOpen
sfBool sfWindowBase_isOpen(const sfWindowBase *windowBase)
Tell whether or not a window is opened.
sfWindowBase_close
void sfWindowBase_close(sfWindowBase *windowBase)
Close a window and destroy all the attached resources.
sfWindowBase_destroy
void sfWindowBase_destroy(sfWindowBase *windowBase)
Destroy a window.
sfWindowBase_getSize
sfVector2u sfWindowBase_getSize(const sfWindowBase *windowBase)
Get the size of the rendering region of a window.
sfWindowBase_setIcon
void sfWindowBase_setIcon(sfWindowBase *windowBase, unsigned int width, unsigned int height, const sfUint8 *pixels)
Change a window's icon.
sfWindowStyle
sfWindowStyle
Enumeration of window creation styles.
Definition WindowBase.h:45
sfResize
@ sfResize
Titlebar + resizable border + maximize button.
Definition WindowBase.h:48
sfDefaultStyle
@ sfDefaultStyle
Default window style.
Definition WindowBase.h:51
sfFullscreen
@ sfFullscreen
Fullscreen mode (this flag and all others are mutually exclusive)
Definition WindowBase.h:50
sfNone
@ sfNone
No border / title bar (this flag and all others are mutually exclusive)
Definition WindowBase.h:46
sfTitlebar
@ sfTitlebar
Title bar + fixed border.
Definition WindowBase.h:47
sfClose
@ sfClose
Titlebar + close button.
Definition WindowBase.h:49
sfWindowBase_setMouseCursorGrabbed
void sfWindowBase_setMouseCursorGrabbed(sfWindowBase *windowBase, sfBool grabbed)
Grab or release the mouse cursor.
sfWindowBase_hasFocus
sfBool sfWindowBase_hasFocus(const sfWindowBase *windowBase)
Check whether the window has the input focus.
sfWindowBase_getSystemHandle
sfWindowHandle sfWindowBase_getSystemHandle(const sfWindowBase *windowBase)
Get the OS-specific handle of the window.
sfWindowBase_createFromHandle
sfWindowBase * sfWindowBase_createFromHandle(sfWindowHandle handle)
Construct a window from an existing control.
sfWindowBase_setPosition
void sfWindowBase_setPosition(sfWindowBase *windowBase, sfVector2i position)
Change the position of a window on screen.
sfWindowBase_setTitle
void sfWindowBase_setTitle(sfWindowBase *windowBase, const char *title)
Change the title of a window.
sfWindowBase_requestFocus
void sfWindowBase_requestFocus(sfWindowBase *windowBase)
Request the current window to be made the active foreground window.
sfWindowBase_setJoystickThreshold
void sfWindowBase_setJoystickThreshold(sfWindowBase *windowBase, float threshold)
Change the joystick threshold.
sfWindowBase_waitEvent
sfBool sfWindowBase_waitEvent(sfWindowBase *windowBase, sfEvent *event)
Wait for an event and return it.
sfWindowBase_setMouseCursor
void sfWindowBase_setMouseCursor(sfWindowBase *windowBase, const sfCursor *cursor)
Set the displayed cursor to a native system cursor.
sfWindowBase_setVisible
void sfWindowBase_setVisible(sfWindowBase *windowBase, sfBool visible)
Show or hide a window.
sfWindowBase_pollEvent
sfBool sfWindowBase_pollEvent(sfWindowBase *windowBase, sfEvent *event)
Pop the event on top of event queue, if any, and return it.
sfWindowBase_setMouseCursorVisible
void sfWindowBase_setMouseCursorVisible(sfWindowBase *windowBase, sfBool visible)
Show or hide the mouse cursor.
sfWindowBase_createUnicode
sfWindowBase * sfWindowBase_createUnicode(sfVideoMode mode, const sfUint32 *title, sfUint32 style)
Construct a new window (with a UTF-32 title)
sfWindowBase_create
sfWindowBase * sfWindowBase_create(sfVideoMode mode, const char *title, sfUint32 style)
Construct a new window.
sfWindowBase_setUnicodeTitle
void sfWindowBase_setUnicodeTitle(sfWindowBase *windowBase, const sfUint32 *title)
Change the title of a window (with a UTF-32 string)
WindowHandle.h
Export.h
CSFML_WINDOW_API
#define CSFML_WINDOW_API
Definition Window/Export.h:43
Types.h
sfCursor
struct sfCursor sfCursor
Definition Window/Types.h:30
sfWindowBase
struct sfWindowBase sfWindowBase
Definition Window/Types.h:32
sfVector2i
2-component vector of integers
Definition Vector2.h:39
sfVector2u
2-component vector of unsigned integers
Definition Vector2.h:50
sfVideoMode
sfVideoMode defines a video mode (width, height, bpp, frequency) and provides functions for getting m...
Definition VideoMode.h:42
sfEvent
sfEvent defines a system event and its parameters
Definition Event.h:222