dylan changed the topic of #ocaml to: OCaml 3.09.1 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
Raziel has quit [Read error: 110 (Connection timed out)]
_fab has quit [Remote closed the connection]
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
malc_ has quit ["leaving"]
Raziel has joined #ocaml
vezenchio has quit ["\\o sora wa hate shinai, kokoro no kagami dakara ne \o/ mainichi iro wo kaeteku utsushidasu you ni o//"]
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
khaladan has joined #ocaml
khaladan has quit [" HydraIRC -> http://www.hydrairc.com <- IRC with a difference"]
khaladan has joined #ocaml
khaladan has quit [Client Quit]
khaladan has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
Smerdyakov has joined #ocaml
MisterC has joined #ocaml
Skal has quit [Read error: 110 (Connection timed out)]
<flux__> there was this some lex/yacc-replacement for ocaml (replacing ocaml's ocamllex (maybe) and ocamlyacc) with more advanced features, does anyone happen to remember a pointer to it?
<flux__> I can't seem to be able to find it..
Smerdyakov has quit ["Leaving"]
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
<flux__> hmm, it may have been this: http://www.cis.upenn.edu/~stse/javac/
<flux__> (when I figured I needed to find for lr(1) ocaml, things begun to pop up ;))
<flux__> s/find/search/
<flux__> hmm.. reverse polish notation is something that is difficult to express with ocaml's yacc, right?
backstab has joined #ocaml
backstab has left #ocaml []
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
descender has quit [Read error: 110 (Connection timed out)]
descender has joined #ocaml
<flux__> let's say I have a background thread that calls a provided notification function whenever it retrieves communication
<flux__> and the provided callback function uses Event.sync (Event.send.. ) to send back messages to me
<flux__> at some point I decide that I want to discard all the remaining messages and terminate
<flux__> how should I go about doing that?
<flux__> the background thread may be blocked on my Event.sync when I make that decision.. ok, so I could maybe rewrite that as Event.select [Event.send ..; Event.receive abort_info]..
<flux__> hmm.. infact if I just assume there is only one thread doing the job, that combined with updating a mutable variable that says not to send any further messages could work
<flux__> hey, thanks you guys :)
<flux__> well, I got it working, but it's very complex :/
<flux__> and theoretically it can still lock up
<flux__> there should be a Event.wait_condition or something
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
_fab has joined #ocaml
<flux__> maybe Event just isn't so convenient when used with asynchronous events.. I can't think of a way to get rid of that lockup.
khaladan has quit [" bye."]
vodka-goo has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
Schmurtz has quit [Read error: 110 (Connection timed out)]
_fab has quit [Read error: 104 (Connection reset by peer)]
_fab has joined #ocaml
m3ga has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
Schmurtz has joined #ocaml
rillig has joined #ocaml
malc_ has joined #ocaml
<flux__> I actually finally solved that by making the decision to exit in the asynchronous notification function.. but I'm not sure if I'm pleased with this solution :)
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
zigong has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
Smerdyakov has joined #ocaml
vezenchio has joined #ocaml
Yorick has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
zigong has quit [Read error: 110 (Connection timed out)]
batdog has joined #ocaml
zigong has joined #ocaml
batdog is now known as batdog|gone
vodka-goo has quit ["Leaving"]
Snark has joined #ocaml
batdog|gone is now known as batdog
batdog is now known as batdog|gone
__DL__ has joined #ocaml
zigong has quit ["using sirc version 2.211+KSIRC/1.3.12"]
batdog|gone is now known as batdog
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
_JusSx_ has joined #ocaml
MisterC has quit [Remote closed the connection]
Revision17 has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
zigong has joined #ocaml
zigong has left #ocaml []
smimou has joined #ocaml
Revision17 has quit [Remote closed the connection]
khaladan has joined #ocaml
rillig_ has joined #ocaml
vodka-goo has joined #ocaml
rillig has quit [Read error: 110 (Connection timed out)]
desp has joined #ocaml
<desp> hello
<desp> does anyone here have some experience with using OpenGL in OCaml?
<malc_> yes
<desp> malc_: I'm trying to display a textured quad, and I can't get the texture to show up
<desp> all I get is a colored quad, if I specify a color, or a white quad.
<malc_> what it has to do with OCaml?
<malc_> anyhow have you enabled texturing?
<desp> well, I'm using the OCaml lablGL bindings
<malc_> your question is about opengl. not ocaml or lablgl
<flux__> I think there was a book on opengl available online
<desp> yes, I have enabled texturing.
<desp> and I followed a NeHe tutorial on texturing, as well
Yorick has quit ["nu fåre va nog"]
<desp> I'm fairly certain the problem is with the way I load the texture
<erik> is ocaml opengl still all state-machiney?
<erik> or is it nice
<desp> I was unable to find an easy way to load an image, so I coded my own function to read a simple image format
<malc_> desp: have you bound the texture?
<desp> yes, I have. please, look at the paste.
<malc_> yes looking
<desp> it's really short
<desp> perhaps you could suggest a simpler way of loading an image?
<desp> I found some OCaml bindings for ImageMagick, but I was unable to get them to work
<malc_> i just cooked my own
<desp> ah
<desp> well, I tried to do that as well, but I'm unable to verify if the image loading function works properly without a way to display the image
<malc_> desp: glDrawPixels..
<malc_> maybe the alpha is off?
<desp> oh, right. forgot about that function, I'll try that
<desp> what do you mean about alpha being off?
<malc_> well if it's 1.0 for all texels then your image will be completely transparent
<malc_> and you wont see it
<desp> right
<malc_> are those raw pictures available from somewhere?
<desp> the format is big endian { long width; long height; long* rgba; }
<desp> the width and height get read properly by my function
<desp> I'll see if glDrawPixels works in a moment...
mauke has quit [Remote closed the connection]
<desp> okay
mauke has joined #ocaml
<desp> almost
<malc_> desp: btw
<malc_> GL_INVALID_OPERATION is generated if glBindTexture is executed between the
<malc_> execution of glBegin and the corresponding execution of glEnd.
<malc_> and that's what you are doing
<malc_> not that your porblems stop there
<desp> oh. thanks, didn't know that
<desp> the main problem appears to be with loading into a too-big buffer
<desp> I thought that OpenGL was able to handle textures with a non-power-of-2 size
<malc_> set your tex parameters right
<malc_> only with npo2 extension
<desp> what do you mean about the tex parameters?
<malc_> GlPix.store stuff
<malc_> GlTex.env
<desp> could you elaborate a bit more?
<desp> I set GlTex.env (`mode `decal) now, but I have no idea about GlPix.store
<malc_> not really, been years since i touched this
<desp> okay
<malc_> GlPix.store says how your data is organized in image
<malc_> pitches and stuff like that
<desp> ah-ha!
<desp> this way the loading works fine, and the image is displayed correctly using GlPix.draw
batdog has quit [Read error: 110 (Connection timed out)]
<malc_> i'd recommend creating a string of length 4 and putting the bytes there, then pushing it with sets_string
<desp> one thing -- GlPix.draw seems to disregard any alpha values
<malc_> enable alpha
<desp> do you mean Gl.enable `alpha_test ?
<malc_> something like that
totolapino has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
<desp> ah, a blend function.
<desp> okay. thanks for your help!
<malc_> np
__DL__ has quit ["Bye Bye"]
_JusSx_ has quit ["leaving"]
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
desp has quit []
Thas has joined #ocaml
<Thas> Good morning..
* Thas has a question
<Thas> Is it possible to define a structure that contains a function which returns instances of that same structure type, in ocaml?
<smimou> 23:46 is rather late for me... :)
<zmdkrbou> rhooo smimou :)
<zmdkrbou> Thas: yep
<Thas> zmdkrbou : How? I can't figure it out?
<zmdkrbou> what do you mean by "structure" ? a record ?
<smimou> smth like type t = Test of (unit -> t)
<smimou> ?
<Thas> A record, yes.
<zmdkrbou> type t = { f : int -> t }
<dylan> type pants = { this: int; more_pants: (int -> pants) } let rec mystic_pants i = { this = i; more_pants = mystic_pants } ?
<Thas> I see.
<Thas> Thanks, I'm not sure why I didn't see it before. That's rather obvious once it's pointed out.
<totolapino> Hi, this is an error that I don't understand :
<totolapino> This expression has type float array * int * int but is here used with type [< `A of float array * int * int | `AA of float array array | `M of Gsl_matrix.matrix | `MF of Gsl_matrix_flat.matrix ] :
<totolapino> array * int * int is one of the different choices, so where's my error ?
<zmdkrbou> you have to use a constructor
<zmdkrbou> if you wrote (my_array,my_int1,my_int2), write `A (my_array,my_int1,my_int2)
<totolapino> Okay, Thanks a lot
Snark has quit ["Leaving"]
totolapino has quit []
mauke has quit [Remote closed the connection]
mauke has joined #ocaml