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#pragma once
26
28// Headers
30#include <CSFML/Window/Export.h>
31
32#include <CSFML/System/Time.h>
34#include <CSFML/Window/Event.h>
35#include <CSFML/Window/Types.h>
37#include <CSFML/Window/Vulkan.h>
39
40
45typedef enum
46{
47 sfNone = 0,
48 sfTitlebar = 1 << 0,
49 sfResize = 1 << 1,
50 sfClose = 1 << 2,
51
54
55
65
66
84CSFML_WINDOW_API sfWindowBase* sfWindowBase_create(sfVideoMode mode, const char* title, uint32_t style, sfWindowState state);
85
104
114
122
136
150
167
193
203
216
229
238
246CSFML_WINDOW_API void sfWindowBase_setTitle(sfWindowBase* windowBase, const char* title);
247
256
268CSFML_WINDOW_API void sfWindowBase_setIcon(sfWindowBase* windowBase, sfVector2u size, const uint8_t* pixels);
269
278
287
303
323
338
350
363
375
391
404 const VkInstance* instance,
405 VkSurfaceKHR* surface,
406 const VkAllocationCallbacks* allocator);
uint32_t sfChar32
Define sfChar32.
Definition Config.h:161
uint64_t VkSurfaceKHR
Definition Vulkan.h:42
struct VkInstance_T * VkInstance
Definition Vulkan.h:33
struct VkAllocationCallbacks VkAllocationCallbacks
Definition Vulkan.h:46
sfVector2i sfWindowBase_getPosition(const sfWindowBase *windowBase)
Get the position of a window.
void sfWindowBase_setUnicodeTitle(sfWindowBase *windowBase, const sfChar32 *title)
Change the title of a window (with a UTF-32 string)
bool sfWindowBase_hasFocus(const sfWindowBase *windowBase)
Check whether the window has the input focus.
bool sfWindowBase_createVulkanSurface(sfWindowBase *windowBase, const VkInstance *instance, VkSurfaceKHR *surface, const VkAllocationCallbacks *allocator)
Create a Vulkan rendering surface.
void sfWindowBase_setSize(sfWindowBase *windowBase, sfVector2u size)
Change the size of the rendering region of a window.
void sfWindowBase_close(sfWindowBase *windowBase)
Close a window and destroy all the attached resources.
void sfWindowBase_setVisible(sfWindowBase *windowBase, bool visible)
Show or hide a window.
sfWindowBase * sfWindowBase_create(sfVideoMode mode, const char *title, uint32_t style, sfWindowState state)
Construct a new window.
sfVector2u sfWindowBase_getSize(const sfWindowBase *windowBase)
Get the size of the rendering region of a window.
void sfWindowBase_destroy(const sfWindowBase *windowBase)
Destroy a window.
bool sfWindowBase_pollEvent(sfWindowBase *windowBase, sfEvent *event)
Pop the event on top of event queue, if any, and return it.
sfWindowBase * sfWindowBase_createUnicode(sfVideoMode mode, const sfChar32 *title, uint32_t style, sfWindowState state)
Construct a new window (with a UTF-32 title)
bool sfWindowBase_waitEvent(sfWindowBase *windowBase, sfTime timeout, sfEvent *event)
Wait for an event and return it.
sfWindowStyle
Enumeration of window creation styles.
Definition WindowBase.h:46
@ sfResize
Titlebar + resizable border + maximize button.
Definition WindowBase.h:49
@ sfDefaultStyle
Default window style.
Definition WindowBase.h:52
@ sfNone
No border / title bar (this flag and all others are mutually exclusive)
Definition WindowBase.h:47
@ sfTitlebar
Title bar + fixed border.
Definition WindowBase.h:48
@ sfClose
Titlebar + close button.
Definition WindowBase.h:50
void sfWindowBase_setKeyRepeatEnabled(sfWindowBase *windowBase, bool enabled)
Enable or disable automatic key-repeat.
void sfWindowBase_setIcon(sfWindowBase *windowBase, sfVector2u size, const uint8_t *pixels)
Change a window's icon.
sfWindowBase * sfWindowBase_createFromHandle(sfWindowHandle handle)
Construct a window from an existing control.
sfWindowHandle sfWindowBase_getNativeHandle(const sfWindowBase *windowBase)
Get the OS-specific handle of the window.
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.
sfWindowState
Enumeration of the window states.
Definition WindowBase.h:61
@ sfFullscreen
Fullscreen window.
Definition WindowBase.h:63
@ sfWindowed
Floating window.
Definition WindowBase.h:62
void sfWindowBase_setMouseCursor(sfWindowBase *windowBase, const sfCursor *cursor)
Set the displayed cursor to a native system cursor.
void sfWindowBase_setMouseCursorVisible(sfWindowBase *windowBase, bool visible)
Show or hide the mouse cursor.
void sfWindowBase_setMouseCursorGrabbed(sfWindowBase *windowBase, bool grabbed)
Grab or release the mouse cursor.
bool sfWindowBase_isOpen(const sfWindowBase *windowBase)
Tell whether or not a window is opened.
#define CSFML_WINDOW_API
struct sfCursor sfCursor
struct sfWindowBase sfWindowBase
Represents a time value.
Definition Time.h:38
2-component vector of integers
Definition Vector2.h:38
2-component vector of unsigned integers
Definition Vector2.h:49
sfVideoMode defines a video mode (width, height, bpp, frequency) and provides functions for getting m...
Definition VideoMode.h:44
sfEvent defines a system event and its parameters
Definition Event.h:210