Skip to content

Commit

Permalink
rendering: docs and wibbles for release
Browse files Browse the repository at this point in the history
  • Loading branch information
benl23x5 committed Apr 6, 2016
1 parent f9c8dd5 commit a5a7f55
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
10 changes: 7 additions & 3 deletions gloss-rendering/Graphics/Gloss/Internals/Data/Picture.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ data Picture
-- bitmap data.
--
-- The boolean flag controls whether Gloss should cache the data
-- between frames for speed. If you are programatically generating
-- the image for each frame then use `False`. If you have loaded it
-- from a file then use `True`.
-- in GPU memory between frames. If you are programatically generating
-- the image for each frame then use @False@. If you have loaded it
-- from a file then use @True@.
-- Setting @False@ for static images will make rendering slower
-- than it needs to be.
-- Setting @True@ for dynamically generated images will cause a
-- GPU memory leak.
| Bitmap Int Int BitmapData Bool

-- Color ------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ drawPicture state circScale picture
case rowOrder (bitmapFormat imgData) of
BottomToTop -> [(0,0), (1,0), (1,1), (0,1)]
TopToBottom -> [(0,1), (1,1), (1,0), (0,0)]

-- Load the image data into a texture,
-- or grab it from the cache if we've already done that before.
tex <- loadTexture (stateTextures state) width height imgData cacheMe
Expand Down Expand Up @@ -328,7 +329,7 @@ installTexture width height bitmapData@(BitmapData _ fmt fptr) cacheMe


-- | If this texture does not have its `cacheMe` flag set then delete it from
-- OpenGL and free the memory.
-- OpenGL and free the GPU memory.
freeTexture :: Texture -> IO ()
freeTexture tex
| texCacheMe tex = return ()
Expand Down
3 changes: 2 additions & 1 deletion gloss-rendering/Graphics/Gloss/Internals/Rendering/State.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import Data.IORef
import qualified Graphics.Rendering.OpenGL.GL as GL


-- | Render options settings
-- | Abstract Gloss render state which holds references to textures
-- loaded into the GPU context.
data State
= State
{ -- | Whether to use color
Expand Down
2 changes: 1 addition & 1 deletion gloss-rendering/gloss-rendering.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: gloss-rendering
version: 1.10
version: 1.10.1.1
license: MIT
license-file: LICENSE
author: Elise Huard
Expand Down

0 comments on commit a5a7f55

Please sign in to comment.