On Fri, 2 Feb 2001, Andreas Beck wrote:
> Thus I propose the following architecture:
>
> [LibOverlay] [LibBlit]
> \ /
> [LibBSE]
>
> With LibOverlay containing access to hardware-sprites and other Overlay
> stuff like YUV-Viewports etc. and LibBlit giving access to Blitting
> operations which can be used for emulated sprites, both done as extensions.
>
> The API should be somewhat uniform to allow the "normal" (non-extension) Lib
> LibBSE to easily dispatch an abstract "Object", which might be a Sprite, a
> Bob or an EmuSprite to the underlying subsystems.
>
> I think that is what helps users the most. Given few targets now allow
> hardware cursors or can easily be hacked to do so, I'd recommend to have
> that possibility to do software-fallback.
>
> Moreover both extension libs have their individual uses standalone and they
> are technically very different, which is why they should be split and then
> glued again with LibBSE for user convenience.
libBSE is ready to use libovl and libblit.
I attached the api of libovl for discussion. Is it ok?
Christoph Egger
E-Mail: [EMAIL PROTECTED]
/*
******************************************************************************
LibOVL: extension API header file
Copyright (C) 2001 Christoph Egger [[EMAIL PROTECTED]]
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************************
*/
#ifndef _GGI_OVL_H
#define _GGI_OVL_H
#include <ggi/ggi.h>
__BEGIN_DECLS
/* Extension management
*/
int ggiOvlInit(void);
int ggiOvlExit(void);
int ggiOvlAttach(ggi_visual_t vis);
int ggiOvlDetach(ggi_visual_t vis);
/* Structure
*/
#ifdef HAVE_STRUCT_OVL
typedef struct ggiOvl *ggiOvl_t;
#else
typedef void *ggiOvl_t;
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE !FALSE
#endif
#define SHOW TRUE
#define HIDE FALSE
/* API functions
*/
/* 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);
/* free's the allocated area by ggiOvlAllocate
*/
int ggiOvlFree(ggiOvl_t ovl);
/* 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);
/* 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);
/* shows/hides the ovl-area
*/
int ggiOvlShow(ggiOvl_t ovl, int showhide);
__END_DECLS
#endif /* _GGI_OVL_H */