David Williams
Developer
member is offline

meh

Gender: 
Posts: 452
|
 |
GFXLIB 3
« Thread started on: Oct 13th, 2011, 4:21pm » |
|
GFXLIB 3 doesn't exist yet, and it may not ever, but I'll start the ball rolling and who knows where it may lead.
Comments, ideas, suggestions, debate, arguments welcome!
What would GFXLIB 3 be?
A library of subroutines, functions and utilities geared primarily to facilitate the creation of 2D, bitmap-based games.
(It could just be called GAMELIB instead?)
Architecturally, it would be a new, ground-up re-design, the code structured and written in quite strict accordance with the guidelines set out in this article:
http://bb4w.wikispaces.com/Guide+to+writing+libraries
===
Why a GFXLIB 3?
===
Why not a GFXLIB 3
GFXLIB 2 is very easy to use (at least from the point of view of someone writing a game) Tiny potential userbase means GFXLIB 3 could just end up a wasted effort of gargantuan proportions
===
Proposal for GFXLIB 3 library components structure
In BB4W's LIB folder, I propose the following files and resource folders:
BBC BASIC for Windows\LIB\GFXLIB3.BBC BBC BASIC for Windows\LIB\GFXLIB3 BBC BASIC for Windows\LIB\GFXLIB3\modules BBC BASIC for Windows\LIB\GFXLIB3\resources BBC BASIC for Windows\LIB\GFXLIB3\utilities
GFXLIB3.BBC is the core library (more on this below) GFXLIB3 is a subfolder containing the three subfolders modules, resources, utilities GFXLIB/modules contains the external GFXLIB modules; bitmap drawing and manipulation routines, etc. GFXLIB/resources various images required by example and demonstration programs, font definitions, filter kernels, etc. GFXLIB/utilities would contain a variety of PROCs, FNs (including assembler routines) useful to game creation GFXLIB3.BBC
Contains only essential subroutines - image and data loaders, DirectDraw 7 initialiser, DIBSection setup, etc.
The following core assembler routines are what I would consider essential:
Bitmap clipper (returns clipping parameters to enable bitmap to be clipped to the edges of a frame buffer) Rectangle clipper Line clipper (prefer not one reliant on FPU calculations, with respect to MH!) Circle clipper (No FPU calculations, thank you) Fast, no-frills, colour-keyed bitmap plotter (like GFXLIB_Plot) Fast, no-frills 'solid' bitmap plotter (like GFXLIB_BPlot) Line drawer Circle plotter (solid and outline); no FPU calculations! Rectangle plotter (solid and outline) Pixel plotter
Display variables/parameters structure (not necessarily called dispVars !!!)
This has to be massively simplified. I propose:
{ flags%, pBuffer%, bW%, bH% }
Where:
flags% contains (obviously) flag bits read by GFXLIB routines pBuffer% contains the base address of the frame buffer (which could be a DIB section, or memory bitmap, etc.). bW% and bH% are the buffer widths and heights, respectively.
To be continued?
EDIT (19.01.2012): Well, obviously not. 
|