Ticket #21 (new defect)

Opened 5 years ago

Last modified 5 years ago

FieldTrip doesn't build with OpenGL 2.4.0.1

Reported by: ajd Owned by:
Priority: major Milestone:
Version: Keywords:
Cc:

Description

The change to GLfloats instead of Floats really messes up FieldTrip. There are lots of compilation errors.

Change History

Changed 5 years ago by uzytkownik

It seems that I don't have right to add patch: {{{3 patches for repository code.haskell.org:/srv/code/FieldTrip:

Mon Jun 7 18:59:33 BST 2010 Maciej Piechotka <uzytkownik2@…>

  • Make compatible with OpenGL 2.4

Mon Jun 7 19:00:02 BST 2010 Maciej Piechotka <uzytkownik2@…>

  • Stricten the versions

Mon Jun 7 19:01:32 BST 2010 Maciej Piechotka <uzytkownik2@…>

  • Get rid of 'unused import' warning

New patches:

[Make compatible with OpenGL 2.4 Maciej Piechotka <uzytkownik2@…>**20100607175933

Ignore-this: 5025a21e52aa2e367c37434c3780e8f9

] { hunk ./src/Graphics/FieldTrip/Color.hs 77

toColor True = white toColor False = transparent

-instance HasColor? Float where toColor = grey +instance HasColor? GLfloat where toColor = grey

instance Color Bool where

color = color . toColor

hunk ./src/Graphics/FieldTrip/Geometry2.hs 101

ubox2
Geometry2 ubox2 = polygon [Vertex2 p p, Vertex2 p m, Vertex2 m m, Vertex2 m p] where
- p,m :: Float + p,m :: GLfloat

p = 1/2 m = -p

hunk ./src/Graphics/FieldTrip/Geometry2.hs 130

| sides < 3 = error "regularPolygon must have at least three sides" | otherwise = polygon points

where

- points :: [Point2 Float] + points :: [Point2 GLfloat]

points = [ point2Polar 1 (fromIntegral i * theta)

| i <- [sides,sides-1 .. 1]]

theta = 2*pi / fromIntegral sides

hunk ./src/Graphics/FieldTrip/Geometry2.hs 178

glText
String -> Geometry2 glText = withDefaultMat . preservingMatrix . renderString Roman
-glAboveBaseline, glBelowBaseline :: Double +glAboveBaseline, glBelowBaseline :: GLdouble

glAboveBaseline = 119.05 glBelowBaseline = 33.33

hunk ./src/Graphics/FieldTrip/Geometry2.hs 182 -glTextWidth :: String -> Double +glTextWidth :: String -> GLdouble

glTextWidth = fromIntegral . unsafePerformIO . stringWidth Roman

-- | The passed string of text centered at the origin with height 1.0

hunk ./src/Graphics/FieldTrip/Geometry2.hs 195

sc = (*%) (uscale2 (1.0/h))

-- | The width of the geometry of utext of that string.

-utextWidth :: String -> Double +utextWidth :: String -> GLdouble

utextWidth = flip (/) (glAboveBaseline+glBelowBaseline) . glTextWidth

-- | The height of the baseline of geometry created by utext. This can be

hunk ./src/Graphics/FieldTrip/Geometry2.hs 200

-- used for underlining, for example.

-utextBaseline :: Double +utextBaseline :: GLdouble

utextBaseline = glBelowBaseline/(glAboveBaseline+glBelowBaseline) - 0.5

hunk ./src/Graphics/FieldTrip/Geometry2.hs 225

-- | A geometry plus its a rotated-by-pi version.

andFlip2
Filter2

-andFlip2 im = im mappend (rotate2 (pi :: Float) *% im) +andFlip2 im = im mappend (rotate2 (pi :: GLfloat) *% im) hunk ./src/Graphics/FieldTrip/Image.hs 47

checker = uncurry ((==) on smallFrac)

-- TODO:

+ hunk ./src/Graphics/FieldTrip/Misc.hs 1 -{-# LANGUAGE ScopedTypeVariables? #-} +{-# LANGUAGE MultiParamTypeClasses?, ScopedTypeVariables?, + TypeFamilies? #-}

---------------------------------------------------------------------- -- | -- Module : Graphics.FieldTrip.Misc

hunk ./src/Graphics/FieldTrip/Misc.hs 20

R, fracPart, Unop, Binop, logMemo

) where

+import Data.Basis

import Data.MemoTrie?

hunk ./src/Graphics/FieldTrip/Misc.hs 22 +import Data.VectorSpace? +import Graphics.Rendering.OpenGL

-- | Values commonly used for coordinates, coefficients, etc.

hunk ./src/Graphics/FieldTrip/Misc.hs 26 -type R = Float +type R = GLfloat + +instance AdditiveGroup? GLfloat where + zeroV = 0 + x + y = x + y + negateV x = -x + +instance VectorSpace? GLfloat where + type Scalar GLfloat = GLfloat + (*) = (*) + +instance InnerSpace? GLfloat where (<.>) = (*) + +instance HasBasis? GLfloat where + type Basis GLfloat = () + basisValue () = 1 + decompose s = [((),s)] + decompose' s = const s + +instance AdditiveGroup? GLdouble where + zeroV = 0 + x + y = x + y + negateV x = -x + +instance VectorSpace? GLdouble where + type Scalar GLdouble = GLdouble + (*) = (*) + +instance InnerSpace? GLdouble where (<.>) = (*) + +instance HasBasis? GLdouble where + type Basis GLdouble = () + basisValue () = 1 + decompose s = [((),s)] + decompose' s = const s

-- | Fractional portion, @x - floor x@

fracPart
R -> R

hunk ./src/Graphics/FieldTrip/Vector2.hs 29

, vector2D, unvector2D ) where

-import Graphics.Rendering.OpenGL.GL.CoordTrans? (Vector2(..)) +import Graphics.Rendering.OpenGL.GL (Vector2(..))

import Data.VectorSpace? import Data.MemoTrie?

} [Stricten the versions Maciej Piechotka <uzytkownik2@…>**20100607180002

Ignore-this: a482ebeb21d6dd13bb255c62f2004ca

] hunk ./FieldTrip.cabal 23

build-type: Simple Hs-Source-Dirs: src Extensions:

-Build-Depends: base<5, old-time, OpenGL>=2.2.3.0, GLUT, TypeCompose?, MemoTrie?, vector-space >= 0.5.7, graphicsFormats +Build-Depends: base<5, + old-time, + OpenGL==2.4.*, + GLUT==2.2.*, + TypeCompose?==0.7.*, + MemoTrie?==0.4.7, + vector-space==0.5.*, + graphicsFormats==0.1.*

Exposed-Modules:

Graphics.FieldTrip Graphics.FieldTrip.Misc

[Get rid of 'unused import' warning Maciej Piechotka <uzytkownik2@…>**20100607180132

Ignore-this: 4c3d2fb26ef1ce0c94dd2baf86de1724

] hunk ./src/Graphics/FieldTrip/Transform3.hs 27

import Data.VectorSpace? (AdditiveGroup?,negateV) import Graphics.Rendering.OpenGL

-import Graphics.FieldTrip.Vector3 +import Graphics.FieldTrip.Vector3()

import Graphics.FieldTrip.Render (ErrorBound?)

import Graphics.FieldTrip.Transform

Context:

[TAG 0.2.7 Conal Elliott <conal@…>**20090605042108] [base<5 Conal Elliott <conal@…>**20090605042041] [TAG 0.2.6 Conal Elliott <conal@…>**20090605041604] [base<=4 Conal Elliott <conal@…>**20090605041533] [TAG 0.2.5 Conal Elliott <conal@…>**20090605040915] [0.2.5 Conal Elliott <conal@…>**20090605040853] [tweaked for OpenGL-2.2.3.0: removed some Functor & Applicative orphan instances Conal Elliott <conal@…>**20090605040757] [TAG 0.2.4 Conal Elliott <conal@…>**20090515011236] Patch bundle hash: b6ed28c985f8333390a698a3fe7125e98254c05b }}}

Changed 5 years ago by uzytkownik

And I cannot edit comment and it seems to mess with {{{.

There are 3 patches:

  • Main patch making appropiate changes (i.e. at least making FieldTrip buildable)
  • Patch strickening the version requirements. They should not specify only bigger then requirements
  • A small patch removing one warning

Please note that this patch adds orphan instances for GLdouble/GLfloat as vector spaces.

Changed 5 years ago by uzytkownik

1 patch for repository code.haskell.org:/srv/code/FieldTrip:

Mon Jun  7 19:17:43 BST 2010  Maciej Piechotka <uzytkownik2@gmail.com>
  * Change all Double/Float into GLdouble/GLfloat

New patches:

[Change all Double/Float into GLdouble/GLfloat
Maciej Piechotka <uzytkownik2@gmail.com>**20100607181743
 Ignore-this: 72890709c955832133e4f4ef5e66f8c8
] {
hunk ./src/Graphics/FieldTrip/Vector3.hs 29
   , vector3D, unvector3D, cross3
   ) where
 
-import Graphics.Rendering.OpenGL (Vector3(..))
+import Graphics.Rendering.OpenGL
 
 import Data.VectorSpace
 import Data.MemoTrie
hunk ./src/Graphics/FieldTrip/Vector3.hs 37
 import Data.Derivative
 import Data.Cross
 
-import Graphics.FieldTrip.Vector2
+import Graphics.FieldTrip.Misc()
+import Graphics.FieldTrip.Vector2()
 
 -- type V3 = Vector3 Double
 
hunk ./src/Graphics/FieldTrip/Vector3.hs 167
 
 -- sigh.  try the instance above when we're on ghc-6.9
 
-instance HasNormal (Three (Vector2 Float :> Float)) where
+instance HasNormal (Three (Vector2 GLfloat :> GLfloat)) where
   normalVec = unvector3D . normalVec . vector3D
 
hunk ./src/Graphics/FieldTrip/Vector3.hs 170
-instance HasNormal (Three (Vector2 Double :> Double)) where
+instance HasNormal (Three (Vector2 GLdouble :> GLdouble)) where
   normalVec = unvector3D . normalVec . vector3D
 
 vector3D :: (VectorSpace s, HasBasis a, HasTrie (Basis a)) =>
}

Context:

[TAG 0.2.7
Conal Elliott <conal@conal.net>**20090605042108] 
[base<5
Conal Elliott <conal@conal.net>**20090605042041] 
[TAG 0.2.6
Conal Elliott <conal@conal.net>**20090605041604] 
[base<=4
Conal Elliott <conal@conal.net>**20090605041533] 
[TAG 0.2.5
Conal Elliott <conal@conal.net>**20090605040915] 
[0.2.5
Conal Elliott <conal@conal.net>**20090605040853] 
[tweaked for OpenGL-2.2.3.0: removed some Functor & Applicative orphan instances
Conal Elliott <conal@conal.net>**20090605040757] 
[TAG 0.2.4
Conal Elliott <conal@conal.net>**20090515011236] 
[0.2.4: updated vector-space dep
Conal Elliott <conal@conal.net>**20090515011136] 
[TAG 0.2.3
Conal Elliott <conal@conal.net>**20090515011101] 
[0.2.3: AVector -> Diff; derivAtBasis; torus tweak
Conal Elliott <conal@conal.net>**20090515010804] 
[wikipage
Conal Elliott <conal@conal.net>**20081111191837] 
[TAG 0.2.2
Conal Elliott <conal@conal.net>**20081111172227] 
['reactive' --> 'FieldTrip'  in .cabal
Conal Elliott <conal@conal.net>**20081111171052] 
[removed obsolete examples/ directory.  see reactive-fieldtrip for examples.
Conal Elliott <conal@conal.net>**20081111161610] 
[code: frustrum --> frustum ; wikipage: example & video
Conal Elliott <conal@conal.net>**20081111060006] 
[TAG 0.2.1
Conal Elliott <conal@conal.net>**20081109211955] 
Patch bundle hash:
9f2eabae95cdff56881ea4e60c0b6d0b8c7d10b5

Additional patch

Note: See TracTickets for help on using tickets.