Hello community,

here is the log from the commit of package ghc-gloss for openSUSE:Factory 
checked in at 2017-08-31 20:51:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-gloss (Old)
 and      /work/SRC/openSUSE:Factory/.ghc-gloss.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ghc-gloss"

Thu Aug 31 20:51:16 2017 rev:2 rq:513258 version:1.11.1.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-gloss/ghc-gloss.changes      2017-04-12 
18:06:36.155519761 +0200
+++ /work/SRC/openSUSE:Factory/.ghc-gloss.new/ghc-gloss.changes 2017-08-31 
20:51:20.494585966 +0200
@@ -1,0 +2,5 @@
+Thu Jul 27 14:08:12 UTC 2017 - [email protected]
+
+- Update to version 1.11.1.1.
+
+-------------------------------------------------------------------

Old:
----
  gloss-1.10.2.5.tar.gz

New:
----
  gloss-1.11.1.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ghc-gloss.spec ++++++
--- /var/tmp/diff_new_pack.OHBAnc/_old  2017-08-31 20:51:21.446452351 +0200
+++ /var/tmp/diff_new_pack.OHBAnc/_new  2017-08-31 20:51:21.454451227 +0200
@@ -18,7 +18,7 @@
 
 %global pkg_name gloss
 Name:           ghc-%{pkg_name}
-Version:        1.10.2.5
+Version:        1.11.1.1
 Release:        0
 Summary:        Painless 2D vector graphics, animations and simulations
 License:        MIT

++++++ gloss-1.10.2.5.tar.gz -> gloss-1.11.1.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gloss-1.10.2.5/Graphics/Gloss/Data/Display.hs 
new/gloss-1.11.1.1/Graphics/Gloss/Data/Display.hs
--- old/gloss-1.10.2.5/Graphics/Gloss/Data/Display.hs   2017-01-02 
07:12:26.000000000 +0100
+++ new/gloss-1.11.1.1/Graphics/Gloss/Data/Display.hs   2017-03-14 
05:16:50.000000000 +0100
@@ -8,6 +8,6 @@
         -- | Display in a window with the given name, size and position.
         = InWindow   String (Int, Int) (Int, Int)
 
-        -- | Display full screen with a drawing area of the given size.
-        | FullScreen (Int, Int) 
+        -- | Display full screen.
+        | FullScreen
         deriving (Eq, Read, Show)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/gloss-1.10.2.5/Graphics/Gloss/Interface/Environment.hs 
new/gloss-1.11.1.1/Graphics/Gloss/Interface/Environment.hs
--- old/gloss-1.10.2.5/Graphics/Gloss/Interface/Environment.hs  1970-01-01 
01:00:00.000000000 +0100
+++ new/gloss-1.11.1.1/Graphics/Gloss/Interface/Environment.hs  2017-03-14 
05:16:50.000000000 +0100
@@ -0,0 +1,18 @@
+module Graphics.Gloss.Interface.Environment where
+import Graphics.Gloss.Internals.Interface.Backend.GLUT
+import qualified Graphics.UI.GLUT as GLUT
+import qualified Graphics.Rendering.OpenGL as GL
+import Data.IORef
+
+
+-- | Get the size of the screen, in pixels.
+--
+--   This will be the size of the rendered gloss image when 
+--   fullscreen mode is enabled.
+--
+getScreenSize :: IO (Int, Int)
+getScreenSize 
+ = do   backendStateRef         <- newIORef glutStateInit
+        initializeGLUT backendStateRef False
+        GL.Size width height    <- GLUT.get GLUT.screenSize
+        return (fromIntegral width, fromIntegral height)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/gloss-1.10.2.5/Graphics/Gloss/Internals/Interface/Backend/GLUT.hs 
new/gloss-1.11.1.1/Graphics/Gloss/Internals/Interface/Backend/GLUT.hs
--- old/gloss-1.10.2.5/Graphics/Gloss/Internals/Interface/Backend/GLUT.hs       
2017-01-02 07:12:26.000000000 +0100
+++ new/gloss-1.11.1.1/Graphics/Gloss/Internals/Interface/Backend/GLUT.hs       
2017-03-14 05:16:50.000000000 +0100
@@ -1,6 +1,6 @@
 {-# OPTIONS_HADDOCK hide #-}
 module Graphics.Gloss.Internals.Interface.Backend.GLUT
-        (GLUTState)
+        (GLUTState,glutStateInit,initializeGLUT)
 where
 
 import Data.IORef
@@ -11,7 +11,17 @@
 import qualified Graphics.UI.GLUT               as GLUT
 import qualified System.Exit                    as System
 import Graphics.Gloss.Internals.Interface.Backend.Types
+import System.IO.Unsafe
 
+-- Were we to support freeglut only, we could use GLUT.get to discover
+-- whether we are initialized or not. If not, we do a quick initialize,
+-- get the screenzie, and then do GLUT.exit. This avoids the use of
+-- global variables. Unfortunately, there is no failsafe way to check
+-- whether glut is initialized in some older versions of glut, which is
+-- what we'd use instead of the global variable to get the required info.  
+glutInitialized :: IORef Bool
+{-# NOINLINE glutInitialized #-}
+glutInitialized = unsafePerformIO $ do newIORef False
 
 -- | State information for the GLUT backend.
 data GLUTState 
@@ -31,8 +41,8 @@
 glutStateInit :: GLUTState
 glutStateInit  
         = GLUTState
-        { glutStateFrameCount   = 0 
-        , glutStateHasTimeout   = False 
+        { glutStateFrameCount   = 0
+        , glutStateHasTimeout   = False
         , glutStateHasIdle      = False }
 
 
@@ -83,25 +93,28 @@
         -> IO ()
 
 initializeGLUT _ debug 
- = do   (_progName, _args)  <- GLUT.getArgsAndInitialize
-
-        glutVersion         <- get GLUT.glutVersion
-        when debug
-         $ putStr  $ "  glutVersion        = " ++ show glutVersion   ++ "\n"
-
-        GLUT.initialDisplayMode
-          $= [ GLUT.RGBMode
-             , GLUT.DoubleBuffered]
-
-        -- See if our requested display mode is possible
-        displayMode         <- get GLUT.initialDisplayMode
-        displayModePossible <- get GLUT.displayModePossible
-        when debug
-         $ do putStr $  "  displayMode        = " ++ show displayMode ++ "\n"
-                     ++ "       possible      = " ++ show displayModePossible 
++ "\n"
-                     ++ "\n"
-
-
+  = do initialized <- readIORef glutInitialized
+       if not initialized
+         then do  (_progName, _args)  <- GLUT.getArgsAndInitialize
+                  glutVersion         <- get GLUT.glutVersion
+                  when debug
+                    $ putStr  $ "  glutVersion        = " ++ show glutVersion  
 ++ "\n"
+                  
+                  GLUT.initialDisplayMode
+                    $= [ GLUT.RGBMode
+                       , GLUT.DoubleBuffered]
+
+                  writeIORef glutInitialized True
+                  
+                  -- See if our requested display mode is possible
+                  displayMode         <- get GLUT.initialDisplayMode
+                  displayModePossible <- get GLUT.displayModePossible
+                  when debug
+                    $ do putStr $  "  displayMode        = " ++ show 
displayMode ++ "\n"
+                                ++ "       possible      = " ++ show 
displayModePossible ++ "\n"
+                                ++ "\n"
+         else when debug (putStrLn "Already initialized")
+         
 -- Open Window ----------------------------------------------------------------
 openWindowGLUT
         :: IORef GLUTState
@@ -133,11 +146,9 @@
                           (fromIntegral sizeX)
                           (fromIntegral sizeY)
 
-          FullScreen (sizeX, sizeY) -> 
-            do GLUT.initialWindowSize
-                     $= GL.Size
-                          (fromIntegral sizeX)
-                          (fromIntegral sizeY)
+          FullScreen -> 
+            do size <- get GLUT.screenSize
+               GLUT.initialWindowSize $= size
                _ <- GLUT.createWindow "Gloss Application"
                GLUT.fullScreen
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gloss-1.10.2.5/Graphics/Gloss.hs 
new/gloss-1.11.1.1/Graphics/Gloss.hs
--- old/gloss-1.10.2.5/Graphics/Gloss.hs        2017-01-02 07:12:26.000000000 
+0100
+++ new/gloss-1.11.1.1/Graphics/Gloss.hs        2017-03-14 05:16:50.000000000 
+0100
@@ -52,6 +52,10 @@
 -- @
 -- Release Notes:
 --
+--  For 1.11.1:
+--   Thanks to Lars Wyssard
+--   * Use default display resolution in full-screen mode.
+--
 --  For 1.10.1:
 --   * Gloss no longer consumes CPU time when displaying static pictures.
 --   * Added displayIO wrapper for mostly static pictures, eg when
@@ -65,14 +69,6 @@
 --   * Allow bitmaps to be specified in RGBA byte order as well as ABGR.
 --  Thanks to Gabriel Gonzalez
 --   * Package definitions for building with Stack.
---
--- For 1.9.1:
---  Thanks to Elise Huard
---   * Split rendering code into gloss-rendering package.
---
--- For 1.8.0:
---  Thanks to Francesco Mazzoli
---   * Factored out ViewPort and ViewState handling into user visible modules.
 -- @
 --
 -- For more information, check out <http://gloss.ouroborus.net>.
@@ -95,3 +91,4 @@
 import Graphics.Gloss.Interface.Pure.Animate
 import Graphics.Gloss.Interface.Pure.Simulate
 import Graphics.Gloss.Interface.Pure.Game
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/gloss-1.10.2.5/gloss.cabal 
new/gloss-1.11.1.1/gloss.cabal
--- old/gloss-1.10.2.5/gloss.cabal      2017-01-02 07:12:26.000000000 +0100
+++ new/gloss-1.11.1.1/gloss.cabal      2017-03-14 05:16:50.000000000 +0100
@@ -1,5 +1,5 @@
 Name:                gloss
-Version:             1.10.2.5
+Version:             1.11.1.1
 License:             MIT
 License-file:        LICENSE
 Author:              Ben Lippmeier
@@ -44,7 +44,7 @@
         OpenGL     >= 2.12 && < 3.1,
         GLUT       == 2.7.*,
         bmp        == 1.2.*,
-        gloss-rendering == 1.10.*
+        gloss-rendering == 1.11.*
 
   ghc-options:
         -O2 -Wall
@@ -70,7 +70,8 @@
         Graphics.Gloss.Interface.IO.Display
         Graphics.Gloss.Interface.IO.Simulate
         Graphics.Gloss.Interface.IO.Game
-
+        Graphics.Gloss.Interface.Environment
+        
   Other-modules:
         Graphics.Gloss.Internals.Color
         Graphics.Gloss.Internals.Interface.Animate.State


Reply via email to