37 recursive_mutex _propLock;
39 string *_path =
nullptr;
40 string *_name =
nullptr;
41 string *_description =
nullptr;
42 string *_credit =
nullptr;
43 string *_vsn =
nullptr;
45 bool _throwExcept =
true;
47 vector<string> _categories;
48 vector<ISFAttrRef> _inputs;
49 vector<ISFAttrRef> _imageInputs;
50 vector<ISFAttrRef> _audioInputs;
51 vector<ISFAttrRef> _imageImports;
54 vector<ISFPassTargetRef> _persistentPassTargets;
55 vector<ISFPassTargetRef> _tempPassTargets;
56 vector<string> _renderPasses;
58 string *_jsonSourceString =
nullptr;
59 string *_jsonString =
nullptr;
60 string *_vertShaderSource =
nullptr;
61 string *_fragShaderSource =
nullptr;
79 ISFDoc(
const string & inPath,
ISFScene * inParentScene=
nullptr,
const bool & inThrowExcept=
true) noexcept(
false);
90 ISFDoc(
const string & inFSContents,
const string & inVSContents,
const string & importsDir,
ISFScene * inParentScene=
nullptr,
const bool & inThrowExcept=
true);
104 string path()
const {
return (_path==
nullptr) ? string(
"") : string(*_path); }
106 string name()
const {
return (_name==
nullptr) ? string(
"") : string(*_name); }
108 string description()
const {
return (_description==
nullptr) ? string(
"") : string(*_description); }
110 string credit()
const {
return (_credit==
nullptr) ? string(
"") : string(*_credit); }
112 string vsn()
const {
return (_vsn==
nullptr) ? string(
"") : string(*_vsn); }
127 vector<ISFAttrRef> &
inputs() {
return _inputs; }
135 vector<ISFAttrRef> inputsOfType(
const ISFValType & inInputType);
137 ISFAttrRef input(
const string & inAttrName);
154 const VVGL::GLBufferRef getBufferForKey(
const string & n);
156 const VVGL::GLBufferRef getPersistentBufferForKey(
const string & n);
158 const VVGL::GLBufferRef getTempBufferForKey(
const string & n);
160 const ISFPassTargetRef passTargetForKey(
const string & n);
162 const ISFPassTargetRef persistentPassTargetForKey(
const string & n);
164 const ISFPassTargetRef tempPassTargetForKey(
const string & n);
183 void jsonSourceString(
string & outStr);
187 void setParentScene(
ISFScene * n) { _parentScene=n; }
188 ISFScene * parentScene() {
return _parentScene; }
191 string generateTextureTypeString();
199 bool generateShaderSource(
string * outFragSrc,
string * outVertSrc,
VVGL::GLVersion & inGLVers,
const bool & inVarsAsUBO=
false);
201 void evalBufferDimensionsWithRenderSize(
const VVGL::Size & inSize);
203 VVISF_EXPORT
friend ostream & operator<<(ostream & os,
const ISFDoc & n);
207 void _initWithRawFragShaderString(
const string & inRawFile);
209 bool _assembleShaderSource_VarDeclarations(
string * outVSString,
string * outFSString,
VVGL::GLVersion & inGLVers,
const bool & inVarsAsUBO=
false);
211 bool _assembleSubstitutionMap(map<string,double*> * outMap);
225 inline ISFDocRef CreateISFDocRef(
const string & inPath,
ISFScene * inParentScene=
nullptr,
const bool & inThrowExcept=
true) noexcept(false) {
return make_shared<ISFDoc>(inPath,inParentScene,inThrowExcept); }
236 inline ISFDocRef CreateISFDocRefWith(
const string & inFSContents,
const string & inImportsDir=
string(
"/"),
const string & inVSContents=
string(ISFVertPassthru_GL2),
ISFScene * inParentScene=
nullptr,
const bool & inThrowExcept=
true) {
return make_shared<ISFDoc>(inFSContents,inVSContents,inImportsDir,inParentScene,inThrowExcept); }
Subclass of GLScene- the primary interface for rendering and interacting with an ISF file...
Definition: ISFScene.hpp:28
vector< ISFPassTargetRef > tempPassTargets() const
Returns a vector of ISFPassTargetRef instances describing every pass that doesn't have a persistent b...
Definition: ISFDoc.hpp:150
The file is a "source"- it generates images.
Definition: VVISF_Base.hpp:72
vector< string > & renderPasses()
Returns a vector of std::string instances describing the names of the render passes, in order. If the names were not specified properly in the JSON blob, this array will be incomplete or inaccurate and rendering won't work!
Definition: ISFDoc.hpp:152
string * jsonString() const
Returns the JSON string copied from the source- doesn't include any comments before/after it...
Definition: ISFDoc.hpp:177
string * vertShaderSource() const
Returns the raw vert shader source before being find-and-replaced.
Definition: ISFDoc.hpp:179
shared_ptr< ISFDoc > ISFDocRef
ISFDocRef is a shared pointer around an ISFDoc instance.
Definition: VVISF_Base.hpp:51
Definition: ISFAttr.hpp:12
Basic struct for 2D size.
Definition: VVGL_Geom.hpp:46
vector< ISFAttrRef > & imageImports()
Returns a vector of ISFAttrRef instances describing only the receiver's audioFFT inputs.
Definition: ISFDoc.hpp:133
string credit() const
Returns the receiver's "credit" string, as defined in its JSON blob ("CREDIT").
Definition: ISFDoc.hpp:110
ISFValType
Enumerates the different kinds of ISF values.
Definition: ISFVal.hpp:25
ISFFileType type() const
Returns the receiver's file type.
Definition: ISFDoc.hpp:114
string name() const
Returns the name of the receiver's ISF file (the file name, minus the extension). ...
Definition: ISFDoc.hpp:106
Describes an "ISF file"- requires an actual file on disk which is parsed. Capable of generating GLSL ...
Definition: ISFDoc.hpp:35
ISFDocRef CreateISFDocRef(const string &inPath, ISFScene *inParentScene=nullptr, const bool &inThrowExcept=true) noexcept(false)
Constructs an ISFDoc instance from a passed file on disk.
Definition: ISFDoc.hpp:225
vector< ISFAttrRef > & audioInputs()
Returns a vector of ISFAttrRef instances describing only the receiver's audio inputs.
Definition: ISFDoc.hpp:131
string * fragShaderSource() const
Returns the raw frag shader source before being find-and-replaced.
Definition: ISFDoc.hpp:181
ISFDocRef CreateISFDocRefWith(const string &inFSContents, const string &inImportsDir=string("/"), const string &inVSContents=string(ISFVertPassthru_GL2), ISFScene *inParentScene=nullptr, const bool &inThrowExcept=true)
Constructs an ISFDoc instance from shader strings.
Definition: ISFDoc.hpp:236
string vsn() const
Returns the receiver's "vsn" string, as defined in its JSON blob ("VSN")
Definition: ISFDoc.hpp:112
GLVersion
This enum is used to describe the GL environment of a GL context, which is determined at runtime...
Definition: VVGL_Base.hpp:94
string description() const
Returns the receiver's "description" string, as defined in its JSON blob ("DESCRIPTION").
Definition: ISFDoc.hpp:108
vector< ISFAttrRef > & inputs()
Returns a vector of ISFAttrRef instances describing all of the receiver's inputs. ...
Definition: ISFDoc.hpp:127
string path() const
Returns the path of the ISF file for the receiver. This is probably the path to the frag shader...
Definition: ISFDoc.hpp:104
string * jsonSourceString() const
Returns the JSON string from the source including the comments and any linebreaks before/after it ...
Definition: ISFDoc.hpp:175
ISFFileType
Definition: VVISF_Base.hpp:70
vector< ISFAttrRef > & imageInputs()
Returns a vector of ISFAttrRef instances describing only the receiver's image inputs.
Definition: ISFDoc.hpp:129
vector< string > & categories()
Returns a vector containing strings listing the receiver's categories.
Definition: ISFDoc.hpp:116
vector< ISFPassTargetRef > persistentPassTargets() const
Returns a vector of ISFPassTargetRef instances describing every pass that has a persistent buffer...
Definition: ISFDoc.hpp:148