Coder Social home page Coder Social logo

tsdl-image's Introduction

Tsdl_image — SDL2_Image bindings for OCaml with Tsdl

Tsdl_image provides bindings to SDL2_Image intended to be used with Tsdl.

It has as siblings tsdl-mixer and tsdl-ttf.

Note that these bindings are at an early stage and have only been used minimally. The interface may change. Comments and bug reports are welcome through the github page or by emailing Julian Squires <[email protected]>.

Installation

Via opam:

opam install tsdl_image

Documentation

Documentation can be generated with ocamldoc, but the binding follows the SDL2_image interface closely, so it may be sufficient to consult its documentation.

tsdl-image's People

Contributors

chfi avatar tokenrove avatar zapashcanon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tsdl-image's Issues

setup.ml Fails to compile

Hi, I'm trying to install tsdl-image through opam, but it fails with a compiler error:

Output from opam:
(I've put a '.' in the beginning of each line to avoid interpretation as markdown)

.#=== ERROR while compiling tsdl-image.0.1 =====================================#
.# opam-version 1.3.0~dev3 (a8e79a514a790d4bf23810f1322f3af99971016e)
.# os linux
.# command ocaml setup.ml -build
.# path /home/finn/.opam/4.02.1/build/tsdl-image.0.1
.# exit-code 1
.# env-file /home/finn/.opam/4.02.1/build/tsdl-image.0.1/tsdl-image-22501-6d07ae.env
.# stdout-file /home/finn/.opam/4.02.1/build/tsdl-image.0.1/tsdl-image-22501-6d07ae.out
.# stderr-file /home/finn/.opam/4.02.1/build/tsdl-image.0.1/tsdl-image-22501-6d07ae.err
.### stdout ###
.# [...]
.# + /home/finn/.opam/4.02.1/bin/ocamlfind ocamlc -c -g -annot -bin-annot -I src -package ctypes -package tsdl -I test -I src -o test/test.cmo test/test.ml
.# File "test/test.ml", line 13, characters 6-16:
.# Warning 8: this pattern-matching is not exhaustive.
.# Here is an example of a value that is not matched:
.# None
.# File "test/test.ml", line 16, characters 2-34:
.# Error: This expression has type
.# Tsdl.Sdl.rw_ops Tsdl.Sdl.result =
.# (Tsdl.Sdl.rw_ops, [ Msg of string ]) Result.result .# but an expression was expected of type .# [<Error of string | `Ok of 'a ]
.# Command exited with code 2.
.### stderr ###
.# E: Failure("Command ''/home/finn/.opam/4.02.1/bin/ocamlbuild' src/tsdl_image.cma src/tsdl_image.cmxa src/tsdl_image.a src/tsdl_image.cmxs test/test.byte -tag debug' terminated with error code 10")

Opam package version (again)

Hello, and thank you for your work on tsdl-image and its siblings !

I was wondering if you could release the latest release to opam, since it's still the 0.1.2 0.2.0 there.
It would be nice to have the latest API and support. Also, with the current state of opam, the command you state on the README (using package name tsdl_image) does not work (wrong package name).

Cheers

opam package

Hi,

Contrary to what the README pretends, there doesn't seem to be an opam package? :p

– Armaël

EDIT: oh, but I guess @dbuenzli would need to do a new release of tsdl before.

error on toplevel: undefined symbol: IMG_Init

Compiling with tsdl_image works fine, but when using the toplevel I get this error
.opam/4.08.1/lib/stublibs/dllctypes-foreign-base_stubs.so: undefined symbol: IMG_Init

Full log is here:

 $ ocaml
        OCaml version 4.08.1

Findlib has been successfully loaded. Additional directives:
  #require "package";;      to load a package
  #list;;                   to list the available packages
  #camlp4o;;                to load camlp4 (standard syntax)
  #camlp4r;;                to load camlp4 (revised syntax)
  #predicates "p,q,...";;   to set these predicates
  Topfind.reset();;         to force that packages will be reloaded
  #thread;;                 to enable threads

# #require "tsdl";;
/home/san/.opam/4.08.1/lib/result: added to search path
/home/san/.opam/4.08.1/lib/result/result.cma: loaded
/home/san/.opam/4.08.1/lib/ocaml/unix.cma: loaded
/home/san/.opam/4.08.1/lib/ocaml/bigarray.cma: loaded
/home/san/.opam/4.08.1/lib/bytes: added to search path
/home/san/.opam/4.08.1/lib/integers: added to search path
/home/san/.opam/4.08.1/lib/integers/integers.cma: loaded
/home/san/.opam/4.08.1/lib/ctypes: added to search path
/home/san/.opam/4.08.1/lib/ctypes/ctypes.cma: loaded
/home/san/.opam/4.08.1/lib/ctypes/ctypes-top.cma: loaded
/home/san/.opam/4.08.1/lib/ctypes/ctypes-foreign-base.cma: loaded
/home/san/.opam/4.08.1/lib/ctypes/ctypes-foreign-unthreaded.cma: loaded
/home/san/.opam/4.08.1/lib/tsdl: added to search path
/home/san/.opam/4.08.1/lib/tsdl/tsdl.cma: loaded
# #require "tsdl_image";;
/home/san/.opam/4.08.1/lib/tsdl_image: added to search path
/home/san/.opam/4.08.1/lib/tsdl_image/tsdl_image.cma: loaded
Exception:
Dl.DL_error
 "/home/san/.opam/4.08.1/lib/stublibs/dllctypes-foreign-base_stubs.so: undefined symbol: IMG_Init".
# 


Use Result in API

We should use Result where appropriate in order to more closely match Tsdl's API, and to give more convenient access to error messages. Target Tsdl 0.9.* while we're at it.

License is missing

As the title reads, I could not find the license of this project.
I need it to know if I am allowed to use it since I had to modify the code to make it work with my compiler settings
(installing with Opam gave me a C stub error when open Tsdl_image, which I do not know how to fix without manually loading libSDL_image.so and overriding Foreign.foreign to use it)

Opam version of tsdl-image

I want to use tsdl-image but with tsdl 0.9.0 and it looks like you updated it to go well with this version but I can't install the 0.1.1 version because my tsdl version is too recent and I can't install the 0.1 version because there is a problem with the tests (everything according to OPAM).

What I did is cloning the project and compile it on my own and then make install and I have a nice tsdl-image.0.1.1 working with tsdl.0.9.

The only problem is I had some warnings :

+ /home/***/.opam/4.03.0/bin/ocamlfind ocamlopt -c -g -annot -bin-annot -package ctypes -package tsdl -I src -o src/tsdl_image.cmx src/tsdl_image.ml
File "_none_", line 1:
Warning 58: no cmx file was found in path for module Foreign, and its interface was not compiled with -opaque
+ /home/***/.opam/4.03.0/bin/ocamlfind ocamlc -c -g -annot -bin-annot -I src -package ctypes -package result -package tsdl -I test -I src -o test/test.cmo test/test.ml
File "test/test.ml", line 14, characters 6-16:
Warning 8: this pattern-matching is not exhaustive.

And when I do ./test.byte I have this error :

Fatal error: exception File "test/test.ml", line 14, characters 6-11: Pattern matching failed```

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.