0

How to use char sumbols from GLSL? Test on https://www.shadertoy.com/new .

int c = int('a'); // Not work

How to get one sumbol or string? For call function.

DrawString("Hello world!"); // Example

I can do this, but it's so hard:

#define _H 72
DrawString(_H, _e, _l, _l, _o);
MikelSV
  • 175
  • 1
  • 8
  • see my [GLSL debug prints](https://stackoverflow.com/a/44797902/2521214). You can not have string as call parameter but you can have global text buffer where you have intermediate operands and stuff instead like I did in the linked QA... – Spektre Apr 18 '20 at 07:02
  • @Spektre, my font project https://www.shadertoy.com/view/3s2cRc . – MikelSV Apr 18 '20 at 11:37

1 Answers1

2

String and character literals do not exist in GLSL. You can make integer arrays, where the array values represent characters of some kind, but that's about it.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
  • see my [GLSL debug prints](https://stackoverflow.com/a/44797902/2521214) you can have character literals but you're right you need to store them into `int`s ... – Spektre Apr 18 '20 at 07:04