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

Handling environment descriptor functionalities in the shengine framework. More...

#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdint.h>
#include <smd/smd.h>
#include <shvulkan/shVulkan.h>
#include <shcomponents/shIdentity.h>
#include <shcomponents/shCamera.h>
#include <shcomponents/shTransform.h>

Go to the source code of this file.

Data Structures

struct  ShIniProperties
 Structure representing properties related to the initialization (INI) file. More...
 
struct  ShApplicationProperties
 Structure representing properties related to the application. More...
 
struct  ShHostMemoryProperties
 Structure representing properties related to host memory. More...
 
struct  ShVulkanMemoryProperties
 Structure representing properties related to Vulkan memory. More...
 
struct  ShSerialProperties
 Structure representing properties related to serial communication. More...
 
struct  ShSceneProperties
 Structure representing properties related to the scene. More...
 

Macros

#define SH_ENVIRONMENT_STR512_LENGTH   64
 
#define SH_ENVIRONMENT_STR1024_LENGTH   128
 
#define SH_ENVIRONMENT_MAX_HOST_BUFFER_COUNT   2048
 
#define SH_ENVIRONMENT_MAX_VULKAN_BUFFER_COUNT   512
 
#define shGetFileStats(path, stats)    stat(path, stats)
 Macro to get file statistics.
 
#define shInitDescriptor(p_descriptor_handle)    shGetFileStats((p_descriptor_handle)->path, &(p_descriptor_handle)->stats0)
 Macro to initialize a descriptor handle.
 
#define shEnvironmentError(condition, msg, failure_expression)    if ((int)(condition)) { printf("shenvironment error: %s.\n", msg); failure_expression; }
 Macro for handling environment errors.
 

Typedefs

typedef struct ShIniProperties ShIniProperties
 
typedef struct ShApplicationProperties ShApplicationProperties
 
typedef struct ShHostMemoryProperties ShHostMemoryProperties
 
typedef struct ShVulkanMemoryProperties ShVulkanMemoryProperties
 
typedef struct ShSerialProperties ShSerialProperties
 
typedef struct ShSceneProperties ShSceneProperties
 

Functions

uint8_t shGetIniProperties (const char *ini_file_path, SmdFileHandle *p_ini_smd, ShIniProperties *p_ini_properties)
 Function to get INI properties from a file.
 
uint8_t shGetApplicationProperties (const char *application_file_path, SmdFileHandle *p_application_smd, ShApplicationProperties *p_application_properties)
 Function to get application properties from a file.
 
uint8_t shGetHostMemoryProperties (const char *card_inputs_file_path, SmdFileHandle *p_card_inputs_smd, ShHostMemoryProperties *p_card_inputs_properties)
 Function to get host memory properties from a file.
 
uint8_t shGetVulkanMemoryProperties (const char *vulkan_memory_file_path, SmdFileHandle *p_vulkan_memory_smd, ShVulkanMemoryProperties *p_vulkan_memory_properties)
 Function to get Vulkan memory properties from a file.
 
uint8_t shGetSerialProperties (const char *serial_file_path, SmdFileHandle *p_serial_smd, ShSerialProperties *p_serial_properties)
 Retrieves serial properties from a specified file.
 
uint8_t shGetSceneProperties (const char *scene_file_path, SmdFileHandle *p_scene_smd, ShSceneProperties *p_scene_properties)
 Retrieves scene properties from a specified file.
 

Detailed Description

Handling environment descriptor functionalities in the shengine framework.

The shEnvironment.h file contains structures and functions related to handling environment descriptors in the shengine framework.

Macro Definition Documentation

◆ SH_ENVIRONMENT_MAX_HOST_BUFFER_COUNT

#define SH_ENVIRONMENT_MAX_HOST_BUFFER_COUNT   2048

◆ SH_ENVIRONMENT_MAX_VULKAN_BUFFER_COUNT

#define SH_ENVIRONMENT_MAX_VULKAN_BUFFER_COUNT   512

◆ SH_ENVIRONMENT_STR1024_LENGTH

#define SH_ENVIRONMENT_STR1024_LENGTH   128

◆ SH_ENVIRONMENT_STR512_LENGTH

#define SH_ENVIRONMENT_STR512_LENGTH   64

◆ shEnvironmentError

#define shEnvironmentError (   condition,
  msg,
  failure_expression 
)     if ((int)(condition)) { printf("shenvironment error: %s.\n", msg); failure_expression; }

Macro for handling environment errors.

Parameters
conditionCondition to check.
msgError message.
failure_expressionExpression to execute in case of failure.

◆ shGetFileStats

#define shGetFileStats (   path,
  stats 
)     stat(path, stats)

Macro to get file statistics.

Parameters
pathFile path.
statsPointer to a structure to store file statistics.

◆ shInitDescriptor

#define shInitDescriptor (   p_descriptor_handle)     shGetFileStats((p_descriptor_handle)->path, &(p_descriptor_handle)->stats0)

Macro to initialize a descriptor handle.

Parameters
p_descriptor_handleValid pointer to a descriptor handle.

Typedef Documentation

◆ ShApplicationProperties

◆ ShHostMemoryProperties

◆ ShIniProperties

◆ ShSceneProperties

◆ ShSerialProperties

◆ ShVulkanMemoryProperties

Function Documentation

◆ shGetApplicationProperties()

uint8_t shGetApplicationProperties ( const char *  application_file_path,
SmdFileHandle *  p_application_smd,
ShApplicationProperties p_application_properties 
)
extern

Function to get application properties from a file.

This function retrieves application properties from the specified application file and initializes the corresponding structures.

Parameters
application_file_pathPath to the application file.
p_application_smdValid pointer to an SmdFileHandle structure for application properties.
p_application_propertiesPointer to the ShApplicationProperties structure to store the retrieved application properties.
Returns
1 on success, 0 on failure.

◆ shGetHostMemoryProperties()

uint8_t shGetHostMemoryProperties ( const char *  card_inputs_file_path,
SmdFileHandle *  p_card_inputs_smd,
ShHostMemoryProperties p_card_inputs_properties 
)
extern

Function to get host memory properties from a file.

This function retrieves host memory properties from the specified card inputs file and initializes the corresponding structures.

Parameters
card_inputs_file_pathPath to the card inputs file.
p_card_inputs_smdPointer to an SmdFileHandle structure for host memory properties.
p_card_inputs_propertiesPointer to the ShHostMemoryProperties structure to store the retrieved host memory properties.
Returns
1 on success, 0 on failure.

◆ shGetIniProperties()

uint8_t shGetIniProperties ( const char *  ini_file_path,
SmdFileHandle *  p_ini_smd,
ShIniProperties p_ini_properties 
)
extern

Function to get INI properties from a file.

This function retrieves INI properties from the specified INI file and initializes the corresponding structures.

Parameters
ini_file_pathPath to the INI file.
p_ini_smdPointer to an SmdFileHandle structure for INI properties.
p_ini_propertiesPointer to the ShIniProperties structure to store the retrieved INI properties.
Returns
1 on success, 0 on failure.

◆ shGetSceneProperties()

uint8_t shGetSceneProperties ( const char *  scene_file_path,
SmdFileHandle *  p_scene_smd,
ShSceneProperties p_scene_properties 
)
extern

Retrieves scene properties from a specified file.

Parameters
scene_file_pathPath to the scene file.
p_scene_smdValid pointer to an SmdFileHandle structure for the scene.
p_scene_propertiesValid pointer to an ShSceneProperties structure.
Returns
1 on success, 0 on failure.

◆ shGetSerialProperties()

uint8_t shGetSerialProperties ( const char *  serial_file_path,
SmdFileHandle *  p_serial_smd,
ShSerialProperties p_serial_properties 
)
extern

Retrieves serial properties from a specified file.

Parameters
serial_file_pathPath to the serial file.
p_serial_smdValid pointer to an SmdFileHandle structure for serial.
p_serial_propertiesValid pointer to an ShSerialProperties structure.
Returns
1 on success, 0 on failure.

◆ shGetVulkanMemoryProperties()

uint8_t shGetVulkanMemoryProperties ( const char *  vulkan_memory_file_path,
SmdFileHandle *  p_vulkan_memory_smd,
ShVulkanMemoryProperties p_vulkan_memory_properties 
)
extern

Function to get Vulkan memory properties from a file.

This function retrieves Vulkan memory properties from the specified Vulkan memory file and initializes the corresponding structures.

Parameters
vulkan_memory_file_pathPath to the Vulkan memory file.
p_vulkan_memory_smdPointer to an SmdFileHandle structure for Vulkan memory properties.
p_vulkan_memory_propertiesPointer to the ShVulkanMemoryProperties structure to store the retrieved Vulkan memory properties.
Returns
1 on success, 0 on failure.