From fd0f4fdb9da8e93f7204358fd2801e8c058af0b6 Mon Sep 17 00:00:00 2001 From: Mai Lavelle Date: Sat, 2 Apr 2016 00:13:11 -0400 Subject: [PATCH] Switch to multiline shader source for readability --- extension.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/extension.js b/extension.js index 5c39b89..4e4d6c5 100644 --- a/extension.js +++ b/extension.js @@ -33,7 +33,16 @@ const InvertWindowEffect = new Lang.Class({ _init: function(params) { this.parent(params); - this.set_shader_source('uniform sampler2D tex; void main() { vec4 color = texture2D(tex, cogl_tex_coord_in[0].st); color.rgb /= color.a; color.rgb = vec3(1.0, 1.0, 1.0) - color.rgb; color.rgb *= color.a; cogl_color_out = color * cogl_color_in; }'); + this.set_shader_source(' \ + uniform sampler2D tex; \ + void main() { \ + vec4 color = texture2D(tex, cogl_tex_coord_in[0].st); \ + color.rgb /= color.a; \ + color.rgb = vec3(1.0, 1.0, 1.0) - color.rgb; \ + color.rgb *= color.a; \ + cogl_color_out = color * cogl_color_in; \ + } \ + '); }, vfunc_paint_target: function() {