Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches
ToyMaker::ViewportNodeFromDescription Class Reference

Constructs a ViewportNode from its description in JSON. More...

#include <scene_loading.hpp>

Inheritance diagram for ToyMaker::ViewportNodeFromDescription:
ToyMaker::ResourceConstructor< ViewportNode, ViewportNodeFromDescription > ToyMaker::IResourceConstructor

Static Public Member Functions

static std::string getResourceConstructorName ()
 

Private Member Functions

std::shared_ptr< IResourcecreateResource (const nlohmann::json &methodParameters)
 Creates a resource object using the parameters specified in methodParameters.
 

Additional Inherited Members

- Public Member Functions inherited from ToyMaker::ResourceConstructor< ViewportNode, ViewportNodeFromDescription >
std::string getResourceConstructorName_ () const override
 Gets the resource constructor type string of the constructor.
 
- Public Member Functions inherited from ToyMaker::IResourceConstructor
virtual ~IResourceConstructor ()=default
 Destroys this resource constructor (when the application is terminated.)
 
- Protected Member Functions inherited from ToyMaker::ResourceConstructor< ViewportNode, ViewportNodeFromDescription >
 ResourceConstructor (int explicitlyInitializeMe)
 Construct a new ResourceConstructor object.
 
- Protected Member Functions inherited from ToyMaker::IResourceConstructor
 IResourceConstructor ()=default
 Construct a new IResourceConstructor object.
 
- Static Protected Member Functions inherited from ToyMaker::IResourceConstructor
template<typename TResource, typename TResourceConstructor>
static void RegisterResourceConstructor ()
 Registers this resource constructor against its respective ResourceFactory during static initialization.
 

Detailed Description

Constructs a ViewportNode from its description in JSON.

Its description might look as follows:

{
"name": "viewport_3D",
"parent": "/",
"type": "ViewportNode",
"components": [
{
"type": "Placement",
"orientation": [
1.0, 0.0, 0.0, 0.0
],
"position": [
0.0, 0.0, 0.0, 1.0
],
"scale": [
1.0, 1.0, 1.0
]
}
],
"inherits_world": false,
"prevent_handled_action_propagation": false,
"skybox_texture": "Skybox_Texture",
"render_configuration": {
"base_dimensions": [1366, 768],
"update_mode": "on-render-cap-fps",
"resize_type": "texture-dimensions",
"resize_mode": "fixed-dimensions",
"render_type": "basic-3d",
"fps_cap": 60,
"render_scale": 1.0
}
},

Member Function Documentation

◆ createResource()

std::shared_ptr< IResource > ViewportNodeFromDescription::createResource ( const nlohmann::json & methodParameters)
privatevirtual

Creates a resource object using the parameters specified in methodParameters.

Parameters
methodParametersThe parameters used to construct an object via this constructor.
Returns
std::shared_ptr<IResource> A reference to the created resource.

Implements ToyMaker::IResourceConstructor.


The documentation for this class was generated from the following files: