summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichalKonecny <>2009-08-01 16:05:31 (GMT)
committerLuite Stegeman <luite@luite.com>2009-08-01 16:05:31 (GMT)
commit6e689d4419d5b2cc403de42496693f9065e4fc2a (patch)
treebcc69819945914f792a296b4c2f57a7c11536238
parent459b95cbd7be03b988624d7fc1bb8793aeeff1d7 (diff)
version 0.2.0.3HEAD0.2.0.3master
-rw-r--r--AERN-RnToRm-Plot.cabal8
-rw-r--r--ChangeLog1
-rw-r--r--src/Data/Number/ER/Misc/GL.hs19
-rw-r--r--src/Data/Number/ER/RnToRm/Plot/FnView.hs46
-rw-r--r--src/Data/Number/ER/RnToRm/Plot/GLDrawable.hs5
5 files changed, 51 insertions, 28 deletions
diff --git a/AERN-RnToRm-Plot.cabal b/AERN-RnToRm-Plot.cabal
index d57e7ca..cfbc02e 100644
--- a/AERN-RnToRm-Plot.cabal
+++ b/AERN-RnToRm-Plot.cabal
@@ -1,5 +1,5 @@
Name: AERN-RnToRm-Plot
-Version: 0.2.0.2
+Version: 0.2.0.3
Cabal-Version: >= 1.2
Build-Type: Simple
License: BSD3
@@ -28,13 +28,13 @@ Library
directory, filepath, time, stm, mtl,
AERN-Real >= 0.10, AERN-Real < 0.10.1,
AERN-RnToRm >= 0.5, AERN-RnToRm < 0.5.1,
- OpenGL >= 2.2.1.1, GLUT >= 2.1.1.1,
- OpenGL < 3, GLUT < 3,
+ OpenGL >= 2.3, OpenGL < 2.4,
gtk >= 0.10, gtkglext >= 0.10, glib >= 0.10, glade >= 0.10,
gtk < 0.11, gtkglext < 0.11, glib < 0.11, glade < 0.11
Exposed-modules:
Data.Number.ER.RnToRm.Plot.FnView,
Data.Number.ER.RnToRm.Plot.GLDrawable,
- Data.Number.ER.RnToRm.Plot.Params
+ Data.Number.ER.RnToRm.Plot.Params,
+ Data.Number.ER.Misc.GL
diff --git a/ChangeLog b/ChangeLog
index 9a39160..cfc67ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+0.2.0.3: 1 August 2009: adapted to new OpenGL, removed GLUT pseudo dependency
0.2.0.2: 29 July 2009: renamed "demos" folder to "examples"
0.2.0.1: 29 July 2009: fixed dependencies
0.2: 29 July 2009
diff --git a/src/Data/Number/ER/Misc/GL.hs b/src/Data/Number/ER/Misc/GL.hs
new file mode 100644
index 0000000..c799877
--- /dev/null
+++ b/src/Data/Number/ER/Misc/GL.hs
@@ -0,0 +1,19 @@
+{-|
+ Module : Data.Number.ER.Misc.GL
+ Description : some OpenGL extras
+ Copyright : (c) Michal Konecny 2008
+ License : BSD3
+
+ Maintainer : mik@konecny.aow.cz
+ Stability : experimental
+ Portability : portable
+
+ Miscelaneous utilities related to OpenGL.
+-}
+module Data.Number.ER.Misc.GL where
+
+-- import qualified Graphics.Rendering.OpenGL as GL
+import Foreign.C.Types
+
+doubleToCDouble :: Double -> CDouble
+doubleToCDouble = realToFrac
diff --git a/src/Data/Number/ER/RnToRm/Plot/FnView.hs b/src/Data/Number/ER/RnToRm/Plot/FnView.hs
index 8f3d4d1..9ec8a7e 100644
--- a/src/Data/Number/ER/RnToRm/Plot/FnView.hs
+++ b/src/Data/Number/ER/RnToRm/Plot/FnView.hs
@@ -63,7 +63,9 @@ import System.Directory
import Control.Monad.Reader.Class
import Control.Monad.Trans
+
import Foreign.Storable
+import Foreign.C.Types
{-|
Two transactional variables with values of the following two types
@@ -1004,29 +1006,29 @@ repaintCanvas canvas font (fadata, fndata) state =
do
return ()
-- FTGL.setFontFaceSize font 6 12
--- GL.matrixMode $= GL.Projection
+---- GL.matrixMode $= GL.Projection
-- GL.preservingMatrix $
-- do
--- GL.translate $ GL.Vector3 0.2 0.8 z
--- GL.scale 0.01 0.01 z
--- m <- GL.newMatrix GL.ColumnMajor [0.1, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 1]
--- GL.multMatrix (m :: GL.GLmatrix Double)
--- GL.renderPrimitive GL.Lines $
--- do
--- GL.vertex $ GL.Vertex3 0 0 z
--- GL.vertex $ GL.Vertex3 0.5 0.5 z
--- m <- GL.newMatrix GL.ColumnMajor [1,0,0,0,1,0,0,0,1]
--- let _ = m :: (GL.GLmatrix Double)
--- GL.withMatrix m $ \_ _ ->
+---- GL.translate $ GL.Vector3 0.2 0.8 z
+---- GL.scale 0.01 0.01 z
+-- m <- GL.newMatrix GL.ColumnMajor [0.1, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 1]
+-- GL.multMatrix (m :: GL.GLmatrix CDouble)
+-- GL.renderPrimitive GL.Lines $
-- do
----- GL.rasterPos $ GL.Vertex2 50 (50 :: GL.GLdouble)
----- FTGL.renderFont font label FTGL.Front
--- GL.renderPrimitive GL.Lines $
--- do
--- GL.vertex $ GL.Vertex3 0 0 z
--- GL.vertex $ GL.Vertex3 10 10 z
--- GtkGL.glDrawableSwapBuffers glwindow
----- box <- FTGL.getFontBBox font label
----- putStrLn $ show box
----- GLUT.renderString GLUT.Fixed9By15 label
+-- GL.vertex $ GL.Vertex3 0 0 z
+-- GL.vertex $ GL.Vertex3 0.5 0.5 z
+---- m <- GL.newMatrix GL.ColumnMajor [1,0,0,0,1,0,0,0,1]
+---- let _ = m :: (GL.GLmatrix Double)
+---- GL.withMatrix m $ \_ _ ->
+---- do
+------ GL.rasterPos $ GL.Vertex2 50 (50 :: GL.GLdouble)
+------ FTGL.renderFont font label FTGL.Front
+---- GL.renderPrimitive GL.Lines $
+---- do
+---- GL.vertex $ GL.Vertex3 0 0 z
+---- GL.vertex $ GL.Vertex3 10 10 z
+---- GtkGL.glDrawableSwapBuffers glwindow
+------ box <- FTGL.getFontBBox font label
+------ putStrLn $ show box
+------ GLUT.renderString GLUT.Fixed9By15 label
diff --git a/src/Data/Number/ER/RnToRm/Plot/GLDrawable.hs b/src/Data/Number/ER/RnToRm/Plot/GLDrawable.hs
index 6939e9f..8fcdca7 100644
--- a/src/Data/Number/ER/RnToRm/Plot/GLDrawable.hs
+++ b/src/Data/Number/ER/RnToRm/Plot/GLDrawable.hs
@@ -37,6 +37,7 @@ import Data.Number.ER.BasicTypes.DomainBox (VariableID(..), DomainBoxMappable, D
import Data.Number.ER.RnToRm.Plot.Params
import Data.Number.ER.Misc
+import Data.Number.ER.Misc.GL
import qualified Graphics.Rendering.OpenGL as GL
@@ -118,8 +119,8 @@ class
| otherwise =
((dD,vD1),(dD,vD2))
where
- (vD1,vD2) = RA.doubleBounds v
- dD = snd $ RA.doubleBounds d
+ (vD1,vD2) = mapPairHomog doubleToCDouble $ RA.doubleBounds v
+ dD = doubleToCDouble $ snd $ RA.doubleBounds d
mkVertexNorm (d,v) =
do
GL.vertex $ GL.Vertex3 dNorm vNorm 0