From 343c51c4bd57c711011ac6bd6ea9402c3295490c Mon Sep 17 00:00:00 2001
From: marco <marco@5a81b35b-ba03-0410-adc8-b2c5c5119f08>
Date: Fri, 12 Mar 2010 09:17:01 +0000
Subject: [PATCH] added basic infrastructure for DOKK -  the ultimate docking
 game

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1814 5a81b35b-ba03-0410-adc8-b2c5c5119f08
---
 examples/dokk/dokk     |  2 ++
 examples/dokk/dokk.py  |  8 ++++++++
 examples/dokk/glwin.py | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 44 insertions(+)
 create mode 100755 examples/dokk/dokk
 create mode 100644 examples/dokk/dokk.py
 create mode 100644 examples/dokk/glwin.py

diff --git a/examples/dokk/dokk b/examples/dokk/dokk
new file mode 100755
index 000000000..166ed6fff
--- /dev/null
+++ b/examples/dokk/dokk
@@ -0,0 +1,2 @@
+#!/bin/sh
+cat dokk.py | gosty Dokk $@
\ No newline at end of file
diff --git a/examples/dokk/dokk.py b/examples/dokk/dokk.py
new file mode 100644
index 000000000..46de08f32
--- /dev/null
+++ b/examples/dokk/dokk.py
@@ -0,0 +1,8 @@
+import glwin
+from ost import gfx
+from ost import io
+sdh=io.LoadPDB('../entity/sdh.pdb')
+go=gfx.Entity("sdh", sdh)
+scene.Add(go)
+dokk_win=glwin.DokkGLWin()
+dokk_win.Show()
diff --git a/examples/dokk/glwin.py b/examples/dokk/glwin.py
new file mode 100644
index 000000000..0cc5f4fc0
--- /dev/null
+++ b/examples/dokk/glwin.py
@@ -0,0 +1,34 @@
+import math
+from ost import gfx
+from PyQt4.QtGui import *
+from PyQt4.QtCore import *
+from PyQt4.QtOpenGL import *
+
+class DokkGLCanvas(QGLWidget):
+  def __init__(self, format, parent=None):
+    QGLWidget.__init__(self, format, parent)
+  def initializeGL(self):
+    gfx.Scene().InitGL()
+
+  def paintGL(self):
+    gfx.Scene().RenderGL()
+
+  def resizeGL(self, w, h):
+    gfx.Scene().Resize(w, h)
+
+class DokkGLWin(gfx.GLWinBase):
+    def _CreateFormat(self):
+      fmt=QGLFormat()
+      fmt.setAlpha(True)
+      return fmt
+    def __init__(self):
+        gfx.GLWinBase.__init__(self)
+        self.canvas_=DokkGLCanvas(self._CreateFormat())
+
+    def DoRefresh(self):
+      self.refresh_=True
+
+    def Show(self):
+      self.canvas_.show()
+    def SetStereo():
+      pass
\ No newline at end of file
-- 
GitLab