diff --git a/assets/spheres/smallsphere.obj b/assets/spheres/smallsphere.obj index 2ae1d6c..54e72b6 100644 --- a/assets/spheres/smallsphere.obj +++ b/assets/spheres/smallsphere.obj @@ -1,7 +1,5 @@ # Blender v2.79 (sub 0) OBJ File: 'smallsphere.blend' # www.blender.org -mtllib smallsphere.mtl -o Icosphere v 0.000000 -1.000000 0.000000 v 0.723600 -0.447215 0.525720 v -0.276385 -0.447215 0.850640 @@ -34,7 +32,6 @@ vn -0.1876 0.7947 0.5774 vn -0.6071 0.7947 0.0000 vn -0.1876 0.7947 -0.5774 vn 0.4911 0.7947 -0.3568 -usemtl None s off f 1//1 2//1 3//1 f 2//2 1//2 6//2 diff --git a/examples/example00/Main.hs b/examples/example00/Main.hs index 6fca0a0..bb648d4 100644 --- a/examples/example00/Main.hs +++ b/examples/example00/Main.hs @@ -39,7 +39,7 @@ main = } , initScreenMode = SDL.Fullscreen , preLoop = return () - , eventLoop = handle + , eventLoop = mapM_ handle , updateLoop = update , drawLoop = draw , loadState = load diff --git a/examples/example01/Main.hs b/examples/example01/Main.hs index df79e5a..a1ea375 100644 --- a/examples/example01/Main.hs +++ b/examples/example01/Main.hs @@ -39,7 +39,7 @@ main = } , initScreenMode = SDL.Fullscreen , preLoop = return () - , eventLoop = handle + , eventLoop = mapM_ handle , updateLoop = update , drawLoop = draw , loadState = load diff --git a/examples/example02/Init.hs b/examples/example02/Init.hs index 2c47595..aa9f157 100644 --- a/examples/example02/Init.hs +++ b/examples/example02/Init.hs @@ -39,7 +39,7 @@ genVertBufObject path = do GL.bindBuffer GL.ArrayBuffer $= Just verts withArray (loTriangles lobj) $ \ptr -> GL.bufferData GL.ArrayBuffer $= - ( fromIntegral $ length (loTriangles lobj) * 3 * sizeOf (0 :: Double) + ( fromIntegral $ length (loTriangles lobj) * sizeOf (0 :: Float) , ptr , GL.StaticDraw ) @@ -48,6 +48,8 @@ genVertBufObject path = do , GL.VertexArrayDescriptor 4 GL.Float 0 (plusPtr nullPtr 0) ) GL.vertexAttribArray (GL.AttribLocation 0) $= GL.Enabled + GL.bindBuffer GL.ArrayBuffer $= Nothing + GL.bindVertexArrayObject $= Nothing return (shipBO, length (loTriangles lobj)) load :: IO StateData @@ -72,7 +74,7 @@ load = do fragmentShader = foldl BS.append BS.empty [ "varying vec2 f_texcoord;" , "void main(void) {" - , " gl_FragColor = vec4(1,1,1,0.5);" + , " gl_FragColor = vec4(1.0,1.0,1.0,1.0);" , "}" ] p <- GLU.simpleShaderProgramBS vertexShader fragmentShader diff --git a/examples/example02/Main.hs b/examples/example02/Main.hs index a351020..1e314b6 100644 --- a/examples/example02/Main.hs +++ b/examples/example02/Main.hs @@ -34,12 +34,12 @@ main = , windowConfig = SDL.defaultWindow { SDL.windowInitialSize = SDL.V2 1600 900 , SDL.windowOpenGL = Just SDL.defaultOpenGL - { SDL.glProfile = SDL.Core SDL.Normal 3 2 + { SDL.glProfile = SDL.Core SDL.Normal 3 0 } } , initScreenMode = SDL.Fullscreen , preLoop = return () - , eventLoop = handle + , eventLoop = mapM_ handle , updateLoop = update , drawLoop = draw , loadState = load diff --git a/examples/example02/Util.hs b/examples/example02/Util.hs index 91bfac5..b24af65 100644 --- a/examples/example02/Util.hs +++ b/examples/example02/Util.hs @@ -23,7 +23,7 @@ loadObj obj = lns = map elValue (V.toList $ objLines obj) points = map elValue (V.toList $ objPoints obj) deface (Face a b c []) = - map (\i -> inter V.! (faceLocIndex i -1)) [a, b, c] + map (\i -> inter V.! (faceLocIndex i - 1)) [a, b, c] deface _ = error "loadObj: obj with quads encountered" deline (Line a b) = diff --git a/examples/example03/Main.hs b/examples/example03/Main.hs index 624714b..667378c 100644 --- a/examples/example03/Main.hs +++ b/examples/example03/Main.hs @@ -70,7 +70,7 @@ main = do } , initScreenMode = SDL.Fullscreen , preLoop = return () - , eventLoop = handle + , eventLoop = mapM_ handle , updateLoop = update , drawLoop = draw (width o) (height o) , loadState = load (width o) (height o) diff --git a/hw.cabal b/hw.cabal index 1af69eb..00e179a 100644 --- a/hw.cabal +++ b/hw.cabal @@ -137,7 +137,7 @@ executable example02 , GLUtil , random , vector - , wavefront + , wavefront >= 0.7.1.2 , shoot hs-source-dirs: examples/example02 default-language: Haskell2010 diff --git a/notes/techtree.braindump b/notes/techtree.braindump index 3359564..8fb2eb4 100644 --- a/notes/techtree.braindump +++ b/notes/techtree.braindump @@ -6,3 +6,28 @@ research only in single player mode Gather resources in multiplayer mode to spend them on for (very expensive) research in singleplayer mode + +## FTL technology + +### Warp + +Continuous drive, requires negative energy, rather stealthy + +### Slingshot + +Discrete drive, not stealthy at all, nomen est omen +ship gets accellerated to near lightspeed by internal means. Because of photons +"reflecting" from the ship it generate a characteristic radiation pattern, which +can be observed far and wide. + +### Jump drive + +Discrete drive, computation heavy, can be unreliable at targeting + +### Gateways + +Discrete drive, needs specialized structures/stations + +### Tachyon sails + +Continuous drive diff --git a/src/Main.hs b/src/Main.hs index 6b1baaa..9ef6d76 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -39,7 +39,7 @@ main = } , initScreenMode = SDL.Fullscreen , preLoop = return () - , eventLoop = handle + , eventLoop = mapM_ handle , updateLoop = update , drawLoop = draw , loadState = load