Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************
- *
- * MACRO FOR HAVING LONG STRINGS
- *
- ******************************/
- #ifndef GLSL
- #define GLSL(version,A) "#version " #version "\n" #A
- #endif
- /******************************
- *
- * EXAMPLE OF USING MACRO
- *
- ******************************/
- const char * vert = GLSL(120,
- attribute vec4 position;
- attribute vec4 color;
- varying vec4 dstColor;
- uniform mat4 ortho; //<-- new uniform matrix
- void main(){
- dstColor = color;
- gl_Position = ortho * position; //<-- matrix gets multiplied by the position
- }
- );
- const char * frag = GLSL(120,
- varying vec4 dstColor;
- void main(){
- gl_FragColor = dstColor;
- }
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement