diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/models/models_skybox.c | 1 | ||||
| -rw-r--r-- | examples/others/rlgl_standalone.c | 36 | ||||
| -rw-r--r-- | examples/shaders/shaders_hot_reloading.c | 2 |
3 files changed, 14 insertions, 25 deletions
diff --git a/examples/models/models_skybox.c b/examples/models/models_skybox.c index 2b98435a..168d61f6 100644 --- a/examples/models/models_skybox.c +++ b/examples/models/models_skybox.c @@ -11,6 +11,7 @@ #include "raylib.h" #include "rlgl.h" +#include "raymath.h" #if defined(PLATFORM_DESKTOP) #define GLSL_VERSION 330 diff --git a/examples/others/rlgl_standalone.c b/examples/others/rlgl_standalone.c index a069d029..d92729f7 100644 --- a/examples/others/rlgl_standalone.c +++ b/examples/others/rlgl_standalone.c @@ -48,14 +48,14 @@ * ********************************************************************************************/ -#define RLGL_IMPLEMENTATION -#define RLGL_STANDALONE -#include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 - #define RAYMATH_STANDALONE #define RAYMATH_HEADER_ONLY #include "raymath.h" // Vector3, Quaternion and Matrix functionality +#define RLGL_IMPLEMENTATION +#define RLGL_STANDALONE +#include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 + #if defined(__EMSCRIPTEN__) #define GLFW_INCLUDE_ES2 #endif @@ -116,22 +116,10 @@ static void DrawCubeWires(Vector3 position, float width, float height, float len static void DrawRectangleV(Vector2 position, Vector2 size, Color color); // NOTE: We used raymath to get this functionality but it can be implemented here -//static rlMatrix MatrixIdentity(void); -//static rlMatrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far); -//static rlMatrix MatrixPerspective(double fovy, double aspect, double near, double far); -//static rlMatrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up); - -rlMatrix rlMatrixFromMatrix(Matrix mat) -{ - rlMatrix result = { - mat.m0, mat.m4, mat.m8, mat.m12, // Matrix first row (4 comat.mponents) - mat.m1, mat.m5, mat.m9, mat.m13, // Matrix second row (4 comat.mponents) - mat.m2, mat.m6, mat.m10, mat.m14, // Matrix third row (4 comat.mponents) - mat.m3, mat.m7, mat.m11, mat.m15, // Matrix fourth row (4 comat.mponents) - }; - - return result; -} +//static Matrix MatrixIdentity(void); +//static Matrix MatrixOrtho(double left, double right, double bottom, double top, double near, double far); +//static Matrix MatrixPerspective(double fovy, double aspect, double near, double far); +//static Matrix MatrixLookAt(Vector3 eye, Vector3 target, Vector3 up); //---------------------------------------------------------------------------------- // Main Entry point @@ -226,8 +214,8 @@ int main(void) Matrix matProj = MatrixPerspective((double)(camera.fovy*DEG2RAD), (double)screenWidth/(double)screenHeight, 0.01, 1000.0); Matrix matView = MatrixLookAt(camera.position, camera.target, camera.up); - rlSetMatrixModelview(rlMatrixFromMatrix(matView)); // Set internal modelview matrix (default shader) - rlSetMatrixProjection(rlMatrixFromMatrix(matProj)); // Set internal projection matrix (default shader) + rlSetMatrixModelview(matView); // Set internal modelview matrix (default shader) + rlSetMatrixProjection(matProj); // Set internal projection matrix (default shader) DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RAYWHITE); @@ -244,8 +232,8 @@ int main(void) matProj = MatrixOrtho(0.0, screenWidth, screenHeight, 0.0, 0.0, 1.0); matView = MatrixIdentity(); - rlSetMatrixModelview(rlMatrixFromMatrix(matView)); // Set internal modelview matrix (default shader) - rlSetMatrixProjection(rlMatrixFromMatrix(matProj)); // Set internal projection matrix (default shader) + rlSetMatrixModelview(matView); // Set internal modelview matrix (default shader) + rlSetMatrixProjection(matProj); // Set internal projection matrix (default shader) #else // Let rlgl generate and multiply matrix internally diff --git a/examples/shaders/shaders_hot_reloading.c b/examples/shaders/shaders_hot_reloading.c index 05da7b7a..6f66f361 100644 --- a/examples/shaders/shaders_hot_reloading.c +++ b/examples/shaders/shaders_hot_reloading.c @@ -77,7 +77,7 @@ int main(void) // Try reloading updated shader Shader updatedShader = LoadShader(0, TextFormat(fragShaderFileName, GLSL_VERSION)); - if (updatedShader.id != rlGetShaderDefault().id) // It was correctly loaded + if (updatedShader.id != rlGetShaderIdDefault()) // It was correctly loaded { UnloadShader(shader); shader = updatedShader; |
