<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cegui.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_%280.8%29</id>
		<title>Using PyCEGUI with glfw3 and PyOpenGL (0.8) - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://cegui.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_%280.8%29"/>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_(0.8)&amp;action=history"/>
		<updated>2026-08-16T15:27:47Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_(0.8)&amp;diff=5647&amp;oldid=prev</id>
		<title>Dermont: /* Demo Source */</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_(0.8)&amp;diff=5647&amp;oldid=prev"/>
				<updated>2015-03-27T13:15:03Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Demo Source&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;a href=&quot;http://cegui.org/wiki/index.php?title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_(0.8)&amp;amp;diff=5647&amp;amp;oldid=5646&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Dermont</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_(0.8)&amp;diff=5646&amp;oldid=prev</id>
		<title>Dermont: /* Main Loop */</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_(0.8)&amp;diff=5646&amp;oldid=prev"/>
				<updated>2015-03-27T13:07:15Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Main Loop&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:07, 27 March 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 244:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 244:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; elapsed = self.current_time - self.previous_time&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; elapsed = self.current_time - self.previous_time&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self.previous_time = self.current_time&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self.previous_time = self.current_time&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; # update GL/CEGUI&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; # update GL/CEGUI&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self.updateGL()&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self.updateGL()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self.updateCEGUI(elapsed)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self.updateCEGUI(elapsed)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; # Swap front and back buffers&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; # Swap front and back buffers&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.glfwSwapBuffers(self.glfw_window)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.glfwSwapBuffers(self.glfw_window)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; # Handle glfw events&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; # Handle glfw events&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.glfwPollEvents()&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.glfwPollEvents()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dermont</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_(0.8)&amp;diff=5645&amp;oldid=prev</id>
		<title>Dermont: /* Mouse/KeyBoard Mappings */</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_(0.8)&amp;diff=5645&amp;oldid=prev"/>
				<updated>2015-03-27T13:06:19Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Mouse/KeyBoard Mappings&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:06, 27 March 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Copy the following keyboard mappings to keymappings_glfw3.py in same directory as the demo.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Copy the following keyboard mappings to keymappings_glfw3.py in same directory as the demo.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;import sys&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &lt;/ins&gt;import sys&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; import glfw&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; import glfw&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; import PyCEGUI&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; import PyCEGUI&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;#160; ## our keyboard mappings&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; KEYMAPPINGS = {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; KEYMAPPINGS = {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.GLFW_KEY_UNKNOWN&amp;#160; &amp;#160; &amp;#160;  : PyCEGUI.Key.Unknown, &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.GLFW_KEY_UNKNOWN&amp;#160; &amp;#160; &amp;#160;  : PyCEGUI.Key.Unknown, &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 89:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.GLFW_KEY_WORLD_1&amp;#160; &amp;#160; &amp;#160;  : PyCEGUI.Key.Unknown,&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.GLFW_KEY_WORLD_1&amp;#160; &amp;#160; &amp;#160;  : PyCEGUI.Key.Unknown,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.GLFW_KEY_WORLD_2&amp;#160; &amp;#160; &amp;#160;  : PyCEGUI.Key.Unknown,&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.GLFW_KEY_WORLD_2&amp;#160; &amp;#160; &amp;#160;  : PyCEGUI.Key.Unknown,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.GLFW_KEY_ESCAPE&amp;#160; &amp;#160; &amp;#160; &amp;#160; : PyCEGUI.Key.Escape,&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.GLFW_KEY_ESCAPE&amp;#160; &amp;#160; &amp;#160; &amp;#160; : PyCEGUI.Key.Escape,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.GLFW_KEY_ENTER&amp;#160; &amp;#160; &amp;#160; &amp;#160;  : PyCEGUI.Key.Return,&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; glfw.GLFW_KEY_ENTER&amp;#160; &amp;#160; &amp;#160; &amp;#160;  : PyCEGUI.Key.Return,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dermont</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_(0.8)&amp;diff=5644&amp;oldid=prev</id>
		<title>Dermont: An example of using PyCEGUI with glfw3</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Using_PyCEGUI_with_glfw3_and_PyOpenGL_(0.8)&amp;diff=5644&amp;oldid=prev"/>
				<updated>2015-03-27T12:56:32Z</updated>
		
		<summary type="html">&lt;p&gt;An example of using PyCEGUI with glfw3&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{VersionBadge|0.8}}&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
For this example it is assumed that  [http://www.glfw.org/download.html glfw3] and [http://www.opengl.org OpenGL] are already installed. &lt;br /&gt;
We will be using the bindings for [https://github.com/rougier/pyglfw.git python glfw3] from Nicolas P. Rougier. Download from git clone https://github.com/rougier/pyglfw.git and copy the file glfw.py to the directory you are running the demo from.&lt;br /&gt;
&lt;br /&gt;
== Importing Modules ==&lt;br /&gt;
If you have trouble importing the PyCEGUI libraries you can update your python path to point to the location of the modules. For Linux you can simply point to your CEGUI build_dir/lib.&lt;br /&gt;
&lt;br /&gt;
    for _path in [os.path.join(s,'cegui-0.8') for s in site.getsitepackages()]:&lt;br /&gt;
        print _path&lt;br /&gt;
        sys.path.insert(0, _path)&lt;br /&gt;
    #sys.path.insert(0, &amp;quot;/media/sdb5/python-ogre-cegui/cegui-0.8/lib&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
== Setting Data Path ==&lt;br /&gt;
Set your path to the CEGUI media dir.&lt;br /&gt;
&lt;br /&gt;
    CEGUI_PATH = &amp;quot;/media/sdb5/Libraries/OGRE/sdk/v1-9/share/cegui-0/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Mouse/KeyBoard Mappings==&lt;br /&gt;
&lt;br /&gt;
    def ConvertMouseButton(button):&lt;br /&gt;
        ##Convert Mouse Buttons to CEGUI&lt;br /&gt;
        if (button == glfw.GLFW_MOUSE_BUTTON_RIGHT):&lt;br /&gt;
            return PyCEGUI.RightButton&lt;br /&gt;
        elif (button == glfw.GLFW_MOUSE_BUTTON_LEFT):&lt;br /&gt;
            return PyCEGUI.LeftButton&lt;br /&gt;
        elif (button == glfw.GLFW_MOUSE_BUTTON_MIDDLE):&lt;br /&gt;
            return PyCEGUI.MiddleButton&lt;br /&gt;
        else:&lt;br /&gt;
            return PyCEGUI.LeftButton&lt;br /&gt;
&lt;br /&gt;
Copy the following keyboard mappings to keymappings_glfw3.py in same directory as the demo.&lt;br /&gt;
&lt;br /&gt;
import sys&lt;br /&gt;
    import glfw&lt;br /&gt;
    import PyCEGUI&lt;br /&gt;
&lt;br /&gt;
    ## our keyboard mappings&lt;br /&gt;
    KEYMAPPINGS = {&lt;br /&gt;
        glfw.GLFW_KEY_UNKNOWN       : PyCEGUI.Key.Unknown, &lt;br /&gt;
        glfw.GLFW_KEY_SPACE         : PyCEGUI.Key.Space,&lt;br /&gt;
        glfw.GLFW_KEY_APOSTROPHE    : PyCEGUI.Key.Apostrophe,&lt;br /&gt;
        glfw.GLFW_KEY_COMMA         : PyCEGUI.Key.Comma,&lt;br /&gt;
        glfw.GLFW_KEY_MINUS         : PyCEGUI.Key.Minus,&lt;br /&gt;
        glfw.GLFW_KEY_PERIOD        : PyCEGUI.Key.Period,&lt;br /&gt;
        glfw.GLFW_KEY_SLASH         : PyCEGUI.Key.Slash,&lt;br /&gt;
        glfw.GLFW_KEY_0             : PyCEGUI.Key.Zero,&lt;br /&gt;
        glfw.GLFW_KEY_1             : PyCEGUI.Key.One,&lt;br /&gt;
        glfw.GLFW_KEY_2             : PyCEGUI.Key.Two,&lt;br /&gt;
        glfw.GLFW_KEY_3             : PyCEGUI.Key.Three,&lt;br /&gt;
        glfw.GLFW_KEY_4             : PyCEGUI.Key.Four,&lt;br /&gt;
        glfw.GLFW_KEY_5             : PyCEGUI.Key.Five,&lt;br /&gt;
        glfw.GLFW_KEY_6             : PyCEGUI.Key.Six,&lt;br /&gt;
        glfw.GLFW_KEY_7             : PyCEGUI.Key.Seven,&lt;br /&gt;
        glfw.GLFW_KEY_8             : PyCEGUI.Key.Eight,&lt;br /&gt;
        glfw.GLFW_KEY_9             : PyCEGUI.Key.Nine,&lt;br /&gt;
        glfw.GLFW_KEY_SEMICOLON     : PyCEGUI.Key.Semicolon,&lt;br /&gt;
        glfw.GLFW_KEY_EQUAL         : PyCEGUI.Key.Equals,&lt;br /&gt;
        glfw.GLFW_KEY_A             : PyCEGUI.Key.A,&lt;br /&gt;
        glfw.GLFW_KEY_B             : PyCEGUI.Key.B,&lt;br /&gt;
        glfw.GLFW_KEY_C             : PyCEGUI.Key.C,&lt;br /&gt;
        glfw.GLFW_KEY_D             : PyCEGUI.Key.D,&lt;br /&gt;
        glfw.GLFW_KEY_E             : PyCEGUI.Key.E,&lt;br /&gt;
        glfw.GLFW_KEY_F             : PyCEGUI.Key.F,&lt;br /&gt;
        glfw.GLFW_KEY_G             : PyCEGUI.Key.G,&lt;br /&gt;
        glfw.GLFW_KEY_H             : PyCEGUI.Key.H,&lt;br /&gt;
        glfw.GLFW_KEY_I             : PyCEGUI.Key.I,&lt;br /&gt;
        glfw.GLFW_KEY_J             : PyCEGUI.Key.J,&lt;br /&gt;
        glfw.GLFW_KEY_K             : PyCEGUI.Key.K,&lt;br /&gt;
        glfw.GLFW_KEY_L             : PyCEGUI.Key.L,&lt;br /&gt;
        glfw.GLFW_KEY_M             : PyCEGUI.Key.M,&lt;br /&gt;
        glfw.GLFW_KEY_N             : PyCEGUI.Key.N,&lt;br /&gt;
        glfw.GLFW_KEY_O             : PyCEGUI.Key.O,&lt;br /&gt;
        glfw.GLFW_KEY_P             : PyCEGUI.Key.P,&lt;br /&gt;
        glfw.GLFW_KEY_Q             : PyCEGUI.Key.Q,&lt;br /&gt;
        glfw.GLFW_KEY_R             : PyCEGUI.Key.R,&lt;br /&gt;
        glfw.GLFW_KEY_S             : PyCEGUI.Key.S,&lt;br /&gt;
        glfw.GLFW_KEY_T             : PyCEGUI.Key.T,&lt;br /&gt;
        glfw.GLFW_KEY_U             : PyCEGUI.Key.U,&lt;br /&gt;
        glfw.GLFW_KEY_V             : PyCEGUI.Key.V,&lt;br /&gt;
        glfw.GLFW_KEY_W             : PyCEGUI.Key.W,&lt;br /&gt;
        glfw.GLFW_KEY_X             : PyCEGUI.Key.X,&lt;br /&gt;
        glfw.GLFW_KEY_Y             : PyCEGUI.Key.Y,&lt;br /&gt;
        glfw.GLFW_KEY_Z             : PyCEGUI.Key.Z,&lt;br /&gt;
        glfw.GLFW_KEY_LEFT_BRACKET  : PyCEGUI.Key.LeftBracket,&lt;br /&gt;
        glfw.GLFW_KEY_BACKSLASH     : PyCEGUI.Key.Backslash,&lt;br /&gt;
        glfw.GLFW_KEY_RIGHT_BRACKET : PyCEGUI.Key.RightBracket,&lt;br /&gt;
        glfw.GLFW_KEY_GRAVE_ACCENT  : PyCEGUI.Key.Grave,&lt;br /&gt;
        glfw.GLFW_KEY_WORLD_1       : PyCEGUI.Key.Unknown,&lt;br /&gt;
        glfw.GLFW_KEY_WORLD_2       : PyCEGUI.Key.Unknown,&lt;br /&gt;
&lt;br /&gt;
        glfw.GLFW_KEY_ESCAPE        : PyCEGUI.Key.Escape,&lt;br /&gt;
        glfw.GLFW_KEY_ENTER         : PyCEGUI.Key.Return,&lt;br /&gt;
        glfw.GLFW_KEY_TAB           : PyCEGUI.Key.Tab,&lt;br /&gt;
        glfw.GLFW_KEY_BACKSPACE     : PyCEGUI.Key.Backspace,&lt;br /&gt;
        glfw.GLFW_KEY_INSERT        : PyCEGUI.Key.Insert,&lt;br /&gt;
        glfw.GLFW_KEY_DELETE        : PyCEGUI.Key.Delete,&lt;br /&gt;
        glfw.GLFW_KEY_RIGHT         : PyCEGUI.Key.ArrowRight,&lt;br /&gt;
        glfw.GLFW_KEY_LEFT          : PyCEGUI.Key.ArrowLeft,&lt;br /&gt;
        glfw.GLFW_KEY_DOWN          : PyCEGUI.Key.ArrowDown,&lt;br /&gt;
        glfw.GLFW_KEY_UP            : PyCEGUI.Key.ArrowUp,&lt;br /&gt;
        glfw.GLFW_KEY_PAGE_UP       : PyCEGUI.Key.PageUp,&lt;br /&gt;
        glfw.GLFW_KEY_PAGE_DOWN     : PyCEGUI.Key.PageDown,&lt;br /&gt;
        glfw.GLFW_KEY_HOME          : PyCEGUI.Key.Home,&lt;br /&gt;
        glfw.GLFW_KEY_END           : PyCEGUI.Key.End,&lt;br /&gt;
        glfw.GLFW_KEY_CAPS_LOCK     : PyCEGUI.Key.Capital,&lt;br /&gt;
        glfw.GLFW_KEY_SCROLL_LOCK   : PyCEGUI.Key.ScrollLock,&lt;br /&gt;
        glfw.GLFW_KEY_NUM_LOCK      : PyCEGUI.Key.NumLock,&lt;br /&gt;
        glfw.GLFW_KEY_PRINT_SCREEN  : PyCEGUI.Key.SysRq,&lt;br /&gt;
        glfw.GLFW_KEY_PAUSE         : PyCEGUI.Key.Pause,&lt;br /&gt;
        glfw.GLFW_KEY_F1            : PyCEGUI.Key.F1,&lt;br /&gt;
        glfw.GLFW_KEY_F2            : PyCEGUI.Key.F2,&lt;br /&gt;
        glfw.GLFW_KEY_F3            : PyCEGUI.Key.F3,&lt;br /&gt;
        glfw.GLFW_KEY_F4            : PyCEGUI.Key.F4,&lt;br /&gt;
        glfw.GLFW_KEY_F5            : PyCEGUI.Key.F5,&lt;br /&gt;
        glfw.GLFW_KEY_F6            : PyCEGUI.Key.F6,&lt;br /&gt;
        glfw.GLFW_KEY_F7            : PyCEGUI.Key.F7,&lt;br /&gt;
        glfw.GLFW_KEY_F8            : PyCEGUI.Key.F8,&lt;br /&gt;
        glfw.GLFW_KEY_F9            : PyCEGUI.Key.F9,&lt;br /&gt;
        glfw.GLFW_KEY_F10           : PyCEGUI.Key.F10,&lt;br /&gt;
        glfw.GLFW_KEY_F11           : PyCEGUI.Key.F11,&lt;br /&gt;
        glfw.GLFW_KEY_F12           : PyCEGUI.Key.F12,&lt;br /&gt;
        glfw.GLFW_KEY_F13           : PyCEGUI.Key.F13,&lt;br /&gt;
        glfw.GLFW_KEY_F14           : PyCEGUI.Key.F14,&lt;br /&gt;
        glfw.GLFW_KEY_F15           : PyCEGUI.Key.F15,&lt;br /&gt;
        glfw.GLFW_KEY_F16           : PyCEGUI.Key.Unknown,&lt;br /&gt;
        glfw.GLFW_KEY_F17           : PyCEGUI.Key.Unknown,&lt;br /&gt;
        glfw.GLFW_KEY_F18           : PyCEGUI.Key.Unknown,&lt;br /&gt;
        glfw.GLFW_KEY_F19           : PyCEGUI.Key.Unknown,&lt;br /&gt;
        glfw.GLFW_KEY_F20           : PyCEGUI.Key.Unknown,&lt;br /&gt;
        glfw.GLFW_KEY_F21           : PyCEGUI.Key.Unknown,&lt;br /&gt;
        glfw.GLFW_KEY_F22           : PyCEGUI.Key.Unknown,&lt;br /&gt;
        glfw.GLFW_KEY_F23           : PyCEGUI.Key.Unknown,&lt;br /&gt;
        glfw.GLFW_KEY_F24           : PyCEGUI.Key.Unknown,&lt;br /&gt;
        glfw.GLFW_KEY_F25           : PyCEGUI.Key.Unknown,&lt;br /&gt;
        glfw.GLFW_KEY_KP_0          : PyCEGUI.Key.Numpad0,&lt;br /&gt;
        glfw.GLFW_KEY_KP_1          : PyCEGUI.Key.Numpad1,&lt;br /&gt;
        glfw.GLFW_KEY_KP_2          : PyCEGUI.Key.Numpad2,&lt;br /&gt;
        glfw.GLFW_KEY_KP_3          : PyCEGUI.Key.Numpad3,&lt;br /&gt;
        glfw.GLFW_KEY_KP_4          : PyCEGUI.Key.Numpad4,&lt;br /&gt;
        glfw.GLFW_KEY_KP_5          : PyCEGUI.Key.Numpad5,&lt;br /&gt;
        glfw.GLFW_KEY_KP_6          : PyCEGUI.Key.Numpad6,&lt;br /&gt;
        glfw.GLFW_KEY_KP_7          : PyCEGUI.Key.Numpad7,&lt;br /&gt;
        glfw.GLFW_KEY_KP_8          : PyCEGUI.Key.Numpad8,&lt;br /&gt;
        glfw.GLFW_KEY_KP_9          : PyCEGUI.Key.Numpad9,&lt;br /&gt;
        glfw.GLFW_KEY_KP_DECIMAL    : PyCEGUI.Key.Decimal,&lt;br /&gt;
        glfw.GLFW_KEY_KP_DIVIDE     : PyCEGUI.Key.Divide,&lt;br /&gt;
        glfw.GLFW_KEY_KP_MULTIPLY   : PyCEGUI.Key.Multiply,&lt;br /&gt;
        glfw.GLFW_KEY_KP_SUBTRACT   : PyCEGUI.Key.Subtract,&lt;br /&gt;
        glfw.GLFW_KEY_KP_ADD        : PyCEGUI.Key.Add,&lt;br /&gt;
        glfw.GLFW_KEY_KP_ENTER      : PyCEGUI.Key.NumpadEnter,&lt;br /&gt;
        glfw.GLFW_KEY_KP_EQUAL      : PyCEGUI.Key.NumpadEquals,     &lt;br /&gt;
        glfw.GLFW_KEY_LEFT_SHIFT    : PyCEGUI.Key.LeftShift,&lt;br /&gt;
        glfw.GLFW_KEY_LEFT_CONTROL  : PyCEGUI.Key.LeftControl,&lt;br /&gt;
        glfw.GLFW_KEY_LEFT_ALT      : PyCEGUI.Key.LeftAlt,&lt;br /&gt;
        glfw.GLFW_KEY_LEFT_SUPER    : PyCEGUI.Key.LeftWindows,&lt;br /&gt;
        glfw.GLFW_KEY_RIGHT_SHIFT   : PyCEGUI.Key.RightShift,&lt;br /&gt;
        glfw.GLFW_KEY_RIGHT_CONTROL : PyCEGUI.Key.RightControl,&lt;br /&gt;
        glfw.GLFW_KEY_RIGHT_ALT     : PyCEGUI.Key.RightAlt,&lt;br /&gt;
        glfw.GLFW_KEY_RIGHT_SUPER   : PyCEGUI.Key.RightWindows,&lt;br /&gt;
        glfw.GLFW_KEY_MENU          : PyCEGUI.Key.AppMenu,&lt;br /&gt;
        glfw.GLFW_KEY_LAST          : PyCEGUI.Key.AppMenu&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
== Initialization glf3==&lt;br /&gt;
&lt;br /&gt;
    # Initialize glfw&lt;br /&gt;
    if not glfw.glfwInit():&lt;br /&gt;
        print (&amp;quot; Error : glfw failed to initialize&amp;quot;)&lt;br /&gt;
        sys.exit (glfw.EXIT_FAILURE)&lt;br /&gt;
&lt;br /&gt;
== Window Hints==&lt;br /&gt;
&lt;br /&gt;
Glfw3 allows to define window hints prior to creation and hints about your OpenGL Context (OpenGL Version). Note the MAJOR/MINOR values are the minimum API version of the window context, i.e. if you graphics card supports GL 4.4 that is what will be returned.&lt;br /&gt;
&lt;br /&gt;
GLFW_OPENGL_FORWARD_COMPAT (True) indicates that functionality deprecated in the requested version of OpenGL is removed.&lt;br /&gt;
&lt;br /&gt;
For the sake of testing PyCEGUI's OpenGL render set: &lt;br /&gt;
  ceguiGL3Renderer(True)/ GLFW_OPENGL_FORWARD_COMPAT(True)   - OpenGL3Renderer without GL2.1&lt;br /&gt;
  ceguiGL3Renderer(True)/ GLFW_OPENGL_FORWARD_COMPAT(False)  - OpenGL3Renderer with    GL2.1&lt;br /&gt;
  ceguiGL3Renderer(False)                                    - OpenGLRenderer&lt;br /&gt;
 &lt;br /&gt;
    ceguiGL3Renderer = True&lt;br /&gt;
    if ceguiGL3Renderer:&lt;br /&gt;
        glfw.glfwWindowHint(glfw.GLFW_CONTEXT_VERSION_MAJOR, 3)&lt;br /&gt;
        glfw.glfwWindowHint(glfw.GLFW_CONTEXT_VERSION_MINOR, 2)&lt;br /&gt;
        glfw.glfwWindowHint(glfw.GLFW_OPENGL_FORWARD_COMPAT, PyGL.GL_TRUE)&lt;br /&gt;
        glfw.glfwWindowHint(glfw.GLFW_OPENGL_PROFILE, glfw.GLFW_OPENGL_CORE_PROFILE)&lt;br /&gt;
    else:&lt;br /&gt;
        glfw.glfwWindowHint(glfw.GLFW_CONTEXT_VERSION_MAJOR, 2)&lt;br /&gt;
        glfw.glfwWindowHint(glfw.GLFW_CONTEXT_VERSION_MINOR, 1)&lt;br /&gt;
        glfw.glfwWindowHint(glfw.GLFW_OPENGL_PROFILE, glfw.GLFW_OPENGL_ANY_PROFILE)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating Window==&lt;br /&gt;
If you try to create a window with a context that you graphics card does not support glfwCreateWindow will fail. We&lt;br /&gt;
also need to make our context current prior to creating our PyCEGUI renderer.&lt;br /&gt;
&lt;br /&gt;
    glfw_window = glfw.glfwCreateWindow(1024, 768, &amp;quot;PyCEGUI glfw3 Demo&amp;quot;, None, None)&lt;br /&gt;
    if not glfw_window:&lt;br /&gt;
        print (&amp;quot; Error : glfw failed to create a window&amp;quot;)&lt;br /&gt;
        glfw.glfwTerminate()&lt;br /&gt;
        sys.exit()&lt;br /&gt;
&lt;br /&gt;
    glfw.glfwMakeContextCurrent(glfw_window)&lt;br /&gt;
&lt;br /&gt;
== VSnyc ==&lt;br /&gt;
This does nothing on linux and is dependent on your card settings. For example with a NVidia card change settings with NVidia X Server Settings-&amp;gt;OpenGL Settings-&amp;gt;Sync to VBlank.&lt;br /&gt;
&lt;br /&gt;
    glfw.glfwSwapInterval(0)&lt;br /&gt;
&lt;br /&gt;
== Callbacks ==&lt;br /&gt;
See the source for each of the following callbacks where we notify CEGUI of display size changes, mouse presses/movement, key presses and glfwSetCharCallback is our callback to pass the unicode char/key pressed to CEGUI.&lt;br /&gt;
&lt;br /&gt;
    glfw.glfwSetKeyCallback(             glfw_window,  self.on_key)&lt;br /&gt;
    glfw.glfwSetMouseButtonCallback(     glfw_window,  self.on_mouse)&lt;br /&gt;
    glfw.glfwSetCursorPosCallback(       glfw_window,  self.on_move)&lt;br /&gt;
    glfw.glfwSetWindowSizeCallback(      glfw_window,  self.on_resize)&lt;br /&gt;
    glfw.glfwSetCharCallback(            glfw_window,  self.on_char_callback)&lt;br /&gt;
    glfw.glfwSetFramebufferSizeCallback( glfw_window,  self.on_framebuffer_size_callback)&lt;br /&gt;
&lt;br /&gt;
== PyCEGUI Renderer ==&lt;br /&gt;
Create our PyCEGUI renderer.&lt;br /&gt;
&lt;br /&gt;
    if (not ceguiGL3Renderer):&lt;br /&gt;
        PyCEGUIOpenGLRenderer.OpenGLRenderer.bootstrapSystem()&lt;br /&gt;
    else :&lt;br /&gt;
        PyCEGUIOpenGLRenderer.OpenGL3Renderer.bootstrapSystem()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Main Loop ==&lt;br /&gt;
Our main loop runs until the glfw3 window is closed updating CEGUI, swapping the buffers and handling glfw events.&lt;br /&gt;
&lt;br /&gt;
    def updateCEGUI(self, elapsed):&lt;br /&gt;
        ##CEGUI updates ###&lt;br /&gt;
        if (PyCEGUI.System.getSingleton()):&lt;br /&gt;
            PyCEGUI.System.getSingleton().injectTimePulse(elapsed)&lt;br /&gt;
            PyCEGUI.System.getSingleton().renderAllGUIContexts()&lt;br /&gt;
            self.labelFPS.setText(&amp;quot;FPS : %s&amp;quot; %(str(int(1.0/elapsed))))&lt;br /&gt;
&lt;br /&gt;
    while not glfw.glfwWindowShouldClose(self.glfw_window):&lt;br /&gt;
        PyGL.glClear(PyGL.GL_COLOR_BUFFER_BIT)&lt;br /&gt;
        # update timing&lt;br /&gt;
        self.current_time = glfw.glfwGetTime()&lt;br /&gt;
        elapsed = self.current_time - self.previous_time&lt;br /&gt;
        self.previous_time = self.current_time&lt;br /&gt;
&lt;br /&gt;
        # update GL/CEGUI&lt;br /&gt;
        self.updateGL()&lt;br /&gt;
        self.updateCEGUI(elapsed)&lt;br /&gt;
&lt;br /&gt;
        # Swap front and back buffers&lt;br /&gt;
        glfw.glfwSwapBuffers(self.glfw_window)&lt;br /&gt;
&lt;br /&gt;
        # Handle glfw events&lt;br /&gt;
        glfw.glfwPollEvents()&lt;br /&gt;
&lt;br /&gt;
== Demo Source ==&lt;br /&gt;
&lt;br /&gt;
This is the full source code for the demo, see above saving the keyboard mappings.  &lt;br /&gt;
&lt;br /&gt;
     # -- coding: utf-8 --&lt;br /&gt;
&lt;br /&gt;
    import glfw&lt;br /&gt;
    import OpenGL.GL as PyGL&lt;br /&gt;
    import sys, os , site&lt;br /&gt;
&lt;br /&gt;
    ## set the path of your PyCEGUI* modules&lt;br /&gt;
    for _path in [os.path.join(s,'cegui-0.8') for s in site.getsitepackages()]:&lt;br /&gt;
        print _path&lt;br /&gt;
        sys.path.insert(0, _path)&lt;br /&gt;
    sys.path.insert(0, &amp;quot;/media/sdb5/python-ogre-cegui/cegui-0.8/lib&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    ## set the path to our resource files&lt;br /&gt;
    CEGUI_PATH = &amp;quot;/media/sdb5/Libraries/OGRE/sdk/v1-9/share/cegui-0/&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    ## import our PyCEGUI and out glfw3 to cegui key mappings&lt;br /&gt;
    import PyCEGUI&lt;br /&gt;
    import PyCEGUIOpenGLRenderer&lt;br /&gt;
    from keymappings_glfw3 import *&lt;br /&gt;
&lt;br /&gt;
    def ConvertMouseButton(button):&lt;br /&gt;
        ''' Convert Mouse Buttons to CEGUI '''&lt;br /&gt;
        if (button == glfw.GLFW_MOUSE_BUTTON_RIGHT):&lt;br /&gt;
            return PyCEGUI.RightButton&lt;br /&gt;
        elif (button == glfw.GLFW_MOUSE_BUTTON_LEFT):&lt;br /&gt;
            return PyCEGUI.LeftButton&lt;br /&gt;
        elif (button == glfw.GLFW_MOUSE_BUTTON_MIDDLE):&lt;br /&gt;
            return PyCEGUI.MiddleButton&lt;br /&gt;
        else:&lt;br /&gt;
            return PyCEGUI.LeftButton&lt;br /&gt;
&lt;br /&gt;
    class Application(object):&lt;br /&gt;
        def __init__(self):&lt;br /&gt;
&lt;br /&gt;
            # Initialize glfw&lt;br /&gt;
            if not glfw.glfwInit():&lt;br /&gt;
                print (&amp;quot; Error : glfw failed to initialize&amp;quot;)&lt;br /&gt;
                sys.exit (glfw.EXIT_FAILURE)&lt;br /&gt;
&lt;br /&gt;
            ceguiGL3Renderer = True&lt;br /&gt;
            if ceguiGL3Renderer:&lt;br /&gt;
                glfw.glfwWindowHint(glfw.GLFW_CONTEXT_VERSION_MAJOR, 3)&lt;br /&gt;
                glfw.glfwWindowHint(glfw.GLFW_CONTEXT_VERSION_MINOR, 2)&lt;br /&gt;
                glfw.glfwWindowHint(glfw.GLFW_OPENGL_FORWARD_COMPAT, PyGL.GL_TRUE)&lt;br /&gt;
                glfw.glfwWindowHint(glfw.GLFW_OPENGL_PROFILE, glfw.GLFW_OPENGL_CORE_PROFILE)&lt;br /&gt;
            else:&lt;br /&gt;
                glfw.glfwWindowHint(glfw.GLFW_CONTEXT_VERSION_MAJOR, 2)&lt;br /&gt;
                glfw.glfwWindowHint(glfw.GLFW_CONTEXT_VERSION_MINOR, 1)&lt;br /&gt;
                glfw.glfwWindowHint(glfw.GLFW_OPENGL_PROFILE, glfw.GLFW_OPENGL_ANY_PROFILE)&lt;br /&gt;
&lt;br /&gt;
            # our window hints&lt;br /&gt;
            ## http://www.glfw.org/docs/latest/window.html&lt;br /&gt;
            ## set our framebuffer related hints&lt;br /&gt;
            glfw.glfwWindowHint(glfw.GLFW_DEPTH_BITS, 24)&lt;br /&gt;
            glfw.glfwWindowHint(glfw.GLFW_STENCIL_BITS, 8)&lt;br /&gt;
&lt;br /&gt;
            glfw.glfwWindowHint(glfw.GLFW_FOCUSED, True)&lt;br /&gt;
&lt;br /&gt;
            fullScreen = False&lt;br /&gt;
            # create window&lt;br /&gt;
            if (not fullScreen):&lt;br /&gt;
                glfw_window = glfw.glfwCreateWindow(1024, 768, &amp;quot;PyCEGUI glfw3 Demo&amp;quot;, None, None)&lt;br /&gt;
            else:&lt;br /&gt;
                glfw_window = glfw.glfwCreateWindow(1024, 768, &amp;quot;PyCEGUI glfw3 Demo&amp;quot;, glfw.glfwGetPrimaryMonitor(), None)&lt;br /&gt;
&lt;br /&gt;
            # check window created&lt;br /&gt;
            if not glfw_window:&lt;br /&gt;
                print (&amp;quot; Error : glfw failed to create a window&amp;quot;)&lt;br /&gt;
                glfw.glfwTerminate()&lt;br /&gt;
                sys.exit()&lt;br /&gt;
            self.glfw_window = glfw_window&lt;br /&gt;
&lt;br /&gt;
            glfw.glfwMakeContextCurrent(glfw_window)&lt;br /&gt;
&lt;br /&gt;
            self.showglfwInfo()&lt;br /&gt;
&lt;br /&gt;
            ## this does nothing on linux&lt;br /&gt;
            glfw.glfwSwapInterval(0)&lt;br /&gt;
&lt;br /&gt;
            glfw.glfwSetInputMode(glfw_window, glfw.GLFW_CURSOR, glfw.GLFW_CURSOR_HIDDEN)&lt;br /&gt;
&lt;br /&gt;
            # call backs&lt;br /&gt;
            glfw.glfwSetKeyCallback(             glfw_window,  self.on_key)&lt;br /&gt;
            glfw.glfwSetMouseButtonCallback(     glfw_window,  self.on_mouse)&lt;br /&gt;
            glfw.glfwSetCursorPosCallback(       glfw_window,  self.on_move)&lt;br /&gt;
            glfw.glfwSetWindowSizeCallback(      glfw_window,  self.on_resize)&lt;br /&gt;
            glfw.glfwSetCharCallback(            glfw_window,  self.on_char_callback)&lt;br /&gt;
            glfw.glfwSetFramebufferSizeCallback( glfw_window,  self.on_framebuffer_size_callback)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            # initialise our CEGUI renderer&lt;br /&gt;
            ctx_major      = glfw.glfwGetWindowAttrib(glfw_window, glfw.GLFW_CONTEXT_VERSION_MAJOR)&lt;br /&gt;
            ctx_minor      = glfw.glfwGetWindowAttrib(glfw_window, glfw.GLFW_CONTEXT_VERSION_MINOR)&lt;br /&gt;
            forward_compat = glfw.glfwGetWindowAttrib(glfw_window, glfw.GLFW_OPENGL_FORWARD_COMPAT)&lt;br /&gt;
&lt;br /&gt;
            if (not ceguiGL3Renderer):&lt;br /&gt;
                PyCEGUIOpenGLRenderer.OpenGLRenderer.bootstrapSystem()&lt;br /&gt;
            else :&lt;br /&gt;
                PyCEGUIOpenGLRenderer.OpenGL3Renderer.bootstrapSystem()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
            # initialise PyCEGUI and resources&lt;br /&gt;
            rp = PyCEGUI.System.getSingleton().getResourceProvider()&lt;br /&gt;
         &lt;br /&gt;
            rp.setResourceGroupDirectory(&amp;quot;schemes&amp;quot;,    CEGUI_PATH + &amp;quot;schemes&amp;quot;)&lt;br /&gt;
            rp.setResourceGroupDirectory(&amp;quot;imagesets&amp;quot;,  CEGUI_PATH + &amp;quot;imagesets&amp;quot;)&lt;br /&gt;
            rp.setResourceGroupDirectory(&amp;quot;fonts&amp;quot;,      CEGUI_PATH + &amp;quot;fonts&amp;quot;)&lt;br /&gt;
            rp.setResourceGroupDirectory(&amp;quot;layouts&amp;quot;,    CEGUI_PATH + &amp;quot;layouts&amp;quot;)&lt;br /&gt;
            rp.setResourceGroupDirectory(&amp;quot;looknfeels&amp;quot;, CEGUI_PATH + &amp;quot;looknfeel&amp;quot;)&lt;br /&gt;
            rp.setResourceGroupDirectory(&amp;quot;schemas&amp;quot;,    CEGUI_PATH + &amp;quot;xml_schemas&amp;quot;)&lt;br /&gt;
         &lt;br /&gt;
            PyCEGUI.ImageManager.setImagesetDefaultResourceGroup(&amp;quot;imagesets&amp;quot;)&lt;br /&gt;
            PyCEGUI.Font.setDefaultResourceGroup(&amp;quot;fonts&amp;quot;)&lt;br /&gt;
            PyCEGUI.Scheme.setDefaultResourceGroup(&amp;quot;schemes&amp;quot;)&lt;br /&gt;
            PyCEGUI.WidgetLookManager.setDefaultResourceGroup(&amp;quot;looknfeels&amp;quot;)&lt;br /&gt;
            PyCEGUI.WindowManager.setDefaultResourceGroup(&amp;quot;layouts&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
            parser = PyCEGUI.System.getSingleton().getXMLParser()&lt;br /&gt;
            if parser.isPropertyPresent(&amp;quot;SchemaDefaultResourceGroup&amp;quot;):&lt;br /&gt;
                parser.setProperty(&amp;quot;SchemaDefaultResourceGroup&amp;quot;, &amp;quot;schemas&amp;quot;)     &lt;br /&gt;
&lt;br /&gt;
            # Load schemes&lt;br /&gt;
            PyCEGUI.SchemeManager.getSingleton().createFromFile(&amp;quot;TaharezLook.scheme&amp;quot;)&lt;br /&gt;
            PyCEGUI.SchemeManager.getSingleton().createFromFile(&amp;quot;WindowsLook.scheme&amp;quot;)&lt;br /&gt;
            PyCEGUI.System.getSingleton().getDefaultGUIContext().getMouseCursor().setDefaultImage(&amp;quot;TaharezLook/MouseArrow&amp;quot;)&lt;br /&gt;
         &lt;br /&gt;
            # set root window&lt;br /&gt;
            root = PyCEGUI.WindowManager.getSingleton().createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;background_wnd&amp;quot;);&lt;br /&gt;
            root.setArea( PyCEGUI.UVector2(PyCEGUI.UDim(0.0, 0),PyCEGUI.UDim(0.0, 0)) ,PyCEGUI.USize(PyCEGUI.UDim(1.0, 0),PyCEGUI.UDim(1.0, 0)))&lt;br /&gt;
            PyCEGUI.System.getSingleton().getDefaultGUIContext().setRootWindow(root)&lt;br /&gt;
&lt;br /&gt;
            # load a layout&lt;br /&gt;
            layout = PyCEGUI.WindowManager.getSingleton().loadLayoutFromFile(&amp;quot;TextDemo.layout&amp;quot;)&lt;br /&gt;
            root.addChild(layout.getChild('TextDemo'))&lt;br /&gt;
            self.edit = root.getChild('TextDemo/MultiLineGroup/editMulti')&lt;br /&gt;
&lt;br /&gt;
            # create label for our FPS&lt;br /&gt;
            self.labelFPS = PyCEGUI.WindowManager.getSingleton().createWindow(&amp;quot;TaharezLook/Label&amp;quot;, &amp;quot;FPSLabel&amp;quot;)&lt;br /&gt;
            root.addChild(self.labelFPS)&lt;br /&gt;
&lt;br /&gt;
            # create hello button&lt;br /&gt;
            button = PyCEGUI.WindowManager.getSingleton().createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;HelloButton&amp;quot;)&lt;br /&gt;
            button.setArea( PyCEGUI.UVector2(PyCEGUI.UDim(.50, 0),PyCEGUI.UDim(.92, 0)) ,PyCEGUI.USize(PyCEGUI.UDim(0.3, 0),PyCEGUI.UDim(0.05, 0)))&lt;br /&gt;
            button.setText(&amp;quot;Hello&amp;quot;)&lt;br /&gt;
            root.addChild(button)&lt;br /&gt;
            button.subscribeEvent(PyCEGUI.PushButton.EventClicked, self.OnbuttonClicked)&lt;br /&gt;
&lt;br /&gt;
            # init simple timing&lt;br /&gt;
            self.previous_time = glfw.glfwGetTime()&lt;br /&gt;
            self.current_time  = self.previous_time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        def showglfwInfo(self):&lt;br /&gt;
            ctx_major      = glfw.glfwGetWindowAttrib(self.glfw_window, glfw.GLFW_CONTEXT_VERSION_MAJOR)&lt;br /&gt;
            ctx_minor      = glfw.glfwGetWindowAttrib(self.glfw_window, glfw.GLFW_CONTEXT_VERSION_MINOR)&lt;br /&gt;
            forward_compat = glfw.glfwGetWindowAttrib(self.glfw_window, glfw.GLFW_OPENGL_FORWARD_COMPAT)&lt;br /&gt;
            print &amp;quot;Created Window for OpenGL version %d.%d &amp;quot; % ( ctx_major, ctx_major )&lt;br /&gt;
            if ( ctx_major &amp;gt;=3 and forward_compat):&lt;br /&gt;
                print &amp;quot;Context is forward compatible, you can't use OpenGL 2.x commands&amp;quot; &lt;br /&gt;
            fwidth,fheight = glfw.glfwGetFramebufferSize(self.glfw_window)&lt;br /&gt;
            width, height =  glfw.glfwGetWindowSize(self.glfw_window)&lt;br /&gt;
     &lt;br /&gt;
            print &amp;quot;Framebuffer size %dx%d Window size %dx%d &amp;quot; % (fwidth,fheight, width,height) &lt;br /&gt;
&lt;br /&gt;
        def OnbuttonClicked(self, args):&lt;br /&gt;
            self.edit.setText(self.edit.getText() + &amp;quot;You Clicked&amp;quot;)&lt;br /&gt;
            return&lt;br /&gt;
&lt;br /&gt;
        def cleanUp(self):&lt;br /&gt;
            ''' shutdown glfw and CEGUI '''&lt;br /&gt;
            PyCEGUIOpenGLRenderer.OpenGLRenderer.destroySystem()&lt;br /&gt;
            glfw.glfwTerminate()&lt;br /&gt;
&lt;br /&gt;
        def updateGL(self):&lt;br /&gt;
            ''' glfw GL updates '''&lt;br /&gt;
            pass&lt;br /&gt;
        &lt;br /&gt;
        def updateCEGUI(self, elapsed):&lt;br /&gt;
            ''' CEGUI updates '''&lt;br /&gt;
            #focused = glfw.glfwGetWindowAttrib(glfw_window, glfw.GLFW_CONTEXT_VERSION_MAJOR)&lt;br /&gt;
&lt;br /&gt;
            if (PyCEGUI.System.getSingleton()):&lt;br /&gt;
                PyCEGUI.System.getSingleton().injectTimePulse(elapsed)&lt;br /&gt;
                PyCEGUI.System.getSingleton().renderAllGUIContexts()&lt;br /&gt;
                self.labelFPS.setText(&amp;quot;FPS : %s&amp;quot; %(str(int(1.0/elapsed))))&lt;br /&gt;
&lt;br /&gt;
        def mainLoop(self):&lt;br /&gt;
            ''' Loop until glfw window is closed '''&lt;br /&gt;
&lt;br /&gt;
            while not glfw.glfwWindowShouldClose(self.glfw_window):&lt;br /&gt;
&lt;br /&gt;
                PyGL.glClear(PyGL.GL_COLOR_BUFFER_BIT)&lt;br /&gt;
&lt;br /&gt;
                # update timing&lt;br /&gt;
                self.current_time = glfw.glfwGetTime()&lt;br /&gt;
                elapsed = self.current_time - self.previous_time&lt;br /&gt;
                self.previous_time = self.current_time&lt;br /&gt;
&lt;br /&gt;
                # update GL/CEGUI&lt;br /&gt;
                self.updateGL()&lt;br /&gt;
                self.updateCEGUI(elapsed)&lt;br /&gt;
&lt;br /&gt;
                # Swap front and back buffers&lt;br /&gt;
                glfw.glfwSwapBuffers(self.glfw_window)&lt;br /&gt;
&lt;br /&gt;
                # Handle glfw events&lt;br /&gt;
                glfw.glfwPollEvents()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        def on_framebuffer_size_callback(self,window,width,height):&lt;br /&gt;
            ''' the framebuffer on high-DPI monitors may differ from the screen co-ords, so notify display size change here '''&lt;br /&gt;
            PyGL.glViewport(0, 0, width, height)&lt;br /&gt;
            if ( PyCEGUI.System.getSingleton()):&lt;br /&gt;
                PyCEGUI.System.getSingleton().notifyDisplaySizeChanged(PyCEGUI.Sizef(float(width), float(height) ))&lt;br /&gt;
&lt;br /&gt;
        def on_move(self, window, x,y):&lt;br /&gt;
            ''' pass glfw mouse moves to CEGUI '''&lt;br /&gt;
            if ( PyCEGUI.System.getSingleton()):&lt;br /&gt;
                PyCEGUI.System.getSingleton().getDefaultGUIContext().injectMousePosition(x, y)&lt;br /&gt;
&lt;br /&gt;
        def on_resize(self, window, width,height):&lt;br /&gt;
            ''' resize glfw viewport and CEGUI display '''&lt;br /&gt;
            PyGL.glViewport(0, 0, width, height)&lt;br /&gt;
            if ( PyCEGUI.System.getSingleton()):&lt;br /&gt;
                PyCEGUI.System.getSingleton().notifyDisplaySizeChanged(PyCEGUI.Sizef(float(width), float(height) ))&lt;br /&gt;
&lt;br /&gt;
        def on_mouse(self, window, button, action, mods):&lt;br /&gt;
            ''' pass glfw mouse press events to CEGUI '''&lt;br /&gt;
            if ( PyCEGUI.System.getSingleton()):&lt;br /&gt;
                context = PyCEGUI.System.getSingleton().getDefaultGUIContext()&lt;br /&gt;
                if (action == glfw.GLFW_PRESS):&lt;br /&gt;
                    context.injectMouseButtonDown( ConvertMouseButton(button) )&lt;br /&gt;
                if (action == glfw.GLFW_RELEASE):&lt;br /&gt;
                    context.injectMouseButtonUp( ConvertMouseButton(button) )&lt;br /&gt;
&lt;br /&gt;
        def on_char_callback(self, window, code):&lt;br /&gt;
            ''' Unicode character callback function to CEGUI '''&lt;br /&gt;
            PyCEGUI.System.getSingleton().getDefaultGUIContext().injectChar(code)&lt;br /&gt;
&lt;br /&gt;
        def on_key(self, window, key, scancode, action, mods):&lt;br /&gt;
            ''' pass keypress events to CEGUI '''&lt;br /&gt;
            if PyCEGUI.System.getSingleton():&lt;br /&gt;
                cegui_key = KEYMAPPINGS[key]&lt;br /&gt;
                if (not cegui_key==PyCEGUI.Key.Unknown):&lt;br /&gt;
                    if (action == glfw.GLFW_PRESS):&lt;br /&gt;
                        PyCEGUI.System.getSingleton().getDefaultGUIContext().injectKeyDown(PyCEGUI.Key.Scan(cegui_key))&lt;br /&gt;
                    if (action == glfw.GLFW_RELEASE):&lt;br /&gt;
                        PyCEGUI.System.getSingleton().getDefaultGUIContext().injectKeyUp(PyCEGUI.Key.Scan(cegui_key))&lt;br /&gt;
&lt;br /&gt;
            ## exit&lt;br /&gt;
            if key == glfw.GLFW_KEY_ESCAPE and action == glfw.GLFW_PRESS:&lt;br /&gt;
                glfw.glfwSetWindowShouldClose(window,1)&lt;br /&gt;
    if __name__ == '__main__':&lt;br /&gt;
        app = Application()&lt;br /&gt;
        app.mainLoop()&lt;br /&gt;
        app.cleanUp()&lt;br /&gt;
        del app&lt;br /&gt;
&lt;br /&gt;
And here is the link for the formatted [http://pastebin.com/d8RyqvSg source]&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Dermont</name></author>	</entry>

	</feed>