mirror of
https://github.com/glfw/glfw.git
synced 2026-08-27 12:05:55 +02:00
Replace GLU with linmath.h in examples
This commit is contained in:
@@ -17,9 +17,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#define GLFW_INCLUDE_GLU
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <linmath.h>
|
||||
|
||||
// Maximum delta T to allow for differential calculations
|
||||
#define MAX_DELTA_T 0.01
|
||||
|
||||
@@ -363,6 +364,7 @@ void scroll_callback(GLFWwindow* window, double x, double y)
|
||||
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
|
||||
{
|
||||
float ratio = 1.f;
|
||||
mat4x4 projection;
|
||||
|
||||
if (height > 0)
|
||||
ratio = (float) width / (float) height;
|
||||
@@ -372,8 +374,11 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
|
||||
|
||||
// Change to the projection matrix and set our viewing volume
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(60.0, ratio, 1.0, 1024.0);
|
||||
mat4x4_perspective(projection,
|
||||
60.f * (float) M_PI / 180.f,
|
||||
ratio,
|
||||
1.f, 1024.f);
|
||||
glLoadMatrixf((const GLfloat*) projection);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user