From: Maurizio C. <mau...@gm...> - 2005-10-05 10:17:06
|
Found it... It seems I should call Sdlgl.swap_buffers instead of Sdlvideo.flip. Sorry for bothering you with such banality! bye Maurizio 2005/10/5, Maurizio Colucci <mau...@gm...>: > > > Maybe I should call SDL_GL_SetAttribute first? But in ocamlsdl there > > > is no equivalent to that function... > > > > Sure there is: it's in the Sdlgl module : > > http://ocamlsdl.sourceforge.net/doc/html/Sdlgl.html > > Sorry to bother again... Even after calling Sdlgl.set_attr, I got a > segmentation fault. I really don't see what I am doing wrong. :-P > > --- > Sdl.init [`VIDEO]; > print_endline "debug checkpoint 1"; > > Sdlgl.set_attr [Sdlgl.DOUBLEBUFFER true; Sdlgl.DEPTH_SIZE 16] ; > > print_endline "debug checkpoint 2"; > > let screen =3D Sdlvideo.set_video_mode ~w:640 ~h:480 ~bpp:0 [`OPENGL] = in > print_endline "debug checkpoint 3"; > > Sdlvideo.fill_rect screen (Sdlvideo.map_RGB screen Sdlvideo.white); > print_endline "debug checkpoint 4"; > > Sdlvideo.flip screen; > print_endline "debug checkpoint 5"; > > Sdl.quit() > |