OpenGL: replace gluProject and gluUnProject, and simplify surrounding code.

Part of T49042.
This commit is contained in:
2017-02-25 21:58:23 +01:00
parent e9011100f7
commit 2724fad582
19 changed files with 112 additions and 272 deletions

View File

@@ -1,6 +1,3 @@
#ifndef _GPU_MATRIX_H_
#define _GPU_MATRIX_H_
/*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -32,8 +29,11 @@
* \ingroup gpu
*/
#ifndef _GPU_MATRIX_H_
#define _GPU_MATRIX_H_
#include "BLI_sys_types.h"
#include "GPU_glew.h"
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
@@ -110,12 +110,10 @@ void gpuOrtho(float left, float right, float bottom, float top, float near, floa
void gpuFrustum(float left, float right, float bottom, float top, float near, float far);
void gpuPerspective(float fovy, float aspect, float near, float far);
/* pass vector through current transform (world --> screen) */
void gpuProject(const float obj[3], const float model[4][4], const float proj[4][4], const GLint view[4], float win[3]);
/* pass vector through inverse transform (world <-- screen) */
bool gpuUnProject(const float win[3], const float model[4][4], const float proj[4][4], const GLint view[4], float obj[3]);
/* 3D Projection between Window and World Space */
void gpuProject(const float world[3], const float model[4][4], const float proj[4][4], const int view[4], float win[3]);
bool gpuUnProject(const float win[3], const float model[4][4], const float proj[4][4], const int view[4], float world[3]);
/* 2D Projection Matrix */