GLIP-Lib
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
Glip::Modules::LayoutWriter Class Reference

Get equivalent pipeline code from a pipeline layout. More...

#include <LayoutLoader.hpp>

Public Member Functions

 LayoutWriter (void)
 LayoutWriter constructor.
 
std::string getCode (const AbstractPipelineLayout &pipelineLayout)
 Build the human-readable code for the given AbstractPipelineLayout object. More...
 
void writeToFile (const AbstractPipelineLayout &pipelineLayout, const std::string &filename)
 Build the human-readable code for the given AbstractPipelineLayout object and write it to a file. WARNING : it will discard all previous content. More...
 

Static Public Member Functions

static VanillaParserSpace::Element write (const HdlAbstractTextureFormat &format, const std::string &name)
 Generate the code element for a particular format. More...
 
static VanillaParserSpace::Element write (const ShaderSource &source, const std::string &name)
 Generate the code element for a particular source. More...
 
static VanillaParserSpace::Element write (const GeometryModel &mdl, const std::string &name)
 Generate the code element for a particular geometry. More...
 

Detailed Description

Get equivalent pipeline code from a pipeline layout.

The layout writer enables you to write a pipeline to a Pipeline Script file. Note that the uniforms values might be lost at loading. In order to avoid this problem, you have to use a UniformsLoader to store and then load the correct profile (all the uniforms values).

LayoutWriter writer;
std::string code = writer(mainPipeline);
// Or directly to the disk :
writer.writeToFile(mainPipeline, "./myPipeline.ppl");

Member Function Documentation

std::string LayoutWriter::getCode ( const AbstractPipelineLayout pipelineLayout)

Build the human-readable code for the given AbstractPipelineLayout object.

Parameters
pipelineLayoutThe pipeline layout to convert.
Returns
A standard string containing the full pipeline layout description.
VanillaParserSpace::Element LayoutWriter::write ( const HdlAbstractTextureFormat format,
const std::string &  name 
)
static

Generate the code element for a particular format.

Parameters
formatFormat object.
nameName of the object.
Returns
A coded element containing all format data.
VanillaParserSpace::Element LayoutWriter::write ( const ShaderSource source,
const std::string &  name 
)
static

Generate the code element for a particular source.

Parameters
sourceSource object.
nameName of the source.
Returns
A coded element containing all source data.
VanillaParserSpace::Element LayoutWriter::write ( const GeometryModel mdl,
const std::string &  name 
)
static

Generate the code element for a particular geometry.

Parameters
mdlGeometry model object.
nameName of teh geometry.
Returns
A coded element containing all geometry data.
void LayoutWriter::writeToFile ( const AbstractPipelineLayout pipelineLayout,
const std::string &  filename 
)

Build the human-readable code for the given AbstractPipelineLayout object and write it to a file. WARNING : it will discard all previous content.

Parameters
pipelineLayoutThe pipeline layout to convert.
filenameThe filename to write to (Warning : discard all previous content).

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