tinypbrt 1.1.1
pbrt-v4 scene file parser for C11 with a header-only C++20 wrapper
Loading...
Searching...
No Matches

Data Structures

struct  tpbrt::scene_view
 C++ wrapper for tpbrt_scene_t (a non owning view, e.g. More...
 
class  tpbrt::scene
 Scene loaded from a pbrt-v4 file or string, owning all its memory (move only, freed in the destructor). More...
 

Functions

result< scene > tpbrt::load_scene_from_file (const std::string &filepath)
 Loads scene from given file.
 
result< scene > tpbrt::load_scene_from_memory (const std::string &data, const std::string &working_directory=".")
 Loads scene from memory (provided string).
 
result< scene > tpbrt::load_scene_from_memory (const char_t *const data, const std::string &working_directory=".")
 Loads scene from memory (provided null-terminated string).
 

Detailed Description

Function Documentation

◆ load_scene_from_file()

result< scene > tpbrt::load_scene_from_file ( const std::string &  filepath)
inline

Loads scene from given file.

Parameters
filepathPath to scene file.
Returns
Result with error code or with scene.
Examples
examples/cpp/materials/main.cpp, examples/cpp/quickstart/main.cpp, and examples/cpp/scene_info/main.cpp.

◆ load_scene_from_memory() [1/2]

result< scene > tpbrt::load_scene_from_memory ( const std::string &  data,
const std::string &  working_directory = "." 
)
inline

Loads scene from memory (provided string).

Parameters
dataScene text.
working_directoryDirectory used to resolve Include / Import and other relative paths.
Returns
Result with error code or with scene.

◆ load_scene_from_memory() [2/2]

result< scene > tpbrt::load_scene_from_memory ( const char_t *const  data,
const std::string &  working_directory = "." 
)
inline

Loads scene from memory (provided null-terminated string).

Parameters
dataScene text (must end with '\0').
working_directoryDirectory used to resolve Include / Import and other relative paths.
Returns
Result with error code or with scene.