Ember
A C++ 20 'game engine' built with SDL3 with wide platform support.
Functions
file_system.cpp File Reference
#include "core/io/file_system.h"

Functions

std::string LoadAssetsFile (const std::string &file_path)
 Loads a given file from assets folder. More...
 
std::vector< char > LoadFileIntoMemory (const std::string &file_path)
 Loads a given file from assets folder into memory. More...
 
static ma_result sdl_vfs_onOpen (ma_vfs *pVFS, const char *pPath, ma_uint32 openMode, ma_vfs_file *pFile)
 
static ma_result sdl_vfs_onRead (ma_vfs *pVFS, ma_vfs_file file, void *pBuffer, size_t size, size_t *pBytesRead)
 
static ma_result sdl_vfs_onSeek (ma_vfs *pVFS, ma_vfs_file file, ma_int64 offset, ma_seek_origin origin)
 
static ma_result sdl_vfs_onTell (ma_vfs *pVFS, ma_vfs_file file, ma_int64 *pCursor)
 
static ma_result sdl_vfs_onClose (ma_vfs *pVFS, ma_vfs_file file)
 
ma_result Ember_Init_VFS (Ember_VFS *vfs)
 

Function Documentation

◆ Ember_Init_VFS()

ma_result Ember_Init_VFS ( Ember_VFS vfs)

◆ LoadAssetsFile()

std::string LoadAssetsFile ( const std::string &  file_path)

Loads a given file from assets folder.

  • The file path is relative to assets folder
Version
0.0.1
Parameters
file_paththe path to the file in assets folder
Returns
File content as string

◆ LoadFileIntoMemory()

std::vector<char> LoadFileIntoMemory ( const std::string &  file_path)

Loads a given file from assets folder into memory.

  • The file path is relative to assets folder
Version
0.0.2
Parameters
file_paththe path to the file in assets folder
Returns
File content as vector<char>

◆ sdl_vfs_onClose()

static ma_result sdl_vfs_onClose ( ma_vfs *  pVFS,
ma_vfs_file  file 
)
static

◆ sdl_vfs_onOpen()

static ma_result sdl_vfs_onOpen ( ma_vfs *  pVFS,
const char *  pPath,
ma_uint32  openMode,
ma_vfs_file *  pFile 
)
static

◆ sdl_vfs_onRead()

static ma_result sdl_vfs_onRead ( ma_vfs *  pVFS,
ma_vfs_file  file,
void *  pBuffer,
size_t  size,
size_t *  pBytesRead 
)
static

◆ sdl_vfs_onSeek()

static ma_result sdl_vfs_onSeek ( ma_vfs *  pVFS,
ma_vfs_file  file,
ma_int64  offset,
ma_seek_origin  origin 
)
static

◆ sdl_vfs_onTell()

static ma_result sdl_vfs_onTell ( ma_vfs *  pVFS,
ma_vfs_file  file,
ma_int64 *  pCursor 
)
static