Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

You could use a macro:

#if __VERSION__ < 130
#define TEXTURE2D texture2D
#else
#define TEXTURE2D texture
#endif

...

vec4 textureColor =  TEXTURE2D(mySampler, fragmentUV);

I found this answerthis answer, that seems to have a compatibility include that handles more than just texture2d.

You could use a macro:

#if __VERSION__ < 130
#define TEXTURE2D texture2D
#else
#define TEXTURE2D texture
#endif

...

vec4 textureColor =  TEXTURE2D(mySampler, fragmentUV);

I found this answer, that seems to have a compatibility include that handles more than just texture2d.

You could use a macro:

#if __VERSION__ < 130
#define TEXTURE2D texture2D
#else
#define TEXTURE2D texture
#endif

...

vec4 textureColor =  TEXTURE2D(mySampler, fragmentUV);

I found this answer, that seems to have a compatibility include that handles more than just texture2d.

minor punctuatin edits; removed "
Source Link
Gnemlock
  • 5.3k
  • 5
  • 30
  • 60

You could use a macro:

#if __VERSION__ < 130
#define TEXTURE2D texture2D
#else
#define TEXTURE2D texture
#endif

...

vec4 textureColor =  TEXTURE2D(mySampler, fragmentUV);

EDIT: I found this answerthis answer, that seems to have a compatibility include that handles more than just texture2d http://stackoverflow.com/questions/2631324/opengl-shading-language-backwards-compatibilitytexture2d.

You could use a macro

#if __VERSION__ < 130
#define TEXTURE2D texture2D
#else
#define TEXTURE2D texture
#endif

...

vec4 textureColor =  TEXTURE2D(mySampler, fragmentUV);

EDIT: I found this answer that seems to have a compatibility include that handles more than just texture2d http://stackoverflow.com/questions/2631324/opengl-shading-language-backwards-compatibility

You could use a macro:

#if __VERSION__ < 130
#define TEXTURE2D texture2D
#else
#define TEXTURE2D texture
#endif

...

vec4 textureColor =  TEXTURE2D(mySampler, fragmentUV);

I found this answer, that seems to have a compatibility include that handles more than just texture2d.

Source Link

You could use a macro

#if __VERSION__ < 130
#define TEXTURE2D texture2D
#else
#define TEXTURE2D texture
#endif

...

vec4 textureColor =  TEXTURE2D(mySampler, fragmentUV);

EDIT: I found this answer that seems to have a compatibility include that handles more than just texture2d http://stackoverflow.com/questions/2631324/opengl-shading-language-backwards-compatibility