1 #ifndef ISFPassTarget_hpp 2 #define ISFPassTarget_hpp 6 #include "exprtk/exprtk.hpp" 35 VVGL::GLBufferRef _buffer =
nullptr;
40 double _targetWidth = 1.0;
41 string *_targetWidthString =
nullptr;
42 exprtk::expression<double> *_targetWidthExpression =
nullptr;
43 double _widthExpressionVar = 1.0;
45 double _targetHeight = 1.0;
46 string *_targetHeightString =
nullptr;
47 exprtk::expression<double> *_targetHeightExpression =
nullptr;
48 double _heightExpressionVar = 1.0;
50 bool _floatFlag =
false;
51 VVGL::GLCachedUniRef _cachedUnis[4] = {
nullptr,
nullptr,
nullptr,
nullptr };
56 static void cleanup();
66 void setTargetWidthString(
const string & n);
68 const string targetWidthString();
70 void setTargetHeightString(
const string & n);
72 const string targetHeightString();
74 void setFloatFlag(
const bool & n);
80 bool targetSizeNeedsEval()
const {
return (_targetHeightString!=
nullptr || _targetHeightString!=
nullptr); }
81 void evalTargetSize(
const VVGL::Size & inSize, map<string, double*> & inSymbols,
const bool & inResize,
const bool & inCreateNewBuffer);
84 string &
name() {
return _name; }
86 VVGL::GLBufferRef &
buffer() {
return _buffer; }
88 void setBuffer(
const VVGL::GLBufferRef & n) { _buffer=n; }
93 void cacheUniformLocations(
const int & inPgmToCheck) {
for (
int i=0; i<4; ++i) _cachedUnis[i]->cacheTheLoc(inPgmToCheck); }
94 int32_t getUniformLocation(
const int & inIndex)
const {
return (inIndex<0||inIndex>3) ? -1 : _cachedUnis[inIndex]->loc; }
95 void clearUniformLocations() {
for (
int i=0; i<4; ++i) _cachedUnis[i]->purgeCache(); }
98 void setTargetSize(
const VVGL::Size & inSize,
const bool & inResize=
true,
const bool & inCreateNewBuffer=
true);
Definition: ISFAttr.hpp:12
Basic struct for 2D size.
Definition: VVGL_Geom.hpp:46
string & name()
Returns the receiver's name.
Definition: ISFPassTarget.hpp:84
VVGL::Size targetSize()
Returns the last-calculated target size for this pass.
Definition: ISFPassTarget.hpp:91
Describes an "ISF file"- requires an actual file on disk which is parsed. Capable of generating GLSL ...
Definition: ISFDoc.hpp:35
bool floatFlag() const
Gets the float flag for this pass- if true, this pass needs to render to a high-bitdepth texture...
Definition: ISFPassTarget.hpp:76
void setBuffer(const VVGL::GLBufferRef &n)
Sets the GLBuffer currently cached with this pass.
Definition: ISFPassTarget.hpp:88
Describes the target of a render pass for an ISF file, stores a number of properties and values speci...
Definition: ISFPassTarget.hpp:32
shared_ptr< ISFPassTarget > ISFPassTargetRef
ISFPassTargetRef is a shared pointer around an ISFPassTarget instance.
Definition: VVISF_Base.hpp:45
VVGL::GLBufferRef & buffer()
Returns the GLBuffer currently cached with this pass, or null.
Definition: ISFPassTarget.hpp:86