summaryrefslogtreecommitdiffhomepage
path: root/src/config.h
diff options
context:
space:
mode:
authorbohonghuang <[email protected]>2024-04-23 20:22:29 +0800
committerGitHub <[email protected]>2024-04-23 14:22:29 +0200
commitd80febde7de940d74a37a47729a15ad29b40cafb (patch)
tree2da32dd36d2f01b30f64c89f543e08e982593574 /src/config.h
parente0f6faa151589a185a04c2c723c01daff1b0a78f (diff)
downloadraylib-d80febde7de940d74a37a47729a15ad29b40cafb.tar.gz
raylib-d80febde7de940d74a37a47729a15ad29b40cafb.zip
[rlgl] Implement vertex normals for RLGL immediate drawing mode (#3866)
* Fix several non-functional `target_compile_definitions` * Avoid hardcoding the default vertex attribute locations * Implement functional `rlNormal3f` * Add normal definitions for `DrawCube` * Update the basic lighting example to use `DrawCube` and `DrawPlane`
Diffstat (limited to 'src/config.h')
-rw-r--r--src/config.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/config.h b/src/config.h
index 6d8169ba..1fe21454 100644
--- a/src/config.h
+++ b/src/config.h
@@ -112,14 +112,22 @@
#define RL_CULL_DISTANCE_NEAR 0.01 // Default projection matrix near cull distance
#define RL_CULL_DISTANCE_FAR 1000.0 // Default projection matrix far cull distance
+// Default shader vertex attribute locations
+#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION 0
+#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD 1
+#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL 2
+#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR 3
+#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT 4
+#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2 5
+
// Default shader vertex attribute names to set location points
// NOTE: When a new shader is loaded, the following locations are tried to be set for convenience
-#define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: 0
-#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: 1
-#define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: 2
-#define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: 3
-#define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: 4
-#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: 5
+#define RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION "vertexPosition" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION
+#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD "vertexTexCoord" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD
+#define RL_DEFAULT_SHADER_ATTRIB_NAME_NORMAL "vertexNormal" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_NORMAL
+#define RL_DEFAULT_SHADER_ATTRIB_NAME_COLOR "vertexColor" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_COLOR
+#define RL_DEFAULT_SHADER_ATTRIB_NAME_TANGENT "vertexTangent" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TANGENT
+#define RL_DEFAULT_SHADER_ATTRIB_NAME_TEXCOORD2 "vertexTexCoord2" // Bound by default to shader location: RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2
#define RL_DEFAULT_SHADER_UNIFORM_NAME_MVP "mvp" // model-view-projection matrix
#define RL_DEFAULT_SHADER_UNIFORM_NAME_VIEW "matView" // view matrix