comp.lang.ada
 help / color / mirror / Atom feed
From: "Luke Guest" <lguest@bubball.com>
Subject: Re: Overloading procedures with Float and Long_Float types
Date: Mon, 8 Mar 2004 15:10:36 -0000
Date: 2004-03-08T15:10:36+00:00	[thread overview]
Message-ID: <404c8da0.0@entanet> (raw)
In-Reply-To: slrnc4ovhc.2eu.randhol+valid_for_reply_from_news@k-083152.nt.ntnu.no


"Preben Randhol" <randhol+valid_for_reply_from_news@pvv.org> wrote in
message
news:slrnc4ovhc.2eu.randhol+valid_for_reply_from_news@k-083152.nt.ntnu.no...
> On 2004-03-08, Luke Guest <lguest@bubball.com> wrote:
> >
> > Basically, it just seems to be wasting a good opportunity for
overloading
> > here.
>
> I really don't understand why one have a Float and a Long_Float in the
> first place? Why not simply have a Long_Float?

In OpenGL, there are a number of different ways to specify translations,
scales, vertices, normals, etc. GLfloat is normal single precision real
numbers, useful for games. GLdouble is useful for scientific visualisation.

Basically, it allows the programmer to pick which one to use. Games require
speed, so GLfloat is enough, scientific apps don't.

If I only provide one, the Long_Float/GLdouble variant, I'll either have to
cast it down to GLfloat and use the fast function or use the slower
function. Not an option. It's designed that way for a reason.

Luke.





  reply	other threads:[~2004-03-08 15:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-08  0:17 Overloading procedures with Float and Long_Float types Luke A. Guest
2004-03-08  3:49 ` James Rogers
2004-03-08  8:16   ` Luke A. Guest
2004-03-08  8:20     ` Preben Randhol
2004-03-08  9:06       ` Luke A. Guest
2004-03-08 10:10         ` Dmitry A. Kazakov
2004-03-08 14:05           ` Luke Guest
2004-03-08 14:07             ` Preben Randhol
2004-03-08 15:10               ` Luke Guest [this message]
2004-03-08 16:20                 ` Preben Randhol
2004-03-08 16:28                   ` Luke Guest
2004-03-08 17:58                     ` Preben Randhol
2004-03-09  8:55                       ` Dmitry A. Kazakov
2004-03-08 16:50                   ` Hyman Rosen
2004-03-08 16:55                     ` Luke Guest
2004-03-08 17:32                       ` Hyman Rosen
2004-03-08 14:37             ` Dmitry A. Kazakov
2004-03-08 15:18               ` Luke Guest
2004-03-08 19:52                 ` Gautier Write-only
2004-03-08 20:34                   ` Luke A. Guest
2004-03-09  8:40                 ` Dmitry A. Kazakov
2004-03-08 12:46 ` David C. Hoos
2004-03-08 14:03   ` Luke Guest
2004-03-08 14:54     ` Georg Bauhaus
2004-03-08 15:19       ` Luke Guest
2004-03-08 16:04     ` David C. Hoos
2004-03-08 16:17       ` Luke Guest
2004-03-09  9:24         ` Dmitry A. Kazakov
2004-03-08 19:58       ` Gautier Write-only
     [not found]     ` <1faf01c40527$0a364a10$b101a8c0@sy.com>
2004-03-08 16:21       ` Preben Randhol
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox