Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Haskell or Ocaml with OpenGL and SDL precompiled distribution for Windows

I want to learn Ocaml or Haskell and I want to do it by writing a simple game. Apparently, there's one small problem: nobody cares about Windows and I want to do it on Windows, natively.

Haskell has Cabal, which has SDL, but it doesn't build due to a trivial problem with no workarounds (order of parameters passed to gcc). Ocaml doesn't even have that, it's all in source packages, be it GLCaml or OcamlSDL or whatever.

Is there a place where I can get a working SDL for Haskell or Ocaml on Windows without fighting with a dozen versions of compilers?

like image 656
Baczek Avatar asked Aug 01 '10 10:08

Baczek


People also ask

How to add SDL to the OpenGL library?

And now, you want to go to SDL in the OpenGL folder. Select include and then click on the Select Folder button. Repeat the same process for including GLEW files. Once both the files have been included, click on the OK button. Now, again in the Property Pages window, we'll go to Linker | General, and then go to Additional Library Directories.

What is hssdl2 and SDL2 in Haskell?

The Haskell packages hsSDL2 and sdl2 are bindings to the C library libSDL Simple DirectMedia Layer (SDL) is a cross-platform, free and open source software multimedia library written in C, that presents a simple interface to various platforms' graphics, sound, and input devices.

How does OCaml compare to Haskell?

If Haskell is a niche language, then OCaml is a super-niche language. The OCaml community is much smaller. Where Haskell is doing more-or-less fine with libraries, OCaml has significantly less to propose.

What is SDL in C programming?

SDL stands for Simple DirectMedia Layer, and it allows us to create a render window and provides access to input devices through OpenGL. SDL is prominently used to code games and other media applications that run on various operating systems. It's a cross-platform multimedia library written in the C language.


2 Answers

The Haskell Platform comes with a binding to OpenGL which should work out of the box on Windows.

Concerning the SDL package on hackage, you can use cabal unpack SDL to get the source code and fix things yourself. To install the package with your changes, run cabal install in the unpacked directory. In any case, drop a line to the maintainer, I'm sure he'll help out.

like image 106
Heinrich Apfelmus Avatar answered Oct 19 '22 17:10

Heinrich Apfelmus


It's not related to SDL, but you've mentioned OpenGL. There is LablGL binding for OpenGL in OCaml which works out of the box. Wiki example (http://en.wikipedia.org/wiki/Objective_Caml#Triangle_.28graphics.29) compiles and works just fine.

like image 1
baltazar Avatar answered Oct 19 '22 18:10

baltazar