summaryrefslogtreecommitdiff
path: root/chart2/opengl
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-05-26 00:27:22 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-05-26 03:29:07 +0200
commit36943e981baf837191d78a0b7fe77c23e7dde0d6 (patch)
treee1c208ed7f028e15ca3915e300999914a1d4cd7a /chart2/opengl
parentf9d9aceb1c6448d2ed1ab3086e7a73684629233f (diff)
initial work on screen text
Screen text is positioned in screen coordinates and therefore in 2D. This means it will not move with the camera. Change-Id: I3cf2e8859871ebc8034396b4c2d6f1ff9fe5d9f6
Diffstat (limited to 'chart2/opengl')
-rw-r--r--chart2/opengl/screenTextFragmentShader.glsl17
-rw-r--r--chart2/opengl/screenTextVertexShader.glsl19
2 files changed, 36 insertions, 0 deletions
diff --git a/chart2/opengl/screenTextFragmentShader.glsl b/chart2/opengl/screenTextFragmentShader.glsl
new file mode 100644
index 000000000000..a8481034210a
--- /dev/null
+++ b/chart2/opengl/screenTextFragmentShader.glsl
@@ -0,0 +1,17 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+varying vec2 vTexCoord;
+uniform sampler2D TextTex;
+void main()
+{
+ gl_FragColor = vec4(texture2D(TextTex, vTexCoord).rgba);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/opengl/screenTextVertexShader.glsl b/chart2/opengl/screenTextVertexShader.glsl
new file mode 100644
index 000000000000..8d046f56394c
--- /dev/null
+++ b/chart2/opengl/screenTextVertexShader.glsl
@@ -0,0 +1,19 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+attribute vec3 vPosition;
+attribute vec2 texCoord;
+varying vec2 vTexCoord;
+void main()
+{
+ gl_Position = vec4(vPosition, 1);
+ vTexCoord = texCoord;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */