00:56
clog has joined #ocaml
01:21
kinners has joined #ocaml
01:41
salo has joined #ocaml
02:43
wreel has quit ["Leaving"]
02:43
wreel has joined #ocaml
02:43
kinners has quit ["leaving"]
02:44
salo has joined #ocaml
02:54
lodewijk has quit ["[BX] Yo quiero BitchX"]
03:17
ne1 has quit ["To understand recursion, you must first understand recursion."]
03:21
monochrom has joined #ocaml
03:22
wreel has quit ["Leaving"]
04:12
mrsolo has quit ["Leaving"]
04:28
CosmicRay has quit ["Client exiting"]
04:36
Faust has joined #ocaml
04:42
monochrom has quit ["hello"]
05:25
vezenchio has joined #ocaml
05:53
Faust has quit [Remote closed the connection]
06:10
solarwin1 has quit ["leaving"]
06:14
mrsolo has joined #ocaml
06:49
solarwind has joined #ocaml
07:04
mlh has quit [Client Quit]
07:12
Submarine has quit [Read error: 104 (Connection reset by peer)]
07:23
async_ has joined #ocaml
07:23
<
async_ >
Smerdyakov
07:34
pango_ has quit ["Client exiting"]
07:37
pango has joined #ocaml
07:39
mrsolo has quit ["Leaving"]
07:48
senko_ has joined #ocaml
07:50
skylan_ has joined #ocaml
08:06
senko_ has quit ["Leaving"]
08:10
skylan has quit [Client Quit]
08:19
senko has quit ["Leaving"]
08:40
async_ has quit ["leaving"]
08:41
mlh has joined #ocaml
09:12
moonfish` has joined #ocaml
09:28
moonfish has quit [Read error: 110 (Connection timed out)]
09:48
solarwind has quit [Read error: 60 (Operation timed out)]
09:55
smimou has joined #ocaml
09:57
lus|wazz has joined #ocaml
09:59
cmeme has quit [Connection timed out]
10:14
vezenchio has quit [Read error: 110 (Connection timed out)]
10:24
solarwind has joined #ocaml
10:44
moonfish` is now known as moonfish
11:21
gim has joined #ocaml
11:39
_fab has joined #ocaml
12:11
_fab has quit [Remote closed the connection]
12:20
karryall has joined #ocaml
12:48
_fab has joined #ocaml
12:50
blugleblogle has joined #ocaml
13:11
Faust79 has joined #ocaml
13:45
mlh has quit [Client Quit]
13:52
Demitar has joined #ocaml
14:06
senko has joined #ocaml
14:19
smimram has joined #ocaml
14:22
smimou has quit [Nick collision from services.]
14:22
smimram is now known as smimou
14:30
senko has quit ["Leaving"]
14:30
senko has joined #ocaml
14:51
srv_ has quit [Read error: 104 (Connection reset by peer)]
15:11
_fab has joined #ocaml
15:30
<
mrvn >
Is there a way to make an int array that isn't actualy an ref int array? 'Array.make size 0' makes an array of pointers all to the same 0 and thus .(1) <- 1 sets them all to 1.
15:32
Faust79 has quit [Read error: 104 (Connection reset by peer)]
15:34
<
mrvn >
Never mind, mea culpa. The outer array was the problem (the array of int arrays) and not the inner one.
15:34
<
karryall >
no, it doesn't
15:35
<
mrvn >
I should have used Array.make_matrix width height 0 I guess.
15:36
<
vincenz >
mrvn: or use init
15:36
<
mrvn >
I had code like this: # let m = Array.make 3 (Array.make 3 0);;
15:36
<
mrvn >
val m : int array array = [|[|0; 0; 0|]; [|0; 0; 0|]; [|0; 0; 0|]|]
15:36
<
mrvn >
# m.(0).(0) <- 1;;
15:36
<
mrvn >
- : unit = ()
15:36
<
mrvn >
- : int array array = [|[|1; 0; 0|]; [|1; 0; 0|]; [|1; 0; 0|]|]
15:36
<
vincenz >
Array.init width (fun x -> Array.init height (fun y -> if x == 0 then 1 else 1))
15:36
<
karryall >
yeah, make_matrix is what you need
15:36
<
mrvn >
Why is there no Array.init_matrix ?
15:37
<
karryall >
make_matrix is a very wrapper for Array.init
15:38
<
karryall >
just code your init_matrix function
15:38
<
vincenz >
let width = 3 in let height = 3 in Array.init width (fun x -> Array.init height (fun y -> if y = 0 then 1 else 0 ));;
15:39
<
vincenz >
switch width/height and x/y if you want semantically correct variable
15:40
<
mrvn >
karryall: It should be there so the matrix functions have the same capabilities as the normal ones.
15:41
<
mrvn >
let init_matrix w h f = Array.init w (fun x -> Array.init h (fun y -> f x y))
15:42
<
karryall >
it's not really useful. It's probably a remnant of Caml Light
15:43
<
vincenz >
mrvn: switch w and h
15:43
<
mrvn >
vincenz: why?
15:43
<
vincenz >
data is usually stored in row-major form
15:43
<
vincenz >
in most systems/languages at least
15:44
<
mrvn >
but then access has to switch x and y too.
15:44
<
vincenz >
and that's how it's usually done
15:45
<
vincenz >
in fact if one reads how matlabimplements matrices, they will ntocie that mat[x][y] in matlab translates to mat[y][x] in c
15:45
<
mrvn >
What I actualy need is a hexagonal grid of tiles.
15:45
<
vincenz >
hexanogal can be implemnented with square matrix
15:45
<
vincenz >
just that odd rows will have one value less
15:46
<
mrvn >
Or you shift each row by half a tile so they fit into a hex pattern.
15:46
<
vincenz >
that's what I meant
15:46
<
vincenz >
and that means that every other row will only need width-1 tiles
15:46
<
mrvn >
Gives you a trapez shape.
15:46
<
mrvn >
No, all rows the same size.
15:47
<
vincenz >
well 'rectangularly-shaped' area with hex-grids translates to a rectangularly'shaped matrix with every other row having one less element
15:49
<
vincenz >
yes but that gives you a skewed grid, not very useful
15:49
cmeme has joined #ocaml
15:50
<
mrvn >
That doesn't realy matter if you have a donut or cylindrical world
15:50
<
mrvn >
Or if skewed is ok.
15:50
<
vincenz >
what I meant was that you have a square-like world
15:50
<
vincenz >
(or rectangular)
15:50
<
vincenz >
but then with hex-tiles
15:52
vezenchio has joined #ocaml
15:52
<
mrvn >
Or that shape.
15:53
<
mrvn >
If you only move even rows half a tile in:
15:54
<
mrvn >
you get strange neighbourhoods for a tile.
15:54
<
vincenz >
yeah I know but usually you have a preset world (rectangular) and then the last diagram is the best to fill it amap
15:55
<
mrvn >
A lot of games use isometric view. Those can better use the middle one.
15:56
<
mrvn >
Settlers uses the skewed one. Leaves room for the map and icons on the screen.
15:57
<
vincenz >
what are you working on?
15:57
<
mrvn >
Do you know populous?
15:57
lus|wazz has quit [Read error: 60 (Operation timed out)]
16:02
<
vincenz >
nice game
16:04
<
mrvn >
I'm thinking of writing a clone with hex tiles. The paste buffer creates a trivial map.
16:08
wegzz has joined #ocaml
16:08
<
vincenz >
fully ocaml?
16:09
<
karryall >
Unix.sleep doesn't work well with Graphics
16:09
<
mrvn >
unless it becomes too slow.
16:09
<
mrvn >
I will need something for the GUI. Maybe lablgl.
16:10
<
mrvn >
Or I have to modify the Graphics module to give me left/right mouse buttons and mouse move events at least.
16:11
<
karryall >
lablgl ?
16:11
vezenchio has quit [Read error: 110 (Connection timed out)]
16:12
<
mrvn >
Description: Runtime libraries for lablgl
16:12
<
mrvn >
LablGL is an OpenGL interface for Objective Caml. Since it includes
16:12
<
mrvn >
support for the Togl widget, you can comfortably use it with LablTk.
16:12
<
mrvn >
A GtkGlarea binding for use with lablgtk is also provided.
16:12
<
mrvn >
This package include only the dynamic libraries needed for running dynamic
16:12
<
mrvn >
bytecode executables.
16:12
<
Smerdyakov >
Descripton: mrvn will spam the channel for you.
16:13
<
mrvn >
But using OpenGL for the rendering sounds like a good idea.
16:13
<
karryall >
sure but it does not address the GUI
16:14
<
karryall >
you'll have to use Tk or GTK
16:14
<
Smerdyakov >
I've made a GUI with OpenGL before!
16:14
<
Smerdyakov >
It's a shame if there isn't a standard one out there.
16:14
<
mrvn >
I can make one big texture for the background with the icons on it and then catch mouse clicks.
16:15
<
vincenz >
mrvn: go for lablgtk2
16:15
<
Smerdyakov >
You goofball.
16:15
<
Smerdyakov >
You can draw icons the same was as you draw 3D objects.
16:15
<
Smerdyakov >
And then you can use the click resolution functions of OpenGL to tell what was clicked.
16:15
<
Smerdyakov >
(I forget what the official name for "click resolution" is.)
16:16
<
vincenz >
who's the goofball?
16:16
<
Smerdyakov >
That's not "one big texture"!
16:16
<
Smerdyakov >
mrvn is a goofball!
16:16
<
vincenz >
just make multiple polygons
16:16
<
mrvn >
Can GL highlight points on a 3D object when the mouse hovers over it?
16:16
<
vincenz >
and map each with the correct texture
16:16
<
vincenz >
(much smaller textures)
16:16
<
vincenz >
mrvn: just move a lightsource
16:16
<
Smerdyakov >
mrvn, of course. You can detect where the mouse is and draw things differently.
16:16
<
mrvn >
Smerdyakov: I ment if GL can do it for me.
16:17
<
Smerdyakov >
OpenGL doesn't do anything "dynamic" whatsoever, does it?
16:17
<
mrvn >
Populous has a mouse cursor and then a dot on the grid of the map where a click would snap to currently.
16:17
<
mrvn >
I guess I have to make that dot a seperate object and move it myself.
16:18
<
vincenz >
mrvn: add some fog and then a point-light source (or a cone-lightsource)
16:18
<
Smerdyakov >
This isn't that complicated; it's the standard trick of animation.
16:18
<
Smerdyakov >
Draw things differently in different frames, based on outside clues.
16:18
<
Smerdyakov >
Whether or not this involves "objects" or anything else is up to you. There are many ways to do it.
16:18
<
mrvn >
I don't want to redraw to often though. I want to play it without hardware GL.
16:19
<
vincenz >
you can have animation with GL afaik
16:19
<
Smerdyakov >
Then you are out of luck. You can't get animation in OpenGL without redrawing.
16:19
<
mrvn >
Can I draw something and then overlay it with another draw pass?
16:20
<
Smerdyakov >
I doubt it, if what you're asking magically lets you avoid regenerating most of the pixels.
16:20
<
mrvn >
I could draw the landscape and then just redraw the mouse pointer and moving people over it on each frame.
16:21
<
Smerdyakov >
You would have to redraw parts of the landscape as the "people" moved.
16:21
<
Smerdyakov >
OpenGL is a very low level interface.
16:21
<
mrvn >
keep a copy of the bare landscape.
16:21
<
Smerdyakov >
It has no concept of "objects," just "pixels."
16:22
<
mrvn >
Luckily populous has very few polygons to draw. Should be fine even with software I guess.
16:22
<
Smerdyakov >
mrvn, do you know anyone without a 3D graphics card?
16:23
* Demitar
raises a paw.
16:23
<
mrvn >
Smerdyakov: Yes. Me. No accelerated 3D driver for amd64 for ATI cards.
16:23
* Smerdyakov
gives out a shout-out to Demitar, senko, mrvn, and their peeps in Somalia!
16:23
Godeke has quit ["Leaving"]
16:24
<
Demitar >
Smerdyakov, the truth is: laptop and no good drivers.
16:24
<
vincenz >
opengl has objects
16:24
<
vincenz >
you can have callists
16:24
<
mrvn >
Nowadays it is more a problem of the driver than 3D hardware,
16:24
<
vincenz >
store an object in a calllist and then in your animation, change something, call calllist
16:24
<
mrvn >
vincenz: But that redraws everything, right?
16:25
<
Smerdyakov >
vincenz, that's just like a macro. It doesn't automatically redraw the background.
16:25
<
vincenz >
it's more than a macro
16:25
<
vincenz >
cause everything is already in the opengl-memory, callists are quite performant (and hence perfect for animation)
16:26
<
vincenz >
as for redrawing the background, just have a callist for the background
16:26
<
mrvn >
vincenz: That still readraws
16:26
<
vincenz >
opengl ALWAYS redraws
16:27
<
vincenz >
but it's done in hardware
16:27
<
mrvn >
If I do it in software I first render the landscape and store that. Then I add the animations on each frame.
16:27
<
mrvn >
No point rerendering the landscape all the time.
16:28
<
vincenz >
there's not much to it, you've defined your textures and polygons
16:28
<
mrvn >
I guess I just have to try it with software GL and see if it is too slow.
16:28
<
vincenz >
and the rest is done in hardware, that's how opengl always does it
16:28
<
vincenz >
it's just drawing a bunch of polygons
16:28
<
vincenz >
well...triangles
16:28
<
mrvn >
vincenz: As I said above: Has to work without hardware.
16:29
<
vincenz >
well then make one BIG texture and one BIG polygon
16:29
<
vincenz >
and use doublebuffering
16:30
<
mrvn >
Does openGL support rendering into a texture?
16:30
<
vincenz >
i believe so
16:30
<
mrvn >
How does that work in hardware? Does it read out the graphics cards memory?
16:30
<
mrvn >
Or can you render into a texture and use it buit not read it?
16:30
<
vincenz >
and copies it into it's texture memory
16:31
<
vincenz >
I noticed that labltk includes lablgl, is the same true for lablgtk2?
16:32
<
mrvn >
vincenz: Under debian lablgl is a seperate package.
16:32
<
vincenz >
alrightio, thnx
16:32
<
mrvn >
It says it has lablgtk bindings but nothing about lablgtk2
16:34
<
vincenz >
what's togl?
16:35
<
karryall >
mrvn: it works with lablgtk2 too
16:35
<
mrvn >
karryall: great
16:35
<
karryall >
lablgtk2 is just lablgtk for GTK 2
16:36
<
vincenz >
makefile only mentions labltk, no lablgtk
16:36
<
karryall >
vincenz: togl is a tk widget with GL
16:36
<
vincenz >
but only for labltk, not lablgtk?
16:37
<
karryall >
for lablgtk tou need a gtk library called GtkGLArea
16:37
<
karryall >
and then lablgtk has support for this library (widget actually)
16:38
<
karryall >
Mind that GtkGLArea is more or less unmaintained IIRC
16:39
<
vincenz >
I'll make lib and glut
16:39
<
mrvn >
Maybe I should do it the old fashioned 2D way and just blit the tile images together.
16:40
<
mrvn >
It realy is too bad the Graphics module doesn't tell me what mouse button was pressed. If it did it would have all required features.
16:40
<
mrvn >
Does lablgl work under windows?
16:40
<
mrvn >
(not that I would care much)
16:45
<
mrvn >
Has anyone tried the map thingy I pasted?
16:47
<
mrvn >
I think the Graphics module interferes with Unix.sleep.
16:52
wegzz is now known as vezenchio
16:55
<
karryall >
you could use SDL too
16:55
<
karryall >
it's pretty good at blitting
17:03
<
vincenz >
it seems that I have glut installed at work
17:03
<
vincenz >
but not glut.h
17:04
<
Smerdyakov >
In Debian terms, that would probably mean something like libglut but not libglut-dev package installed.
17:04
<
vincenz >
yeah but I don't have access to that
17:05
<
vincenz >
[poucetc@pc1822:lablgl-1.01]$ rpmquery glut
17:05
<
vincenz >
glut-3.7-12
17:05
<
vincenz >
maybe I can install it locally
17:07
karryall has quit ["go!"]
17:08
<
vincenz >
how do I install a package locally?
17:08
<
vincenz >
error: package glut-devel is not relocateable
17:17
<
vincenz >
Error on dynamically loaded library: /scratch/lib/ocaml/stublibs/dlltogl.so: undefined symbol: Tcl_EventuallyFree
17:22
<
vincenz >
to bad that you can't display-forward opengl stuff
17:32
SmerdyOffice has joined #ocaml
17:34
menace has joined #ocaml
17:34
gim_ has joined #ocaml
17:37
gim has quit [Read error: 60 (Operation timed out)]
17:43
gim_ is now known as gim
17:48
<
mflux >
hmh, I think you can with sufficiently proficient x-library and x-server?
17:48
<
SmerdyOffice >
What does it mean for a library to be proficient?
17:48
<
mflux >
can do its job well, covering the specification and extensions?
17:49
<
mflux >
I think GLX can be transported over network
17:49
<
mflux >
and some x-servers actually support that
17:49
<
SmerdyOffice >
Native English speakers generally only use "proficient" to refer to intelligent beings.
17:50
<
mflux >
well, thanks for the information. however that pair of words just sounded so nice ;)
17:58
pango has quit ["Leaving"]
18:06
pango has joined #ocaml
18:19
pacroon has quit [Read error: 60 (Operation timed out)]
18:19
blugleblogle has quit [Remote closed the connection]
18:21
SmerdyOffice has quit ["Leaving"]
18:27
pacroon has joined #ocaml
18:40
gim_ has joined #ocaml
18:40
gim has quit [Read error: 110 (Connection timed out)]
18:40
gim_ is now known as gim
18:45
Faust has joined #ocaml
18:47
Submarine has joined #ocaml
18:58
cmeme has quit [Read error: 104 (Connection reset by peer)]
19:24
Submarine has quit [Read error: 104 (Connection reset by peer)]
19:33
neale has joined #ocaml
19:33
<
neale >
I don't suppose anyone on here has written an IRC library in Ocaml...
19:34
<
smimou >
yes I have :)
19:35
Faust has quit [Read error: 110 (Connection timed out)]
19:35
<
neale >
ah, excellent, are they freely available? I was going to start to port over my Python module, but perhaps there's no need.
19:36
<
neale >
oh, you'r samuel mimram
19:36
<
neale >
I was just reading aboun savonet :)
19:37
mrsolo has joined #ocaml
19:40
<
neale >
smimou: this looks excellent. I'll try to use irc.ml as a base for my infobot.
19:44
<
smimou >
and if you've got some comments / complaints / patchs, feel free to send that to me
19:44
<
neale >
smimou: is the ens-lyon version newer than sourceforge CVS?
19:45
<
neale >
ah, le voila.
19:49
<
neale >
haha filter_stupid_mirc_color_code
19:54
<
Demitar >
Such functions are the signs of a good irc library...
19:56
<
neale >
or at least a programmer with a sense of humor
20:24
Submarine has joined #ocaml
20:34
cmeme has joined #ocaml
20:35
gim has quit [Read error: 113 (No route to host)]
20:35
gim has joined #ocaml
20:49
vezenchio has quit ["smile, Rakka ..."]
21:13
vincenz has quit [Read error: 104 (Connection reset by peer)]
21:14
vincenz has joined #ocaml
21:20
gim has quit [Read error: 113 (No route to host)]
21:21
gim has joined #ocaml
21:36
Excedrin has quit [Read error: 104 (Connection reset by peer)]
21:42
Excedrin has joined #ocaml
21:52
CosmicRay has joined #ocaml
22:45
mlh has joined #ocaml
23:02
CosmicRay has quit ["Client exiting"]
23:02
gim has quit [Read error: 113 (No route to host)]
23:04
gim has joined #ocaml
23:35
smimou has quit ["?"]
23:41
tyler has joined #ocaml
23:41
<
tyler >
How would I cons onto a list ref?
23:41
<
tyler >
or, to be more general, what is the best way to collect string values of anonymous options using Arg.parse?
23:42
<
mellum >
r := x :: !r
23:47
mlh has quit [Client Quit]
23:48
<
tyler >
Arg is cool ;)
23:48
mlh has joined #ocaml
23:48
<
tyler >
way easier than screwing about with getopt or something like that...
23:49
gim has quit [Connection timed out]
23:51
gim has joined #ocaml
23:57
tyler has quit ["Leaving"]