Re: [AD] vidpages idea

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Robin, I have replied to conductors because there are some questions
below.


In reply to Robin Burrows <rburrows@xxxxxxxxxx>:
>Seems to be, what is this solution?

Well, I'm not 100% sure if this will work under dynamic linking, but
here is the idea:

Create a constructor function (a function which is called at startup,
before main(); I know gcc has them, and I'm sure MSVC has them) which,
when called, sets some global variable, say `_al_win_vid_page_count' to
'3' instead of its default value of '2'.

This constructor function should be placed in a file which only contains
functions used for triple buffering (the function I had in mind was
`enable_triple_buffer()', since you would only call this if you were
going to use triple buffering). At the moment, no such file exists, but
it would be acceptable to split some functions into a separate file if
it provides a decent solution to this problem.

So, this constructor function is only called when you enable triple
buffering. If you do enable triple buffering anywhere in your program,
_al_win_vid_page_count will be 3; if you don't, it will be 2. Sorted.

Unless anyone can see any inherent flaws, would somebody be able to
answer a few questions:

1/. Does MSVC/[insert windows compiler here] support constructor 
    functions?

2/. If so, does an unused object file still get loaded along with the 
    rest of the DLL? (specifically, do its constructor functions get 
    executed?)

Bye for now,
-- 
Laurence Withers, lwithers@xxxxxxxxxx
                http://www.lwithers.demon.co.uk/

Attachment: signature.asc
Description: PGP signature



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/