RE: [AD] 4.3 graphic drivers |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: <alleg-developers@xxxxxxxxxx>
- Subject: RE: [AD] 4.3 graphic drivers
- From: "Robert Ohannessian" <ROhannessian@xxxxxxxxxx>
- Date: Thu, 10 Nov 2005 14:58:07 -0800
- Thread-index: AcXmQ7qv+cnDhQB6QhSJeu4bCBfyHQABmD5g
- Thread-topic: [AD] 4.3 graphic drivers
Either way is fine (and perfectly equivalent). I just find the table
form to be cleaner, but I don't feel too strongly either way.
> -----Original Message-----
> From: alleg-developers-admin@xxxxxxxxxx [mailto:alleg-
> developers-admin@xxxxxxxxxx] On Behalf Of Elias Pschernig
> Sent: Thursday, November 10, 2005 4:12 PM
> To: alleg-developers@xxxxxxxxxx
> Subject: RE: [AD] 4.3 graphic drivers
>
> On Thu, 2005-11-10 at 12:26 -0800, Robert Ohannessian wrote:
> > I seem to remember a couple of threads on the topic, a few years
back...
> >
> > I personally would vote for strings instead of #defines. This code
> > doesn't need to be fast, since it's done just once at init time.
> >
> > Also, I'd like to pass an array to Allegro instead of registering
the
> > functions individually.
> >
> > For example:
> >
> > static const AL_VTABLE_1_0 my_vtable[] = {
> > { "init", 1.0, my_init },
> > { "exit", 1.0, my_exit },
> > { "vsync", 1.0, my_vsync },
> > { NULL, 0, NULL }
> > };
> >
> > GFX_VTABLE *al_vtable = create_gfx_vtable();
> > register_gfx_vtable_1_0(al_vtable, my_vtable);
>
> IMO,
>
> GFX_VTABLE *al_vtable = create_gfx_vtable();
> register_gfx_vtable_1_0(al_vtable, "init", 1.0. my_init);
> register_gfx_vtable_1_0(al_vtable, "exit", 1.0. my_exit);
> register_gfx_vtable_1_0(al_vtable, "vsync", 1.0. my_vsync);
>
> would look even cleaner. Or is there an advantage of using static
> arrays?
>
> --
> Elias Pschernig
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server.
> Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> --
> https://lists.sourceforge.net/lists/listinfo/alleg-developers