Browse thread
Re: [Caml-list] How to synchtonize swap buffers with vertical retrace in lablgk/lablgtk, or labgl/labltk,
-
Peter Ronnquist
- Peter Ronnquist
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Peter Ronnquist <pronnquist@y...> |
| Subject: | Re: [Caml-list] How to synchtonize swap buffers with vertical retrace in lablgk/lablgtk, or labgl/labltk, |
To compile ocaml sdl I needed to add
-lSDL_ttf to the CLIBS in OCamlSDL/src/Makefile.
Also added -DHAVE_FREETYPE_FREETYPE_H to the CFLAGS
in OCamlSDL/makefile.toplevel
But I still don't sync with the vertical retrace.
I have a small test loop that do the following:
---------------------
...
let placement x y src dst =
let h = surface_height src
and w = surface_width src
in
let y_max = (surface_height dst) - h
and x_max = (surface_width dst) - w
in
let r_smiley = (Rect(x,
y,
w,h))
and r_src = (surface_rect src)
in
surface_blit src r_src dst r_smiley;
update_rect dst r_smiley;;
(* The "main" loop *)
for i = 1 to 200 do
(* surface_blit icon r_src screen r_smiley;
update_rect screen r_smiley;*)
placement v.(0) 25 icon screen;
v.(0) <- v.(0) +2;
Sdltimer.delay 10;
Sdlvideo.flip screen;
done;
...
--------------------------
The Sdlvideo.flip should sync with vertical retrace if
sdl is initialized with SDL_DOUBLEBUF, SDL_HWSURFACE
and I also tried to add SDL_FULLSCREEN with the same
result.
According to the online documentation SDL_Flip will
wait for vertical retrace on hardware that supports
it. G400 supports it, at least glx manages to do it.
Thanks for any help,
Best Regards
Peter Rönnquist
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
-------------------
To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr