profile
viewpoint

benkard/cellspp 24

A simple dataflow library for C++.

benkard/cljssss-g 3

The Gödel-Gentzen Clojure Syndication Services Super System, CljSSSS^g.

benkard/mulkyid 2

Mulky IMAP BrowserID Primary

benkard/cl-bench 1

A fork of cl-bench for testing sb-eval2.

benkard/fibers 1

Continuation-based fibers for Scala

benkard/foafssl-java 1

FOAF+SSL Java libraries

benkard/admin-template 0

JSF responsive admin template based on Bootstrap and AdminLTE

benkard/amethyst-rhusics 0

A bridge between Amethyst and rhusics

benkard/btrfs-progs 0

Development of userspace BTRFS tools

benkard/cilium 0

API Aware Networking and Security using BPF and XDP

startedRatRanch/Apple-Newton-Keyboard-USB-Adapter

started time in 4 days

startedjanezpodhostnik/flow-py-sdk

started time in 6 days

fork andreasabel/palmgren-archive

Research material of Erik Palmgren (1963–2019)

fork in 12 days

MemberEvent

fork andreasabel/hpack

hpack: A modern format for Haskell packages

fork in 23 days

MemberEvent

push eventbenl23x5/gloss

Ben Lippmeier

commit sha d0a456fd36bd854b6333b769e39fd4969ffc32c0

bump versions

view details

push time in 24 days

push eventbenl23x5/gloss

Jonathan Merritt

commit sha d3dd6d7dc4bde5629bb9218e4ee6fa5ea08582b1

Resurrect GLFW and fix HiDPI issues - Removed ExplicitBackend Cabal flag. It didn't do anything. The functionality it was supposed to provide can be added again later if necessary. Backend switching to GLFW can now be accomplished by setting BOTH flags: GLFW -GLUT. eg: stack build --flag gloss:GLFW --flag gloss:-GLUT - Moved the ability to get the full screen size into the backend. This was previously using GLUT for that purpose, despite a different code path setting the window size when a fullscreen window was finally created by GLFW. - Fixed the HiDPI issue by setting the OpenGL viewport prior to each drawing call. - Fixed various issues with existing GLFW backend: - Apps would exit immediately because GLFW.windowShouldClose was being used incorrectly. - OpenGL drawing with GLFW was failing because there was no current context. - A lifecycle problem meant that GLFW was still trying to draw after the window had been closed. Now GLFW.setWindowShouldClose is used to flag this condition, and GLFW.terminate is called at the very end of the main loop as recommended by GLFW.

view details

Jonathan Merritt

commit sha 64d8f1a88d3133f1b4131346495dc6b2de5ad70c

Improve runMainLoopGLFW

view details

Jonathan Merritt

commit sha 4df890e4b764a53f2cb32e38e95aa4d515f80651

Enable v-sync for GLFW - Requires a buffer swap each frame, and consequently a draw per frame.

view details

Ben Lippmeier

commit sha fd3a1a04be3e1c77c1245c059c3c55c7a3820214

Merge pull request #46 from lancelet/miscen-fixen Resurrect GLFW and fix HiDPI issues

view details

push time in 24 days

PR merged benl23x5/gloss

Resurrect GLFW and fix HiDPI issues
  • Removed ExplicitBackend Cabal flag. It didn't do anything. The functionality it was supposed to provide can be added again later if necessary. Backend switching to GLFW can now be accomplished by setting BOTH flags: GLFW -GLUT.

eg:

stack build --flag gloss:GLFW --flag gloss:-GLUT
  • Moved the ability to get the full screen size into the backend. This was previously using GLUT for that purpose, despite a different code path setting the window size when a fullscreen window was finally created by GLFW.

  • Fixed the HiDPI issue by setting the OpenGL viewport prior to each drawing call.

  • Fixed various issues with existing GLFW backend:

    • Apps would exit immediately because GLFW.windowShouldClose was being used incorrectly.
    • OpenGL drawing with GLFW was failing because there was no current context.
    • A lifecycle problem meant that GLFW was still trying to draw after the window had been closed. Now GLFW.setWindowShouldClose is used to flag this condition, and GLFW.terminate is called at the very end of the main loop as recommended by GLFW.
+153 -95

2 comments

10 changed files

lancelet

pr closed time in 24 days

startedcontao/contao

started time in a month

fork andreasabel/DATX05

Masters thesis project - Formally verified parser generator

fork in a month

startedsharplispers/log4cl

started time in a month

pull request commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

Hi @ad-si, I've created a branch of perspec and raised a PR with the changes so that you can see how it can be tested: https://github.com/ad-si/Perspec/pull/4

The short version is: just point stack at the head commit in the branch I raised this PR from. If I make any other changes though (eg. if Ben wants modifications, etc) and you want to test those, then you'll need to forward to the latest commit.

I'm not really sure how to do the same thing with Cabal. I gather there's a way, but hopefully stack is enough for you to be able to test.

lancelet

comment created time in a month

fork andreasabel/txt2tags

Convert plain text into many markup languages

https://txt2tags.org

fork in a month

pull request commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

Thanks a lot for giving this a shot 🙌. How can I compile https://github.com/ad-si/perspec with this branch? Hopefully it finally fixes the issues I'm having 😁

lancelet

comment created time in a month

Pull request review commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

 openWindowGLFW ref FullScreen         let sizeX = GLFW.videoModeWidth (fromJust vmode)         let sizeY = GLFW.videoModeHeight (fromJust vmode) -        win <- GLFW.createWindow +        win <- GLFW.createWindow

Definitely agree! 😁

lancelet

comment created time in a month

Pull request review commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

 callbackIdle stateRef callbacks   -- Main Loop -------------------------------------------------------------------runMainLoopGLFW-        :: IORef GLFWState-        -> IO () -runMainLoopGLFW stateRef- = X.catch go exit- where-  exit :: X.SomeException -> IO ()-  exit e = print e >> exitGLFW stateRef+runMainLoopGLFW :: IORef GLFWState -> IO ()+runMainLoopGLFW stateRef = do+        X.catch go handleException+        GLFW.destroyWindow =<< windowHandle stateRef+        GLFW.terminate++    where+        handleException :: X.SomeException -> IO ()+        handleException = print++        clearDirtyFlag :: IO ()+        clearDirtyFlag = modifyIORef'+                                stateRef+                                (\state -> state { dirtyScreen = False })++        whenDirty :: IO () -> IO ()+        whenDirty action = do+                dirty <- dirtyScreen <$> readIORef stateRef+                when dirty $ do+                        action+                        GLFW.swapBuffers =<< windowHandle stateRef

Hopefully it's not too on-the-nose to have swapBuffers called here. I thought the concept of "dirty" is pretty clearly going to result in a redraw in the Gloss context.

lancelet

comment created time in a month

Pull request review commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

 callbackDisplay stateRef callbacks         GL.clear [GL.ColorBuffer, GL.DepthBuffer]         GL.color $ GL.Color4 0 0 0 (1 :: GL.GLfloat) +        -- set the OpenGL viewport to account for any HiDPI discrepancy+        (width, height) <- windowHandle stateRef >>= GLFW.getFramebufferSize+        GL.viewport $= ( GL.Position 0 0+                       , GL.Size (fromIntegral width) (fromIntegral height))

Fix for the HiDPI problem.

lancelet

comment created time in a month

Pull request review commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

 runMainLoopGLFW stateRef    go   :: IO ()   go-   = +   =      do win <- windowHandle stateRef-        windowIsOpen <- GLFW.windowShouldClose win-        when windowIsOpen+        windowShouldClose <- GLFW.windowShouldClose win+        unless windowShouldClose

I don't know how this ever worked before.

lancelet

comment created time in a month

Pull request review commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

 Flag GLFW   Description:  Enable the GLFW backend   Default:      False -Flag ExplicitBackend-  Description:  Expose versions of 'display' and friends that allow-                you to choose what window manager backend to use.-  Default:      False-

I removed this. No idea why it was still there... I'm pretty sure (like 98% or something) that it's just not doing anything.

lancelet

comment created time in a month

Pull request review commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

 class Backend a where         -- | Function that returns (width,height) of the window in pixels.         getWindowDimensions        :: IORef a -> IO (Int,Int) +        -- | Function that returns (width,height) of a fullscreen window in pixels.+        getScreenSize              :: IORef a -> IO (Int,Int)

Now this is part of the backend type class.

Previously, with GLFW, we were asking GLUT for the screen size, but then, when GLFW created the window, GLFW set its own screen size. So different backends were doing different parts of the job.

I think that, conceptually, it's a back-end operation anyway.

lancelet

comment created time in a month

Pull request review commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

 class GLFWKey a where instance GLFWKey GLFW.Key where   fromGLFW key    = case key of-        GLFW.Key'A	     -> charToSpecial 'a'

GHC complains if you use tabs, so I got rid of these ones.

lancelet

comment created time in a month

Pull request review commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

 openWindowGLFW ref FullScreen         let sizeX = GLFW.videoModeWidth (fromJust vmode)         let sizeY = GLFW.videoModeHeight (fromJust vmode) -        win <- GLFW.createWindow +        win <- GLFW.createWindow

There are a few miscellaneous whitespace removals. My editor does that. I can raise a PR without them if necessary, but I think it's better to clear them out personally. 😄

lancelet

comment created time in a month

Pull request review commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

 glfwStateInit         , mouseWheelPos = 0         , dirtyScreen   = True         , display       = return ()-        , idle          = return () }+        , idle          = return ()+        , optWinHdl     = Nothing }

Previously this was un-initialized in the original struct. Again, modern ghc was complaining loudly about this.

lancelet

comment created time in a month

Pull request review commentbenl23x5/gloss

Resurrect GLFW and fix HiDPI issues

- -- | Snowflake Fractal. --      Based on ANUPlot code by Clem Baker-Finch. --+module Main where

I'm not 100% sure why, but modern cabal (although not stack) was complaining if there wasn't an explicit module declaration here.

lancelet

comment created time in a month

PR opened benl23x5/gloss

Resurrect GLFW and fix HiDPI issues
  • Removed ExplicitBackend Cabal flag. It didn't do anything. The functionality it was supposed to provide can be added again later if necessary. Backend switching to GLFW can now be accomplished by setting BOTH flags: GLFW -GLUT.

eg:

stack build --flag gloss:GLFW --flag gloss:-GLUT
  • Moved the ability to get the full screen size into the backend. This was previously using GLUT for that purpose, despite a different code path setting the window size when a fullscreen window was finally created by GLFW.

  • Fixed the HiDPI issue by setting the OpenGL viewport prior to each drawing call.

  • Fixed various issues with existing GLFW backend:

    • Apps would exit immediately because GLFW.windowShouldClose was being used incorrectly.
    • OpenGL drawing with GLFW was failing because there was no current context.
    • A lifecycle problem meant that GLFW was still trying to draw after the window had been closed. Now GLFW.setWindowShouldClose is used to flag this condition, and GLFW.terminate is called at the very end of the main loop as recommended by GLFW.
+113 -72

0 comment

10 changed files

pr created time in a month

startedasmjit/asmjit

started time in a month

startedavast/retdec

started time in a month

startedlifting-bits/mcsema

started time in a month

startedlifting-bits/remill

started time in a month

more