shengine pre-release
shengine by mrsinho
Loading...
Searching...
No Matches
shWindow.h File Reference

Handling window-related functionalities in the shengine framework. More...

#include <GLFW/glfw3.h>
#include <stdint.h>
#include "shengine/shInput.h"

Go to the source code of this file.

Data Structures

struct  ShInput
 Structure representing input in the shengine framework. More...
 
struct  ShWindow
 Structure representing a window in the shengine framework. More...
 

Macros

#define GLFW_INCLUDE_NONE
 
#define GLFW_INCLUDE_VULKAN
 
#define shSetCursor(glfw_window, glfw_cursor)    glfwSetCursor(glfw_window, glfw_cursor)
 Macro to set the cursor of a GLFW window.
 
#define shPollEvents   glfwPollEvents
 Macro to poll events in the GLFW window.
 
#define shWaitEvents   glfwWaitEvents
 Macro to wait for events in the GLFW window.
 
#define shIsWindowActive(_window)    (!glfwWindowShouldClose((_window).window))
 Macro to check if a window is active.
 

Typedefs

typedef struct ShInput ShInput
 
typedef struct ShWindow ShWindow
 
typedef struct ShEngine ShEngine
 

Functions

uint8_t shWindowSetup (const char *title, ShWindow *p_window)
 Sets up a window in the shengine framework.
 
uint8_t shClearWindow (ShWindow *p_window)
 Clears the contents of a window in the shengine framework.
 
uint8_t shWindowCreateSurface (ShEngine *p_engine)
 Creates a surface for the shengine module using the window.
 
uint8_t shUpdateInput (ShWindow *p_window)
 Updates input for the specified window.
 
uint8_t shGetWindowSize (ShWindow *p_window)
 Retrieves the size of the specified window.
 
uint8_t shUpdateWindow (ShEngine *p_engine)
 Updates the specified window within the shengine module.
 

Detailed Description

Handling window-related functionalities in the shengine framework.

The shWindow.h file contains structures and functions related to handling windows in the shengine framework.

Macro Definition Documentation

◆ GLFW_INCLUDE_NONE

#define GLFW_INCLUDE_NONE

◆ GLFW_INCLUDE_VULKAN

#define GLFW_INCLUDE_VULKAN

◆ shIsWindowActive

#define shIsWindowActive (   _window)     (!glfwWindowShouldClose((_window).window))

Macro to check if a window is active.

The shIsWindowActive macro checks if a GLFW window is active.

Parameters
_windowShWindow structure to check for activity.
Returns
True if the window is active, false otherwise.

◆ shPollEvents

#define shPollEvents   glfwPollEvents

Macro to poll events in the GLFW window.

The shPollEvents macro polls events in the GLFW window.

◆ shSetCursor

#define shSetCursor (   glfw_window,
  glfw_cursor 
)     glfwSetCursor(glfw_window, glfw_cursor)

Macro to set the cursor of a GLFW window.

The shSetCursor macro sets the cursor of a GLFW window to a specified cursor.

Example:

shSetCursor(glfw_window, glfw_cursor)
#define shSetCursor(glfw_window, glfw_cursor)
Macro to set the cursor of a GLFW window.
Definition shWindow.h:99
Parameters
glfw_windowGLFW window.
glfw_cursorGLFW cursor.

◆ shWaitEvents

#define shWaitEvents   glfwWaitEvents

Macro to wait for events in the GLFW window.

The shWaitEvents macro waits for events in the GLFW window.

Typedef Documentation

◆ ShEngine

typedef struct ShEngine ShEngine

◆ ShInput

typedef struct ShInput ShInput

◆ ShWindow

typedef struct ShWindow ShWindow

Function Documentation

◆ shClearWindow()

uint8_t shClearWindow ( ShWindow p_window)
extern

Clears the contents of a window in the shengine framework.

Parameters
p_windowValid pointer to a ShWindow structure.
Returns
1 on success, 0 on failure.

◆ shGetWindowSize()

uint8_t shGetWindowSize ( ShWindow p_window)
extern

Retrieves the size of the specified window.

The shGetWindowSize function retrieves the size of the specified ShWindow.

Parameters
p_windowPointer to the ShWindow structure to get the size.
Returns
An integer indicating the success (1) or failure (0) of retrieving the window size.

◆ shUpdateInput()

uint8_t shUpdateInput ( ShWindow p_window)
extern

Updates input for the specified window.

The shUpdateInput function updates input for the specified ShWindow.

Parameters
p_windowPointer to the ShWindow structure to update input.
Returns
An integer indicating the success (1) or failure (0) of updating input.

◆ shUpdateWindow()

uint8_t shUpdateWindow ( ShEngine p_engine)
extern

Updates the specified window within the shengine module.

The shUpdateWindow function updates the specified ShWindow within shengine module.

Parameters
p_enginePointer to a valid ShEngine structure.
Returns
An integer indicating the success (1) or failure (0) of updating the window.

◆ shWindowCreateSurface()

uint8_t shWindowCreateSurface ( ShEngine p_engine)
extern

Creates a surface for the shengine module using the window.

The shWindowCreateSurface function creates a surface for the shengine module using the window.

Parameters
p_enginePointer to a valid ShEngine structure.
Returns
An integer indicating the success (1) or failure (0) of creating the window surface.

◆ shWindowSetup()

uint8_t shWindowSetup ( const char *  title,
ShWindow p_window 
)
extern

Sets up a window in the shengine framework.

Parameters
titleTitle of the window.
p_windowValid pointer to a ShWindow structure.
Returns
1 on success, 0 on failure.