[seed] Shader example works with new importer now
- From: Robert Carr <racarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] Shader example works with new importer now
- Date: Tue, 14 Apr 2009 23:08:34 -0400 (EDT)
commit 8160ebadf6511b263ecd3ff15ee17f02cb21df60
Author: Robert Carr <racarr mireia (none)>
Date: Tue Apr 14 23:08:28 2009 -0400
Shader example works with new importer now
---
examples/clutter-shader/ShaderView.js | 19 ++++++++++++-------
examples/clutter-shader/main.js | 6 ++++--
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/examples/clutter-shader/ShaderView.js b/examples/clutter-shader/ShaderView.js
index 8a38951..fa1d351 100644
--- a/examples/clutter-shader/ShaderView.js
+++ b/examples/clutter-shader/ShaderView.js
@@ -1,8 +1,13 @@
#!/usr/bin/env seed
- function ShaderView(source_type, actor, reflection)
+Gtk = imports.gi.Gtk;
+Clutter = imports.gi.Clutter;
+GtkSource = imports.gi.GtkSource;
+Gio = imports.gi.Gio;
+
+function ShaderView(source_type, actor, reflection)
{
this.hbox = new Gtk.HBox();
-
+
var source_lang_mgr = new GtkSource.SourceLanguageManager();
var js_lang = source_lang_mgr.get_language("c");
@@ -13,21 +18,21 @@
source_view.set_show_right_margin(true);
source_view.set_highlight_current_line(true);
source_view.set_right_margin_position(80);
-
+
this.source_type = source_type;
-
+
var compile = new Gtk.Button({label: "Compile"});
var scrolled_window = new Gtk.ScrolledWindow(
- {vscrollbar_policy: Gtk.PolicyType.AUTOMATIC,
+ {vscrollbar_policy: Gtk.PolicyType.AUTOMATIC,
hscrollbar_policy: Gtk.PolicyType.AUTOMATIC});
scrolled_window.add(source_view);
-
+
this.hbox.pack_start(scrolled_window, true, true);
this.hbox.pack_start(compile);
this.actor = actor;
this.reflection = reflection;
-
+
this.make_shader = function(button, that)
{
shader.enabled = false;
diff --git a/examples/clutter-shader/main.js b/examples/clutter-shader/main.js
index c8be609..a827b94 100755
--- a/examples/clutter-shader/main.js
+++ b/examples/clutter-shader/main.js
@@ -1,5 +1,7 @@
#!/usr/bin/env seed
-imports.gi.versions.Clutter = 0.8;
+imports.gi.versions.Clutter = "0.8";
+imports.gi.versions.GtkClutter = "0.8";
+
Clutter = imports.gi.Clutter;
Gtk = imports.gi.Gtk;
GtkSource = imports.gi.GtkSource;
@@ -15,7 +17,7 @@ var gtkstage = new GtkClutter.Embed();
var stage = gtkstage.get_stage();
var texture = new Clutter.Texture({filename:"bob.jpg"});
var reflection = new Clutter.CloneTexture({parent_texture: texture});
-shader = new Clutter.Shader();
+ShaderView.shader = new Clutter.Shader();
var shaderfield = new ShaderView.ShaderView("fragment_source", texture,reflection);
var vbox = new Gtk.VBox();
var notebook = new Gtk.Notebook();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]