summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2021-08-22 01:07:37 +0200
committerRay <[email protected]>2021-08-22 01:07:37 +0200
commitd98779abef04088206cef7ccc291370ecc1a445e (patch)
tree94377a4fbb1aceb26059511edf254373d79717d6
parentaefdb9f9cf10e768cc1818cf6ef7887110833810 (diff)
downloadraylib-d98779abef04088206cef7ccc291370ecc1a445e.tar.gz
raylib-d98779abef04088206cef7ccc291370ecc1a445e.zip
Minor tweak to avoid false error logs
-rw-r--r--src/core.c7
-rw-r--r--src/raylib.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/core.c b/src/core.c
index b03216cc..27b6c31b 100644
--- a/src/core.c
+++ b/src/core.c
@@ -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)