From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list@inria.fr
Subject: Example slowing down... (OpenGL/lablgl)
Date: Thu, 12 Apr 2007 00:25:21 +0200 [thread overview]
Message-ID: <20070411222521.GA1603@first.in-berlin.de> (raw)
Hello,
today I tried lablgl the first time succesful. :)
It's nice.
I tried the example from
http://en.wikipedia.org/wiki/OCaml
=================================================================
let _ =
ignore( Glut.init Sys.argv );
Glut.initDisplayMode ~double_buffer:true ();
ignore (Glut.createWindow ~title:"OpenGL Demo");
let render () =
GlClear.clear [ `color ];
GlMat.rotate ~angle:(Sys.time() *. 0.01) ~z:1. ();
GlDraw.begins `triangles;
List.iter GlDraw.vertex2 [-1., -1.; 0., 1.; 1., -1.];
GlDraw.ends ();
Glut.swapBuffers () in
Glut.displayFunc ~cb:render;
Glut.idleFunc ~cb:(Some Glut.postRedisplay);
Glut.mainLoop ()
=================================================================
That's nice, only 14 lines of code and the example is done. :)
But after I made the window with the triangle greater,
this examplke slowed down extremely! :(
It seems that it does not use the features of the
graphics card for some reasons. (??!)
I have a gentoo-linux and an nvidia graphics card in the
PC. Running on AMD-64 architecture.
The first days I didn't used the closed-source nvidia drivers and tried
an old C-source I had written. It was a threded application;
in one of the thredas I had temporarily inserted one of the OpenGL-examples
from the RedBook. This was intended as aa placeholder for some time,
until I would write my own OpenGL-stuff for that thread.
In a small window that RedBook-example was amazingly fast.
And it slowed down, when making the window bigger, but nevertheless
was fast enough. When using "fog" effects, it slowed down extremely.
Later I used the nvidia-driver and it was so amazingly much more faster
than before, and slowing down, when making the window greater, was
not such a big effect. Using fog nearly had no effect.
The sources of the RedBook-example are written in C.
And today I tried OCaml with lablgl and this simple
triangle.
In a small window it was circling very fast, but making the window
bigger slowed down the circular velocity a lot!
What's going on here?
Is the lablgl-binding - for some reason - NOT
using features that are using accelerated graphic-card's
features? Is the binding relaying on non-accelerated
functions?
Or is the OCaml-code in the above example
written in bad OpenGl-style?
(But I see the keyword double-buffering in the example,
so it should be fast (?!))
Or is OCaml itself slowing down for some reasons?
As I didn't have changed the X11-settings (using X11-Xorg-Server)
the same (accellerated) driver is running as it was as I tried the
RedBook-examples.
So there must be something with the above code or the lablgl-Lib
or with OCaml that makes the application slowing down, when the
window is enlarged.
Someone who knows, what the problem is?!
Thanks In Advance,
Oliver Bandel
next reply other threads:[~2007-04-11 22:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-11 22:25 Oliver Bandel [this message]
2007-04-12 0:07 ` [Caml-list] " skaller
2007-04-12 14:09 ` Oliver Bandel
2007-04-12 7:15 ` Jon Harrop
2007-04-12 14:33 ` Oliver Bandel
2007-04-12 19:46 ` Jon Harrop
2007-04-12 20:26 ` Martin Jambon
2007-04-12 22:19 ` Jon Harrop
2007-04-13 0:30 ` Martin Jambon
2007-04-13 0:44 ` Jon Harrop
2007-04-12 20:47 ` Oliver Bandel
2007-04-13 1:12 ` skaller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070411222521.GA1603@first.in-berlin.de \
--to=oliver@first.in-berlin.de \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox