BBC BASIC for Windows
Programming >> Graphics and Games >> GFXLIB 3
http://bb4w.conforums.com/index.cgi?board=graphics&action=display&num=1318522866

GFXLIB 3
Post by David Williams 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



===

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:




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. rolleyes