diff options
| author | Ray <[email protected]> | 2021-08-22 01:07:37 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-08-22 01:07:37 +0200 |
| commit | d98779abef04088206cef7ccc291370ecc1a445e (patch) | |
| tree | 94377a4fbb1aceb26059511edf254373d79717d6 | |
| parent | aefdb9f9cf10e768cc1818cf6ef7887110833810 (diff) | |
| download | raylib-d98779abef04088206cef7ccc291370ecc1a445e.tar.gz raylib-d98779abef04088206cef7ccc291370ecc1a445e.zip | |
Minor tweak to avoid false error logs
| -rw-r--r-- | src/core.c | 7 | ||||
| -rw-r--r-- | src/raylib.h | 2 |
2 files changed, 6 insertions, 3 deletions
@@ -2281,8 +2281,11 @@ Shader LoadShader(const char *vsFileName, const char *fsFileName) { Shader shader = { 0 }; - char *vShaderStr = LoadFileText(vsFileName); - char *fShaderStr = LoadFileText(fsFileName); + char *vShaderStr = NULL; + char *fShaderStr = NULL; + + if (vsFileName != NULL) vShaderStr = LoadFileText(vsFileName); + if (fsFileName != NULL) fShaderStr = LoadFileText(fsFileName); shader = LoadShaderFromMemory(vShaderStr, fShaderStr); diff --git a/src/raylib.h b/src/raylib.h index 11ff587d..7613dd94 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -318,7 +318,7 @@ typedef struct Mesh { int vertexCount; // Number of vertices stored in arrays int triangleCount; // Number of triangles stored (indexed or not) - // Default vertex data + // Vertex attributes data float *vertices; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0) float *texcoords; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) float *texcoords2; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) |
