packages feed

gearbox 1.0.0.2 → 1.0.0.3

raw patch · 2 files changed

+27/−21 lines, 2 filesdep ~GLUTdep ~OpenGLRawdep ~Vec

Dependency ranges changed: GLUT, OpenGLRaw, Vec

Files

GearBox.hs view
@@ -1,9 +1,6 @@ -- GearBox -- zooming rotating fractal gearbox demo--- (GPL3+) 2012 Claude Heiland-Allen <claude@mathr.co.uk>--- usage: gearbox <quality>--- default quality is 9, useful range 6-14--- 'f' toggles full screen, any other key to quit--- tested with: ghc-7.0.4, ghc-7.4-rc1, ghc-7.6.1+-- (GPL3+) 2012,2015 Claude Heiland-Allen <claude@mathr.co.uk>+-- tested with: ghc-7.6.3, ghc-7.8.2, ghc-7.10.1~rc2  {-# LANGUAGE TypeOperators #-} import Control.Monad (forM, forM_, replicateM)@@ -158,7 +155,7 @@   glMatrixMode gl_MODELVIEW   glLoadIdentity   glBindFramebuffer gl_FRAMEBUFFER (fbo ifs)-  glUseProgramObject (fromIntegral $ p_shift ifs)+  glUseProgram (fromIntegral $ p_shift ifs)   glUniform1i (p_shift_u_t ifs) 0   to <- fmap last $ forM (take passes . ((True, (t_source ifs, t_ping ifs)) :) .       zip (repeat False) $ (iterate swap (t_ping ifs, t_pong ifs))) $@@ -178,7 +175,7 @@     glBindTexture gl_TEXTURE_2D 0     glFramebufferTexture2D gl_FRAMEBUFFER gl_COLOR_ATTACHMENT0 gl_TEXTURE_2D 0 0     return pong-  glUseProgramObject 0+  glUseProgram 0   glBindFramebuffer gl_FRAMEBUFFER 0   -- display the output scaled to the window   let w = fromIntegral $ w_width  ifs@@ -223,15 +220,15 @@ -- compile a shader shader :: String -> IO (Either String GLuint) shader frag = do-  p <- glCreateProgramObject-  f <- glCreateShaderObject gl_FRAGMENT_SHADER+  p <- glCreateProgram+  f <- glCreateShader gl_FRAGMENT_SHADER   withCString frag $ \s -> with s $ \src -> do     glShaderSource (fromIntegral f) 1 (castPtr src) nullPtr     glCompileShader (fromIntegral f)-    glAttachObject p f+    glAttachShader p f     glLinkProgram (fromIntegral p)     alloca $ \sp -> do-      glGetObjectParameteriv (fromIntegral p) gl_OBJECT_LINK_STATUS sp+      glGetProgramiv (fromIntegral p) gl_LINK_STATUS sp       success <- peek sp       if (success == 0)         then@@ -315,9 +312,9 @@   glBindFramebuffer gl_FRAMEBUFFER fbo'   glFramebufferTexture2D gl_FRAMEBUFFER gl_COLOR_ATTACHMENT0 gl_TEXTURE_2D t_source' 0   glClear (fromIntegral gl_COLOR_BUFFER_BIT)-  glUseProgramObject (fromIntegral p_gear')+  glUseProgram (fromIntegral p_gear')   unitQuad-  glUseProgramObject 0+  glUseProgram 0   glFramebufferTexture2D gl_FRAMEBUFFER gl_COLOR_ATTACHMENT0 gl_TEXTURE_2D 0 0   glBindFramebuffer gl_FRAMEBUFFER 0   glBindTexture gl_TEXTURE_2D t_source'
gearbox.cabal view
@@ -1,10 +1,17 @@ Name:                gearbox-Version:             1.0.0.2+Version:             1.0.0.3 Synopsis:            zooming rotating fractal gears graphics demo Description:         OpenGL gearbox iterated function system.  Usage:                      @gearbox quality@ where quality is an integer between-                     6 and 14 (default 9).  Shaders generate a gear shape+                     6 and 14 (default 9).  @f@ toggles full screen, any+                     other key to quit.  Shaders generate a gear shape                      and hue rotate succesive copies via texture feedback.+                     .+                     Blog post:+                     .+                       * <http://mathr.co.uk/blog/2012-01-12_gearbox.html>++Homepage:            http://code.mathr.co.uk/gearbox License:             GPL-3 License-file:        LICENSE Author:              Claude Heiland-Allen@@ -12,19 +19,21 @@ Category:            Demo Build-type:          Simple Cabal-version:       >=1.6+ Executable gearbox   Main-is:             GearBox.hs   Build-depends:     base < 5,-    GLUT >= 2.2 && < 2.4,-    OpenGLRaw >= 1.3 && < 1.4,-    Vec >= 1 && < 2+    GLUT == 2.6.*,+    OpenGLRaw == 2.3.*,+    Vec == 1.0.*+  GHC-options:         -Wall  Source-repository head   type:                git-  location:            git://gitorious.org/maximus/gearbox.git+  location:            http://code.mathr.co.uk/gearbox.git  Source-repository this   type:                git-  location:            git://gitorious.org/maximus/gearbox.git-  tag:                 v1.0.0.2+  location:            http://code.mathr.co.uk/gearbox.git+  tag:                 v1.0.0.3