Refactor lighting shaders
This commit is contained in:
+4
-9
@@ -48,7 +48,6 @@ setupLoop
|
||||
initParams
|
||||
paramCleanup
|
||||
$ doLoop window startWorld sideEffects eventFn worldFn
|
||||
|
||||
-- | The internal loop.
|
||||
doLoop
|
||||
:: Window -- ^ The SDL window.
|
||||
@@ -81,7 +80,6 @@ doLoop
|
||||
|
||||
doLoop window updatedWorld worldSideEffects eventFn worldUpdate newParams
|
||||
Nothing -> return ()
|
||||
|
||||
-- | Handle quit events in a manner to exit the loop. Other events handled as
|
||||
-- determined by the custom function, although resize events also change the viewport.
|
||||
applyEventIO :: (world -> Event -> Maybe world) -> Maybe world -> Event -> IO (Maybe world)
|
||||
@@ -91,16 +89,13 @@ applyEventIO fn mw e = case eventPayload e of
|
||||
WindowSizeChangedEvent WindowSizeChangedEventData {windowSizeChangedEventSize = V2 x y}
|
||||
-> GL.viewport $= (GL.Position 0 0,GL.Size x y) >> return (mw >>= \w -> fn w e)
|
||||
_ -> return $ mw >>= flip fn e
|
||||
|
||||
-- | Create an OpenGL SDL window configuration with a given x and y size.
|
||||
winConfig :: Int -> Int -> WindowConfig
|
||||
winConfig x y = defaultWindow
|
||||
{ windowGraphicsContext
|
||||
= OpenGLContext (defaultOpenGL { glProfile = Core Normal 4 3
|
||||
, glColorPrecision = V4 8 8 8 8
|
||||
}
|
||||
)
|
||||
{ windowGraphicsContext = OpenGLContext $ defaultOpenGL
|
||||
{ glProfile = Core Normal 4 3
|
||||
, glColorPrecision = V4 8 8 8 8
|
||||
}
|
||||
, windowInitialSize = V2 (fromIntegral x) (fromIntegral y)
|
||||
, windowResizable =True
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user