mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-07 11:58:13 +00:00
REVIEWED: Compule for OpenGL 1.1 #5088
This commit is contained in:
48
src/rlgl.h
48
src/rlgl.h
@@ -1157,16 +1157,16 @@ static const char *rlGetCompressedFormatName(int format); // Get compressed form
|
|||||||
|
|
||||||
static int rlGetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture)
|
static int rlGetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture)
|
||||||
|
|
||||||
|
static Matrix rlMatrixIdentity(void); // Get identity matrix
|
||||||
|
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||||
// Auxiliar matrix math functions
|
// Auxiliar matrix math functions
|
||||||
typedef struct rl_float16 {
|
typedef struct rl_float16 { float v[16]; } rl_float16;
|
||||||
float v[16];
|
|
||||||
} rl_float16;
|
|
||||||
static rl_float16 rlMatrixToFloatV(Matrix mat); // Get float array of matrix data
|
static rl_float16 rlMatrixToFloatV(Matrix mat); // Get float array of matrix data
|
||||||
#define rlMatrixToFloat(mat) (rlMatrixToFloatV(mat).v) // Get float vector for Matrix
|
#define rlMatrixToFloat(mat) (rlMatrixToFloatV(mat).v) // Get float vector for Matrix
|
||||||
static Matrix rlMatrixIdentity(void); // Get identity matrix
|
|
||||||
static Matrix rlMatrixMultiply(Matrix left, Matrix right); // Multiply two matrices
|
static Matrix rlMatrixMultiply(Matrix left, Matrix right); // Multiply two matrices
|
||||||
static Matrix rlMatrixTranspose(Matrix mat); // Transposes provided matrix
|
static Matrix rlMatrixTranspose(Matrix mat); // Transposes provided matrix
|
||||||
static Matrix rlMatrixInvert(Matrix mat); // Invert provided matrix
|
static Matrix rlMatrixInvert(Matrix mat); // Invert provided matrix
|
||||||
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Module Functions Definition - Matrix operations
|
// Module Functions Definition - Matrix operations
|
||||||
@@ -2571,9 +2571,9 @@ void rlLoadExtensions(void *loader)
|
|||||||
TRACELOG(RL_LOG_INFO, " > Version: %s", glGetString(GL_VERSION));
|
TRACELOG(RL_LOG_INFO, " > Version: %s", glGetString(GL_VERSION));
|
||||||
TRACELOG(RL_LOG_INFO, " > GLSL: %s", glGetString(GL_SHADING_LANGUAGE_VERSION));
|
TRACELOG(RL_LOG_INFO, " > GLSL: %s", glGetString(GL_SHADING_LANGUAGE_VERSION));
|
||||||
|
|
||||||
RLGL.loader = (rlglLoadProc)loader;
|
|
||||||
|
|
||||||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||||
|
RLGL.loader = (rlglLoadProc)loader;
|
||||||
|
|
||||||
// NOTE: Anisotropy levels capability is an extension
|
// NOTE: Anisotropy levels capability is an extension
|
||||||
#ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
|
#ifndef GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT
|
||||||
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
|
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
|
||||||
@@ -2632,8 +2632,13 @@ void rlLoadExtensions(void *loader)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get OpenGL procedure address
|
// Get OpenGL procedure address
|
||||||
void *rlGetProcAddress(const char *procName) {
|
void *rlGetProcAddress(const char *procName)
|
||||||
return RLGL.loader(procName);
|
{
|
||||||
|
void *func = NULL;
|
||||||
|
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||||
|
func = RLGL.loader(procName);
|
||||||
|
#endif
|
||||||
|
return func;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get current OpenGL version
|
// Get current OpenGL version
|
||||||
@@ -5140,7 +5145,20 @@ static int rlGetPixelDataSize(int width, int height, int format)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Auxiliar math functions
|
// Auxiliar math functions
|
||||||
|
//-------------------------------------------------------------------------------
|
||||||
|
// Get identity matrix
|
||||||
|
static Matrix rlMatrixIdentity(void)
|
||||||
|
{
|
||||||
|
Matrix result = {
|
||||||
|
1.0f, 0.0f, 0.0f, 0.0f,
|
||||||
|
0.0f, 1.0f, 0.0f, 0.0f,
|
||||||
|
0.0f, 0.0f, 1.0f, 0.0f,
|
||||||
|
0.0f, 0.0f, 0.0f, 1.0f
|
||||||
|
};
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||||
// Get float array of matrix data
|
// Get float array of matrix data
|
||||||
static rl_float16 rlMatrixToFloatV(Matrix mat)
|
static rl_float16 rlMatrixToFloatV(Matrix mat)
|
||||||
{
|
{
|
||||||
@@ -5166,19 +5184,6 @@ static rl_float16 rlMatrixToFloatV(Matrix mat)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get identity matrix
|
|
||||||
static Matrix rlMatrixIdentity(void)
|
|
||||||
{
|
|
||||||
Matrix result = {
|
|
||||||
1.0f, 0.0f, 0.0f, 0.0f,
|
|
||||||
0.0f, 1.0f, 0.0f, 0.0f,
|
|
||||||
0.0f, 0.0f, 1.0f, 0.0f,
|
|
||||||
0.0f, 0.0f, 0.0f, 1.0f
|
|
||||||
};
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get two matrix multiplication
|
// Get two matrix multiplication
|
||||||
// NOTE: When multiplying matrices... the order matters!
|
// NOTE: When multiplying matrices... the order matters!
|
||||||
static Matrix rlMatrixMultiply(Matrix left, Matrix right)
|
static Matrix rlMatrixMultiply(Matrix left, Matrix right)
|
||||||
@@ -5276,5 +5281,6 @@ static Matrix rlMatrixInvert(Matrix mat)
|
|||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // RLGL_IMPLEMENTATION
|
#endif // RLGL_IMPLEMENTATION
|
||||||
|
Reference in New Issue
Block a user