5 #if defined(VVGL_SDK_MAC) 6 #import <TargetConditionals.h> 30 bool _throwExceptions =
false;
34 ISFDocRef _doc =
nullptr;
38 VVGL::Timestamp _baseTime;
39 uint32_t _renderFrameIndex = 0;
40 double _renderTime = 0.;
41 double _renderTimeDelta = 0.;
42 uint32_t _passIndex = 1;
43 string *_compiledInputTypeString =
nullptr;
56 #if !defined(VVGL_TARGETENV_GLES) 57 VVGL::GLBufferRef _vao =
nullptr;
59 VVGL::GLBufferRef _vbo =
nullptr;
63 bool _alwaysRenderToFloat =
false;
64 bool _persistentToIOSurface =
false;
70 ISFScene(
const VVGL::GLContextRef & inCtx);
73 virtual void prepareToBeDeleted();
82 void useFile() noexcept(
false);
84 void useFile(
const string & inPath) noexcept(
false);
86 void useDoc(ISFDocRef & inDoc);
88 inline ISFDocRef
doc() { lock_guard<mutex> lock(_propertyLock);
return _doc; }
116 void setBufferForInputNamed(
const VVGL::GLBufferRef & inBuffer,
const string & inName);
118 void setFilterInputBuffer(
const VVGL::GLBufferRef & inBuffer);
120 void setBufferForInputImageKey(
const VVGL::GLBufferRef & inBuffer,
const string & inString);
122 void setBufferForAudioInputKey(
const VVGL::GLBufferRef & inBuffer,
const string & inString);
124 VVGL::GLBufferRef getBufferForImageInput(
const string & inKey);
126 VVGL::GLBufferRef getBufferForAudioInput(
const string & inKey);
128 VVGL::GLBufferRef getPersistentBufferNamed(
const string & inKey);
130 VVGL::GLBufferRef getTempBufferNamed(
const string & inKey);
133 void setValueForInputNamed(
const ISFVal & inVal,
const string & inName);
135 ISFVal valueForInputNamed(
const string & inName);
143 #pragma clang diagnostic push 145 #pragma clang diagnostic ignored "-Woverloaded-virtual" 153 virtual VVGL::GLBufferRef createAndRenderABuffer(
const VVGL::Size & inSize=
VVGL::Size(640.,480.), map<int32_t,VVGL::GLBufferRef> * outPassDict=
nullptr,
const VVGL::GLBufferPoolRef & inPoolRef=
nullptr);
162 virtual VVGL::GLBufferRef createAndRenderABuffer(
const VVGL::Size & inSize,
const double & inRenderTime, map<int32_t,VVGL::GLBufferRef> * outPassDict=
nullptr,
const VVGL::GLBufferPoolRef & inPoolRef=
nullptr);
163 #pragma clang diagnostic pop 167 void renderToBuffer(
const VVGL::GLBufferRef & inTargetBuffer,
const VVGL::Size & inRenderSize,
const double & inRenderTime, map<int32_t,VVGL::GLBufferRef> * outPassDict);
168 void renderToBuffer(
const VVGL::GLBufferRef & inTargetBuffer,
const VVGL::Size & inRenderSize,
const double & inRenderTime);
169 void renderToBuffer(
const VVGL::GLBufferRef & inTargetBuffer,
const VVGL::Size & inRenderSize, map<int32_t,VVGL::GLBufferRef> * outPassDict);
170 void renderToBuffer(
const VVGL::GLBufferRef & inTargetBuffer,
const VVGL::Size & inRenderSize);
171 void renderToBuffer(
const VVGL::GLBufferRef & inTargetBuffer);
174 VVGL::Size size()
const {
return _orthoSize; }
175 VVGL::Size renderSize()
const {
return _renderSize; }
177 inline VVGL::Timestamp
getTimestamp() {
return VVGL::Timestamp()-_baseTime; }
190 ISFAttrRef inputNamed(
const string & inName);
192 vector<ISFAttrRef> inputs();
194 vector<ISFAttrRef> inputsOfType(
const ISFValType & inType);
196 vector<ISFAttrRef> imageInputs();
198 vector<ISFAttrRef> audioInputs();
200 vector<ISFAttrRef> imageImports();
206 virtual void setVertexShaderString(
const string & n);
208 virtual void setFragmentShaderString(
const string & n);
211 #if !defined(VVGL_TARGETENV_GLES) 212 inline VVGL::GLBufferRef vao()
const {
return _vao; }
213 inline void setVAO(
const VVGL::GLBufferRef & n) { _vao = n; }
215 inline VVGL::GLBufferRef vbo()
const {
return _vbo; }
216 inline void setVBO(
const VVGL::GLBufferRef & n) { _vbo = n; }
217 void _setUpRenderCallback();
218 virtual void _renderPrep();
219 virtual void _initialize();
220 virtual void _renderCleanup();
221 virtual void _render(
const VVGL::GLBufferRef & inTargetBuffer,
const VVGL::Size & inSize,
const double & inTime, map<int32_t,VVGL::GLBufferRef> * outPassDict);
Subclass of GLScene- the primary interface for rendering and interacting with an ISF file...
Definition: ISFScene.hpp:28
ISFSceneRef CreateISFSceneRefUsing(const VVGL::GLContextRef &inCtx)
Creates and returns an ISFScene. The scene uses the passed GL context to do its drawing.
Definition: ISFScene.hpp:237
void setAlwaysRenderToFloat(const bool &n)
Sets the receiver's _alwaysRenderToFloat flag- if true, all frames will be rendered using high-bit-de...
Definition: ISFScene.hpp:99
Subclass of GLCachedProperty that caches the location of a uniform variable in a GLSL program...
Definition: GLCachedProperty.hpp:89
Definition: ISFAttr.hpp:12
Basic struct for 2D size.
Definition: VVGL_Geom.hpp:46
Subclass of GLCachedProperty that caches the location of an attribute in a GLSL program.
Definition: GLCachedProperty.hpp:66
bool alwaysRenderToFloat()
Gets the receiver's _alwaysRenderToFloat flag.
Definition: ISFScene.hpp:101
Manages drawing in a GLContext, provides a simple interface for orthographic rendering, render-to-texture operations, and loading vert/geo/frag shaders.
Definition: GLScene.hpp:33
ISFVal describes an ISF value- it has a type (ISFValType) and a type-dependent value. Intended to be immutable.
Definition: ISFVal.hpp:57
ISFValType
Enumerates the different kinds of ISF values.
Definition: ISFVal.hpp:25
std::shared_ptr< ISFScene > ISFSceneRef
ISFSceneRef is a shared pointer around an ISFScene instance.
Definition: VVISF_Base.hpp:62
ISFSceneRef CreateISFSceneRef()
Creates and returns an ISFScene. The scene makes a new GL context which shares the context of the glo...
Definition: ISFScene.hpp:232
VVGL::Timestamp getTimestamp()
Creates a a new Timestamp relative to the scene's built-in _baseTime instance. This is how the render...
Definition: ISFScene.hpp:177
void setPersistentToIOSurface(const bool &n)
Sets the receiver's _persistentToIOSurface flag- if true, all passes that are flagged as persistent w...
Definition: ISFScene.hpp:103
ISFDocRef doc()
Returns the ISFDoc currently being used by the scene. Interacting with this doc by setting the value ...
Definition: ISFScene.hpp:88
bool persistentToIOSurface()
Gets the receiver's _persistentToIOSurface flag.
Definition: ISFScene.hpp:105
void setThrowExceptions(const bool &n)
Sets the "throwExceptions" member var, which is false by default. If true, the ISFScene will throw an...
Definition: ISFScene.hpp:179