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-Inl.h

Diff revisions: vs.
  @@ -65,95 +65,12 @@
65 65 });
66 66 }
67 67
68 - /// add a new clipping plane. This will be limited by the actual shaders (how many planes they use)
69 - /// this function returns the newly added clip plane's index in the vector
70 - inline I32 GFXDevice::addClipPlane(Plane<F32>& p, ClipPlaneIndex clipIndex){
71 - if(_clippingPlanes.size() == Config::MAX_CLIP_PLANES){
72 - //overwrite the clipping planes from the front
73 - _clippingPlanes.erase(_clippingPlanes.begin());
74 - }
75 - p.setIndex(static_cast<I32>(clipIndex));
76 - _clippingPlanes.push_back(p);
77 - _clippingPlanesDirty = true;
78 -
79 - return (I32)(_clippingPlanes.size() - 1);
80 - }
81 -
82 - /// add a new clipping plane defined by it's equation's coefficients
83 - inline I32 GFXDevice::addClipPlane(F32 A, F32 B, F32 C, F32 D, ClipPlaneIndex clipIndex) {
84 - Plane<F32> temp(A, B, C, D);
85 - return addClipPlane(temp, clipIndex);
86 -
87 - }
88 -
89 - /// remove a clip plane by index
90 - inline bool GFXDevice::removeClipPlane(U32 index) {
91 - if(index < _clippingPlanes.size() && index >= 0) {
92 - _clippingPlanes.erase(_clippingPlanes.begin() + index);
93 - _clippingPlanesDirty = true;
94 - return true;
95 - }
96 - return false;
97 - }
98 -
99 - /// Change a clip planes bound index
100 - inline bool GFXDevice::changeClipIndex(U32 index, ClipPlaneIndex clipIndex){
101 - if (index < _clippingPlanes.size() && index >= 0) {
102 - _clippingPlanes[index].setIndex((U32)clipIndex);
103 - _clippingPlanesDirty = true;
104 - return true;
105 - }
106 - return false;
107 - }
108 -
109 - /// disable a clip plane by index
110 - inline bool GFXDevice::disableClipPlane(U32 index) {
111 - if(index < _clippingPlanes.size() && index >= 0) {
112 - _clippingPlanes[index].active(false);
113 - _clippingPlanesDirty = true;
114 - return true;
115 - }
116 - return false;
117 - }
118 -
119 - /// enable a clip plane by index
120 - inline bool GFXDevice::enableClipPlane(U32 index) {
121 - if(index < _clippingPlanes.size() && index >= 0) {
122 - _clippingPlanes[index].active(true);
123 - _clippingPlanesDirty = true;
124 - return true;
125 - }
126 - return false;
127 - }
128 -
129 - /// modify a single clip plane by index
130 - inline void GFXDevice::setClipPlane(U32 index, const Plane<F32>& p){
131 - CLAMP<U32>(index, 0 ,(U32)_clippingPlanes.size());
132 - _clippingPlanes[index] = p;
133 - _clippingPlanesDirty = true;
134 - }
135 -
136 - /// set a new list of clipping planes. The old one is discarded
137 - inline void GFXDevice::setClipPlanes(const PlaneList& clipPlanes) {
138 - if (clipPlanes != _clippingPlanes) {
139 - _clippingPlanes = clipPlanes;
140 - _clippingPlanesDirty = true;
141 - }
142 - }
143 -
144 - /// clear all clipping planes
145 - inline void GFXDevice::resetClipPlanes() {
146 - if (!_clippingPlanes.empty()) {
147 - _clippingPlanes.clear();
148 - _clippingPlanesDirty = true;
149 - }
150 - }
151 -
152 68 #define GFX_DEVICE GFXDevice::getInstance()
153 69 #define GFX_RENDER_BIN_SIZE RenderPassManager::getInstance().getLastTotalBinSize(0)
154 70
155 71 inline I64 SET_STATE_BLOCK(I64 blockHash, bool forceUpdate = false){
156 - return GFX_DEVICE.setStateBlock(blockHash, forceUpdate);
72 + return blockHash == 0 ? GFX_DEVICE.setDefaultStateBlock(forceUpdate) :
73 + GFX_DEVICE.setStateBlock(blockHash, forceUpdate);
157 74 }
158 75
159 76 inline I64 SET_DEFAULT_STATE_BLOCK(bool forceUpdate = false){