> I attached the api of libovl for discussion. Is it ok?
> #ifndef FALSE
> #define FALSE 0
> #endif
> #ifndef TRUE
> #define TRUE !FALSE
> #endif
Don't do that. That's a remainder of Pascal and it pollutes CPP-Symbol
namespace. Please use an enum for that if you think it is necessary and give
it symbols that do not pollute namespace, like ggiovl_show or something like
that.
Personally I'd prefer to document the behaviour.
> /* checks, if a area of VRAM is available. If not, then it fails
> * else it allocates it with the given size.
> */
> ggiOvl_t ggiOvlAllocate(ggi_visual_t vis, int width, int height);
That is not enough. give it extra flags and options to spcify the type of
overlay you want. Also note, that Sprites may not reside in VRAM at all.
Something like giving it a pointer to a union like socket operations do with
addresses might be good. say like:
struct Overlay {
enum Overlaytype type;
union {
struct Sprite sprite;
struct VidOvl vidovl;
struct OvlWin window;
}
}
> /* Set the given image (vis) to the ovl-area.
> */
> int ggiOvlSetImage(ggiOvl_t ovl, ggi_visual_t vis,
> int x, int y, unsigned char *alpha);
>
I.e. like the BSE API with grabbing the image from a visual at pos x,y
- right ?
> /* moves the ovl-area to (x,y), where (x,y) is the top-left corner
> * of the ovl-area.
> */
> int ggiOvlMove(ggiOvl_t ovl, int x, int y);
Something like
int ggiOvlSetOption(ggiOvl_t ovl,enum optiontype op,void *arg);
might also be good. For example for controlling effects of the overlay, like
transparency, setting a hardware source for the image etc.
> /* shows/hides the ovl-area
> */
> int ggiOvlShow(ggiOvl_t ovl, int showhide);
I'd rather use
int ggiOvlShow(ggiOvl_t ovl);
int ggiOvlHide(ggiOvl_t ovl);
int ggiOvlIsHidden(ggiOvl_t ovl);
and use a counting behaviour for Hiding (i.e. you can hide many times and
got to unhide as many times to get it back). This simplifies using it in
libraries quite a bit.
The point is that libs might want to temporarily hide the cursor (say for a
fullscreen view of the video) and release it afterwards - it shouldn't
matter to them if it was already hidden.
CU, Andy
--
= Andreas Beck | Email : <[EMAIL PROTECTED]> =