Giter Club home page Giter Club logo

reflex-glfw's Introduction

Pre-release NOTE

reflex-glfw awaits to be released on Hackage:

progress
https://github.com/deepfire/reflex-glfw/milestone/1
post issues here
https://github.com/deepfire/reflex-glfw/issues
general feedback here
#7

reflex-glfw

https://api.travis-ci.org/deepfire/reflex-glfw.svg?branch=master

What

reflex-glfw is an adapter between Reflex, a Haskell FRP framework and GLFW-b, a set of GLFW bindings.

Where

The home of reflex-glfw is at its Github page: https://github.com/deepfire/reflex-glfw

Reflex 0.5

reflex-glfw depends on a pre-release version of reflex, which means having to jump through extra hoops to use reflex-glfw.

Installing via Nix

By far the easiest and most reliable way to do this is to employ the Nix package manager, which, unless you already have it, has to be installed first, of course:

Building the demo

Once you have Nix installed, building the demo is as easy as:

# First, enter the fixed environment (NOTE: this can take a while):
nix-shell --no-build-output
# ..then, inside the shell:
cabal build
dist/build/reflex-glfw-demo/reflex-glfw-demo

libGL error: unable to load driver: XXX_dri.so

In case you happen upon #4, at least for nVidia GPUs there’s a semi-automated solution based on https://github.com/deepfire/nix-install-vendor-gl:

git clone https://github.com/deepfire/nix-install-vendor-gl
. ./nix-install-vendor-gl/nix-install-vendor-gl.sh

Screenshot

./screenshot.png

reflex-glfw's People

Contributors

deepfire avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

reflex-glfw's Issues

Pre-hackage-release feedback

Please, post here any feedback that you don't feel as warranting a separate issue of its own.

Feel free to post anything -- rants, gripes, wishes -- anything at all.

GLFW error callback doesn't appear to work, at least during GLFW init time

As an example, the reflex-glfw-demo is incompatible with OpenGL 3.3, so changing withGLWindow like this:

withGLWindow width height title f = do
     liftIO $ GL.setErrorCallback $ Just simpleErrorPrinter
+    liftIO $ GL.defaultWindowHints
+    liftIO $ mapM_ GL.windowHint
+      [ GL.WindowHint'ContextVersionMajor 3
+      , GL.WindowHint'ContextVersionMinor 3
+      , GL.WindowHint'OpenGLProfile GL.OpenGLProfile'Core
+      , GL.WindowHint'OpenGLForwardCompat True ]
     m <- liftIO $ GL.createWindow width height title Nothing Nothing

makes the demo fail obscurely, without invoking the error callback:

[nix-shell:~/src/reflex-glfw]$ cabal build && dist/build/reflex-glfw-demo/reflex-glfw-demo
Building reflex-glfw-0.1.0.0...
Preprocessing library reflex-glfw-0.1.0.0...
[1 of 1] Compiling Reflex.GLFW      ( src/Reflex/GLFW.hs, dist/build/Reflex/GLFW.o )
Preprocessing executable 'reflex-glfw-demo' for reflex-glfw-0.1.0.0...
Linking dist/build/reflex-glfw-demo/reflex-glfw-demo ...
reflex-glfw-demo: Prelude.head: empty list

A similar failure to invoke the handler can be observed if one fails to run Reflex.GLFW.init -- the error message is produced by withGLWindow itself, not the simpleErrorPrinter handler that is set up by the time of its invocation.

It is a bit mysterious..

pinned nixpkgs

On my 19.09-subscribed system, nix fails to install relfex-0.6 because it's broken. Could the repo pin a working nixpkgs commit to avoid such issues?

Package ‘reflex-0.6.2.4’ in /nix/store/1h469q2hg2hhafn8c3ydhixh9x3ci354-nixpkgs-19.09pre194448.8cc2b315143/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix:195658 is marked as broken, refusing to evaluate.

Demo build dependency failure: haskell-src-exts

I'm a total noob with nix, reflex and reflex-glfw (thanks for sharing). Following: nix-shell --no-build-output, I received a build error about a missing dependency:

Configuring reflex-0.5.0...
Setup: Encountered missing dependencies:
haskell-src-exts >=1.16 && <1.20

Hackage shows that package is currently at version 1.20.2. Is there an easy way for me to sort this or does this require a bump elsewhere?

GL setup failure on non-NixOS linuxen

Basically, it's an instance of NixOS/nixpkgs#9415, and manifests like this:

[nix-shell:~/src/reflex-glfw]$ cabal clean
cleaning...

[nix-shell:~/src/reflex-glfw]$ cabal build
Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
Resolving dependencies...
Configuring reflex-glfw-0.1.0.0...
Building reflex-glfw-0.1.0.0...
Preprocessing library reflex-glfw-0.1.0.0...
[1 of 1] Compiling Reflex.GLFW      ( src/Reflex/GLFW.hs, dist/build/Reflex/GLFW.o )
Preprocessing executable 'reflex-glfw-demo' for reflex-glfw-0.1.0.0...
[1 of 2] Compiling Gear             ( Gear.hs, dist/build/reflex-glfw-demo/reflex-glfw-demo-tmp/Gear.o )
[2 of 2] Compiling Main             ( Demo.hs, dist/build/reflex-glfw-demo/reflex-glfw-demo-tmp/Main.o )
Linking dist/build/reflex-glfw-demo/reflex-glfw-demo ...

[nix-shell:~/src/reflex-glfw]$ dist/build/reflex-glfw-demo/reflex-glfw-demo
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.