List Info

Thread: "ocaml_beginners"::[] Glut Menu




"ocaml_beginners"::[] Glut Menu
user name
2006-10-03 17:11:32

Hi,

Something is going wrong when I try to use Glut
menu's. On Mac OS X
and Unix I get a bus error when I select a menu item
with the
following code. The menu appears and I can select an
item but then I
get a bus error. I tried some variations on the
menuSelect function
but that made no difference. What am I doing wrong?

I use OCaml 3.09.3 and lablgl-1.02, menu.ml is
compiled with:

ocamlopt -I +lablGL lablgl.cmxa lablglut.cmxa menu.ml
-o menu

let display () =
GlClear.clear [ `color ];
Gl.finish();;

let menuSelect ~value =
Printf.printf "menu item selected: %dn" value;;

let _ =
ignore(Glut.init Sys.argv);
Glut.initWindowSize 600 250;
Glut.createWindow ~title:"OpenGL Demo";
Glut.displayFunc(display);
Glut.createMenu menuSelect;
Glut.addMenuEntry "hello" 1;
Glut.addMenuEntry "hi" 2;
Glut.addMenuEntry "bye" 3;
Glut.attachMenu(Glut.LEFT_BUTTON);
Glut.mainLoop ();;

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] Re: Glut Menu
user name
2006-10-04 11:39:32

Sorry for the previous post, I should have tried the obvious. With version 1.01 of lablgl
everything works just fine.

>
> I use OCaml 3.09.3 and lablgl-1.02, menu.ml is
> compiled with:
>;

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )