[retro-gtk/wip/aplazas/gl-display: 6/10] Add OpenGL shader resources



commit e315ae0c56e1639b2252966f3dddc35859ed530b
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Sun Oct 15 09:36:05 2017 +0200

    Add OpenGL shader resources

 retro-gtk/meson.build                    |    8 ++++++++
 retro-gtk/retro-gl-display-fragment.glsl |    6 ++++++
 retro-gtk/retro-gl-display-vertex.glsl   |    6 ++++++
 retro-gtk/retro-gtk.gresource.xml        |    7 +++++++
 4 files changed, 27 insertions(+), 0 deletions(-)
---
diff --git a/retro-gtk/meson.build b/retro-gtk/meson.build
index 403d934..9626675 100644
--- a/retro-gtk/meson.build
+++ b/retro-gtk/meson.build
@@ -2,7 +2,15 @@ api_version = '0.14'
 
 retro_gtk_module = 'retro-gtk-' + api_version
 
+retro_gtk_resources = gnome.compile_resources(
+  'retro_gtk_resources',
+  'retro-gtk.gresource.xml',
+  c_name: 'retro_gtk',
+  source_dir: '.',
+)
+
 retro_gtk_sources = [
+  retro_gtk_resources[0],
   'retro-cairo-display.c',
   'retro-controller.c',
   'retro-controller-codes.c',
diff --git a/retro-gtk/retro-gl-display-fragment.glsl b/retro-gtk/retro-gl-display-fragment.glsl
new file mode 100644
index 0000000..f70065a
--- /dev/null
+++ b/retro-gtk/retro-gl-display-fragment.glsl
@@ -0,0 +1,6 @@
+#version 400
+
+out vec4 frag_colour;
+void main() {
+  frag_colour = vec4(0.5, 0.0, 0.5, 1.0);
+}
diff --git a/retro-gtk/retro-gl-display-vertex.glsl b/retro-gtk/retro-gl-display-vertex.glsl
new file mode 100644
index 0000000..d2107ad
--- /dev/null
+++ b/retro-gtk/retro-gl-display-vertex.glsl
@@ -0,0 +1,6 @@
+#version 400
+
+in vec3 vp;
+void main() {
+  gl_Position = vec4(vp, 1.0);
+}
diff --git a/retro-gtk/retro-gtk.gresource.xml b/retro-gtk/retro-gtk.gresource.xml
new file mode 100644
index 0000000..e9a9c5f
--- /dev/null
+++ b/retro-gtk/retro-gtk.gresource.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/Retro">
+    <file>retro-gl-display-fragment.glsl</file>
+    <file>retro-gl-display-vertex.glsl</file>
+  </gresource>
+</gresources>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]