Coder Social home page Coder Social logo

apirogov / sdl2-cairo Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 3.0 36 KB

Haskell library providing functions to use Cairo to draw on SDL textures and containing a Processing-style convenience drawing API.

License: MIT License

Haskell 55.16% Shell 44.84%

sdl2-cairo's People

Contributors

apirogov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sdl2-cairo's Issues

Using SDL.Cairo.Canvas without SDL

The Canvas processing style API is wonderful for creating drawings, and it seems to be exactly what I need. However, after some deliberation I've decided to use gi-gtk in my application rather than SDL, but I would like to keep using your Canvas style API for drawing. If the SDL.Cairo.Canvas module would export a function that maps a 'Canvas a' into a 'Render a' this would be possible. Would you be open for such a change?

I implemented those changes in my local fork (https://github.com/noinia/sdl2-cairo). In particular, I

  1. added and exported the functions withCairoSurface, withRenderer that did most of the work that was previously in 'withCanvas'
  2. removed the 'csSurface' field in CanvasState, and used 'Graphics.Rendering.Cairo.withTargetSurface' to implement 'blend' and 'grab' instead (gi-gtk doesn't know about cairo Surfaces, and hence I needed everything to be in the Render monad itself (see here for an example of how this is used)

I can send a pull request if you want. I guess ideally there would also be a flag to disable the dependency on SDL all together (/have the Canvas stuff in its own package or so). But for now I would already be happy to be able to use the Canvas stuff in gi-gtk :).

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.