r-lyeh-archived / AVA

A tiny unlicensed 3D game engine in C; with C++ and Lua interfaces. Written in 32 random ̷d̷a̷y̷s̷ m̷o̷n̷t̷h̷s̷ years.
Other
336 stars 27 forks source link

Macros beginning with GL_* are reserved by glsl #2

Closed jbmcgee closed 5 years ago

jbmcgee commented 5 years ago

While building demos I get errors compiling vertex shader in shader 4:

ERROR: Vertex shader: ERROR: 0:21: '' : #define: re-defining pre-defined macro ERROR: 0:22: '' : #define: re-defining pre-defined macro

The issue is the macros defined in render_shader.c:

#define GL_TEXCOORD  texCoord
#define GL_FRAGCOLOR fragColor

It seems macros prefixed with GL_ are reserved according to the glsl spec.

All macro names containing two consecutive underscores ( _ ) are reserved for future use as predefined macro names. All macro names prefixed with “GL” (“GL” followed by a single underscore) are also reserved.

r-lyeh commented 5 years ago

Ah, will fix it. What is your graphics card vendor btw? That error never triggered here (NVidia+AMD+Intel setups) :) Btw, you have been granted a perpetual and irrevocable emoji prize for reporting 1st issue: 🥇 :D

jbmcgee commented 5 years ago

Thanks! I'm using nvidia gtx 1060m.