• Stars
    star
    147
  • Rank 243,468 (Top 5 %)
  • Language
    Haskell
  • Created over 10 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

an attempt to create a concise modern Haskell OpenGL boilerplate with basic IO

Build Status

Haskell-OpenGL-Tutorial

an attempt to create a concise modern Haskell OpenGL boilerplate with basic IO among other things...

MandelbrotYampa

A simple OpenGL application, using FRP.Yampa to handle animation and user events, SDL2 for managing windows and input, stack as a build system.

windows and input: SDL2  
shader uniforms  : +  
frp              : Yampa

Output:

Animated Output:




A GLFW Boilerplate

An OpenGL template:

windows and input: GLFW  
shader uniforms  : -




A GLFW Boilerplate with Mandelbrot shader

windows and input: GLFW  
shader uniforms  : +




A SDL2 Boilerplate with Mandelbrot shader

windows and input: SDL2  
shader uniforms  : +




HelloWindow

A Hello Window OpenGL application with stack as a build system.

Output:




Transformations

A simple OpenGL application, drawing a polygon with texture blending, transformed by GLMatrix, using element buffer, with stack as a build system.

Output:




Basic Hellow Window




A Hello Window, with basic input callbacks.




Drawing 2 triangles




Drawing 2 textured triangles




A colored triangle




Sugarizing the interface with polymorphic functions.

module Main where

import NGL.Shape
import NGL.Rendering

main :: IO ()
main = do
     let drawables = [toDrawable Red     $ Square (-0.5, -0.5) 1.0,
                      toDrawable Green   $ Circle (0.5, 0.5) 0.5 100,
                      toDrawable Blue    $ Rect (-1.0,0.33) (0.0,0.66),
                      toDrawable White   $ Polyline [ (0.0,-0.66)
                                                     ,(0.33,-0.33)
                                                     ,(0.66,-0.66)
                                                     ,(1.0,-0.33)] 
                                                       0.01 
                     ]

     window <- createWindow "NGL is Not GLoss" (512,512)
     drawIn Default window drawables
     closeWindow window