This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE Rank2Types #-} | |
import qualified Graphics.UI.SDL as SDL | |
import Reactive.Banana | |
import Reactive.Banana.Frameworks | |
{------------------------------------------------------------------------------ | |
Main | |
---------------------------------------------------------------------------} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- I'm currently trying to translate this code https://github.com/bernstein/breakout/blob/master/src/ReactiveUtils.hs | |
-- to use linear package instead of vector-space, and I'm not sure if I've understood diffE completely. | |
import Linear.Vector | |
import Reactive.Banana | |
type Time = Double | |
integral :: (Additive f, Num a) => Event t Time -> Behavior t (f a) | |
-> Behavior t (f a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
integral :: Additive a => Event t Time -> Behavior t a -> Behavior t a | |
integral t b = sumB $ (\v dt -> dt *^ v) <$> b <@> diffE t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Nexuiz version (formatted for humans) | |
set g_nexuizversion "2.1" | |
// Nexuiz version (formatted for machines) | |
// used to determine if a client version is compatible | |
// this doesn't have to be bumped with every release | |
// bump when clients become incompatible or any other perfectly good reason | |
// (e.g. game data incompatibility, engine version incompatibility, etc | |
// note: this automatically filters the server browser, clients of the new | |
// version won't see old servers, and clients of the old version won't see new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Hell | |
import DotHellRC | |
main = startHell def { configImports = "import DotHellRC" : configImports def } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: dothellrc | |
version: 0.1.0.0 | |
synopsis: My personal ".hellrc" | |
license: WTFPL | |
license-file: COPYING | |
author: Karl-Oskar "klrr" Rikås | |
maintainer: karloskarrikaas@gmail.com | |
copyright: (C) 2013, Karl-Oskar Rikås | |
category: System | |
build-type: Simple |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- some stuff taken from ocharle's SDL and netwire tutorial, https://github.com/ocharles/ocharles.org.uk--Getting-Started-with-Netwire-and-SDL/blob/master/Challenge3.hs | |
{-# LANGUAGE StandaloneDeriving #-} | |
import Data.Word (Word16) | |
import Data.Set (Set) | |
import qualified Data.Set as Set | |
import qualified Graphics.UI.SDL as SDL | |
import Reactive.Banana | |
import Reactive.Banana.Frameworks | |
main = do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Bits | |
import Data.Word | |
import Data.IORef | |
import qualified Graphics.UI.SDL as SDL | |
import qualified Graphics.UI.SDL.Primitives as SDL | |
main = do | |
SDL.init [SDL.InitEverything] | |
SDL.setVideoMode 640 480 32 [] | |
var <- newIORef (0, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Data.Bits | |
import Data.Word | |
import Data.IORef | |
import qualified Graphics.UI.SDL as SDL | |
import qualified Graphics.UI.SDL.Primitives as SDL | |
main = do | |
SDL.init [SDL.InitEverything] | |
SDL.setVideoMode 640 480 32 [] | |
var <- newIORef (0, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Graphics.UI.SDL as SDL | |
import qualified Graphics.UI.SDL.Primitives as SDL | |
main = do | |
SDL.init [SDL.InitEverything] | |
SDL.setVideoMode 640 480 32 [] >>= loop | |
loop screen = do | |
SDL.rectangle screen (SDL.Rect 50 50 100 100) (SDL.Pixel 101) | |
SDL.flip screen |