From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 8BFBB7F707 for ; Wed, 18 Dec 2013 10:24:24 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=pra; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=mailfrom; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.webfaction.com) identity=helo; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="postmaster@smtp.webfaction.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYBAAlpsVJKN1ZKnGdsb2JhbABZg0KDWLUQT4EqDgEBAQEBBg0JCRQogiUBAQEDASMEUgULCxoCJgICRxAGG4d0CAQJsGeYehMEgSmLb4FHMweCbjWBEwSeRBeOew X-IPAS-Result: ArYBAAlpsVJKN1ZKnGdsb2JhbABZg0KDWLUQT4EqDgEBAQEBBg0JCRQogiUBAQEDASMEUgULCxoCJgICRxAGG4d0CAQJsGeYehMEgSmLb4FHMweCbjWBEwSeRBeOew X-IronPort-AV: E=Sophos;i="4.95,506,1384297200"; d="scan'208";a="41542437" Received: from mail6.webfaction.com (HELO smtp.webfaction.com) ([74.55.86.74]) by mail3-smtp-sop.national.inria.fr with ESMTP; 18 Dec 2013 10:24:23 +0100 Received: from [172.20.10.2] (138-225.197-178.cust.bluewin.ch [178.197.225.138]) by smtp.webfaction.com (Postfix) with ESMTP id D3C582246244; Wed, 18 Dec 2013 09:24:20 +0000 (UTC) Date: Wed, 18 Dec 2013 10:24:19 +0100 From: =?utf-8?Q?Daniel_B=C3=BCnzli?= To: Anthony Tavener Cc: Erkki Seppala , caml-list@yquem.inria.fr Message-ID: <24E11676189B4F25A051C7EB1F4E6B6B@erratique.ch> In-Reply-To: References: <4DDEBB7487B641C0834F09D522EA9918@erratique.ch> X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Re: [Caml-list] SDL2 bindings, testers and feedback welcome Le mercredi, 18 d=C3=A9cembre 2013 =C3=A0 09:05, Anthony Tavener a =C3=A9cr= it : > Something I'm not so keen on is that event types and event values aren't > constants I can pattern match on, so I have a lot of "| t when t =3D "... >=20=20 > method process_event ev =3D > match Sdl.Event.(get ev typ) with=20=20 > | t when t =3D Sdl.Event.key_down -> > begin match Sdl.Event.(get ev keyboard_scancode) with > | t when t =3D Sdl.Scancode.s -> thrustp <- {thrustp with z =3D 1.}; true > | t when t =3D Sdl.Scancode.w -> thrustn <- {thrustn with z =3D 1.}; true >=20=20 > These are matchable constants in sdlcaml.=20=20 Actually that's something in the TODO: https://github.com/dbuenzli/tsdl/blob/master/TODO.md I don't think it's useful to convert let's say Sdl.Init enumerants to varia= nts as those are mainly used for setting up state and less likely to be pat= tern matched upon. But at least functions from Sdl.{scancode,keycode} to an= polymorphic variant will be added. Feel free to make your desire more prec= ise in the issue tracker.=20=20 > With Tsdl, the constants are brought in=20=20 > as let-bindings... looks like Daniel has something nifty to make this a l= ot easier > but I haven't looked into it yet. Not so nifty, you still have to enumerate them. A C program outputs them, t= hat's here: https://github.com/dbuenzli/tsdl/blob/master/support/consts_stub.c =20=20 > Next is figuring out why my game controller isn't detected, and maybe plu= gging in > a joystick and another kind of controller too. First, time for some sleep= . :) Just want to mention that if you are not sure whether the problem lies in t= he binding or in SDL itself there's a minimal C example with compilation in= structions that you can use to try to reproduce the problem in: cd `opam co= nfig var tsdl:doc` Best, Daniel=20=20