Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 167 vs 168 for /trunk/Source Code/Hardware/Video/OpenGL/GLWrapper.cpp

Diff revisions: vs.
  @@ -34,10 +34,6 @@
34 34 }
35 35 }
36 36
37 - bool GL_API::_coreGeomShadersAvailable = false;
38 - bool GL_API::_arbGeomShadersAvailable = false;
39 - bool GL_API::_extGeomShadersAvailable = false;
40 -
41 37 void GL_API::beginFrame(){
42 38 GLCheck(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT));
43 39 GL_API::clearColor(DIVIDE_BLUE());
  @@ -121,10 +117,10 @@
121 117 clearStates(false,false,false,false);
122 118 }
123 119
124 - void GL_API::renderInViewport(const vec4<GLint>& rect, boost::function0<void> callback){
125 - setViewport(rect.x, rect.y, rect.z, rect.w);
120 + void GL_API::renderInViewport(const vec4<GLuint>& rect, boost::function0<void> callback){
121 + setViewport(rect);
126 122 callback();
127 - restoreViewport();
123 + restoreViewport();
128 124 }
129 125
130 126 void GL_API::drawBox3D(const vec3<GLfloat>& min,const vec3<GLfloat>& max, const mat4<GLfloat>& globalOffset){
  @@ -171,7 +167,7 @@
171 167 SET_STATE_BLOCK(drawState,true);
172 168
173 169 if(ortho){
174 - setViewport(_cachedResolution.width - 128, 0, 128, 128);
170 + setViewport(vec4<U32>(_cachedResolution.width - 128, 0, 128, 128));
175 171 Divide::GL::_matrixMode(VIEW_MATRIX);
176 172 Divide::GL::_pushMatrix();
177 173 Divide::GL::_loadIdentity();
  @@ -215,16 +211,15 @@
215 211 axisData = true;
216 212 }
217 213
218 - glm::vec3 eyeVector = glm::normalize(Divide::GL::_currentLookAtVector.top() - Divide::GL::_currentEyeVector.top());
219 - eyeVector.x *= 2;
220 - eyeVector.y *= 2;
221 - eyeVector.z *= 2;
222 - drawLines(_pointsA,
223 - _pointsB,
224 - _colors,
225 - mat4<GLfloat>(glm::value_ptr(glm::lookAt(eyeVector,
226 - glm::vec3(0,0,0),
227 - glm::vec3(0,1,0)))),
214 + vec3<F32> eyeVector = - (Divide::GL::_currentViewDirection.top() * 2);
215 + const glm::mat4& viewMatrix = Divide::GL::_viewMatrix.top();
216 +
217 + drawLines(_pointsA, _pointsB, _colors,
218 + mat4<GLfloat>(glm::value_ptr(glm::lookAt(glm::vec3(eyeVector.x, eyeVector.y, eyeVector.z),
219 + glm::vec3(0.0f),
220 + glm::vec3(viewMatrix[0][1],
221 + viewMatrix[1][1],
222 + viewMatrix[2][1])))),
228 223 true,
229 224 true);
230 225 }
  @@ -374,5 +369,5 @@
374 369 // read the pixels from the frame buffer
375 370 GLCheck(glReadPixels(rect.x,rect.y,rect.z,rect.w,GL_RGBA,GL_UNSIGNED_BYTE, (GLvoid*)imageData));
376 371 //save to file
377 - ImageTools::SaveSeries(filename,w,h,32,imageData);
372 + ImageTools::SaveSeries(filename,vec2<U16>(w,h),32,imageData);
378 373 }