Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 279 vs 280 for /trunk/Source Code/Hardware/Video/Headers/GFXDevice.h

Diff revisions: vs.
  @@ -156,29 +156,30 @@
156 156 /* Clipping plane management. All the clipping planes are handled by shader programs only!
157 157 */
158 158 void updateClipPlanes();
159 - /// add a new clipping plane. This will be limited by the actual shaders (how many planes they use)
160 - /// this function returns the newly added clip plane's index in the vector
161 - inline I32 addClipPlane(Plane<F32>& p, ClipPlaneIndex clipIndex);
162 - /// add a new clipping plane defined by it's equation's coefficients
163 - inline I32 addClipPlane(F32 A, F32 B, F32 C, F32 D, ClipPlaneIndex clipIndex);
164 - /// change the clip plane index of the current plane
165 - inline bool changeClipIndex(U32 index, ClipPlaneIndex clipIndex);
166 - /// remove a clip plane by index
167 - inline bool removeClipPlane(U32 index);
168 159 /// disable a clip plane by index
169 - inline bool disableClipPlane(U32 index);
160 + inline void GFXDevice::disableClipPlane(ClipPlaneIndex index) { assert(index != ClipPlaneIndex_PLACEHOLDER); _clippingPlanes[index].active(false); _api.updateClipPlanes(); }
170 161 /// enable a clip plane by index
171 - inline bool enableClipPlane(U32 index);
162 + inline void GFXDevice::enableClipPlane(ClipPlaneIndex index) { assert(index != ClipPlaneIndex_PLACEHOLDER); _clippingPlanes[index].active(true); _api.updateClipPlanes(); }
172 163 /// modify a single clip plane by index
173 - inline void setClipPlane(U32 index, const Plane<F32>& p);
164 + inline void GFXDevice::setClipPlane(ClipPlaneIndex index, const Plane<F32>& p) { assert(index != ClipPlaneIndex_PLACEHOLDER); _clippingPlanes[index] = p; updateClipPlanes(); }
174 165 /// set a new list of clipping planes. The old one is discarded
175 - inline void setClipPlanes(const PlaneList& clipPlanes);
166 + inline void GFXDevice::setClipPlanes(const PlaneList& clipPlanes) {
167 + if (clipPlanes != _clippingPlanes) {
168 + _clippingPlanes = clipPlanes;
169 + updateClipPlanes();
170 + _api.updateClipPlanes();
171 + }
172 + }
173 +
176 174 /// clear all clipping planes
177 - inline void resetClipPlanes();
178 - /// have the clipping planes changed?
179 - inline bool clippingPlanesDirty() const {return _clippingPlanesDirty;}
175 + inline void GFXDevice::resetClipPlanes() {
176 + _clippingPlanes.resize(Config::MAX_CLIP_PLANES, Plane<F32>(0,0,0,0));
177 + updateClipPlanes();
178 + _api.updateClipPlanes();
179 + }
180 +
180 181 /// get the entire list of clipping planes
181 - inline const PlaneList& getClippingPlanes() const {return _clippingPlanes;}
182 + inline const PlaneList& getClippingPlanes() const {return _clippingPlanes;}
182 183 /// Post Processing state
183 184 inline bool postProcessingEnabled() const {return _enablePostProcessing;}
184 185 void postProcessingEnabled(const bool state);
  @@ -210,7 +211,7 @@
210 211 ///Sets a standard state block
211 212 inline I64 setDefaultStateBlock(bool forceUpdate = false) {return setStateBlock(_defaultStateBlockHash, forceUpdate);}
212 213 ///If a new state has been set, update the Graphics pipeline
213 - void updateStates(bool force = false);
214 + void updateStates();
214 215 /*//Render State Management */
215 216
216 217 ///Generate a cubemap from the given position
  @@ -355,7 +356,6 @@
355 356 ///Pointer to current kernel
356 357 Kernel* _kernel;
357 358 PlaneList _clippingPlanes;
358 - bool _clippingPlanesDirty;
359 359 bool _enablePostProcessing;
360 360 bool _enableAnaglyph;
361 361 bool _enableHDR;
  @@ -364,7 +364,7 @@
364 364 ///shader used to preview the depth buffer
365 365 ShaderProgram* _previewDepthMapShader;
366 366 static ShaderProgram* _HIZConstructProgram;
367 - static ShaderProgram* _depthRangesConstrucProgram;
367 + static ShaderProgram* _depthRangesConstructProgram;
368 368 bool _previewDepthBuffer;
369 369 ///getMatrix cache
370 370 mat4<F32> _mat4Cache;