|
@@ -30,6 +30,7 @@
|
30
|
30
|
#include <stdlib.h>
|
31
|
31
|
#include <stdio.h>
|
32
|
32
|
#include <string.h>
|
|
33
|
+#include <cmath>
|
33
|
34
|
|
34
|
35
|
#ifdef MEMEORY_TEST
|
35
|
36
|
# include "memeory_test.h"
|
|
@@ -289,7 +290,13 @@ void SDLSystem::resize(unsigned int width, unsigned int height)
|
289
|
290
|
|
290
|
291
|
glMatrixMode(GL_PROJECTION);
|
291
|
292
|
glLoadIdentity();
|
292
|
|
- gluPerspective(m_fovY, aspect, m_clipNear, m_clipFar);
|
|
293
|
+
|
|
294
|
+ // gluPerspective is deprecated!
|
|
295
|
+ // gluPerspective(m_fovY, aspect, m_clipNear, m_clipFar);
|
|
296
|
+ // fix: http://stackoverflow.com/a/2417756
|
|
297
|
+ GLfloat fH = tan(float(m_fovY / 360.0f * 3.14159f) ) * m_clipNear;
|
|
298
|
+ GLfloat fW = fH * aspect;
|
|
299
|
+ glFrustum(-fW, fW, -fH, fH, m_clipNear, m_clipFar);
|
293
|
300
|
|
294
|
301
|
glMatrixMode(GL_MODELVIEW);
|
295
|
302
|
glLoadIdentity();
|