2DGfx SDK 1.0v

2DGfx Reference

Introduction
Installation
2DGfx Overview
Major Components
Double Buffered Screen
Sprite Engine
Surface Database
Sprite Manager
Sprite Animation Engine
Using 2DGfx
Integrating 2DGfx into a Build Environment
Initialising DirectDraw
Creating a Screen
Initialising the Sprite Engine
Loading Graphics
Using Sprites
Initialising Sprite Animation Engine
Sprite Animation
Examples
Types and Macros
GFX_RGB32 describes a 32 bit RGB value.
C2DGfxScreen describes the 2DGfx Screen.
C2DGfxSpriteEngine describes the 2DGfx Sprite Engine.
C2DGfxSurfaceDB describes the 2DGfx Surface Database.
C2DGfxSurface describes a 2DGfx Surface.
C2DGfxSprites describes the 2DGfx Sprite Manager.
C2DGfxSprite describes a 2DGfx Sprite.
C2DGfxSpriteAnimEngine describes the 2DGfx Sprite Animation Engine.
C2DGfxAnimSprite describes a 2DGfx Animation Sprite.
GFX_SURF_REGLEFT describes the left hand side of the horizontal axis of a surface.
GFX_SURF_REGRIGHT describes the right hand side of the horizontal axis of a surface.
GFX_SURF_REGCENTER describes the centre of the horizontal or vertical axis of a surface.
GFX_SURF_REGTOP describes the top of the vertical axis of a surface.
GFX_SURF_REGBOTTOM describes the bottom of the vertical axis of a surface.
RegPoint describes the x and y coordinates of a surfaces registration point.
Rect describes the bounding rectangle of a sprite.
SpriteLoc describes the x and y coordinates of a sprite.
GfxAnimFrameNum describes a frame of animation using a database surface number and a frame delay.
GfxAnimFrameName describes a frame of animation using a database surface name and a frame delay.
Screen API
C2DGfxScreen instantiates the screen.
CreateScreen creates a screen to the specified dimensions and bit-depth.
GetWidth gets the screen width.
GetHeight gets the screen height.
GetDepth gets the screen depth.
PutText puts a text string on to the screens back surface.
GetPixel gets a pixel colour from the screens primary surface.
SetPixel sets a pixel colour on the screens back surface.
Flip flips the screens back and primary surfaces.
GetBackSurfaceAddress returns the address of the screens back surface.
Blank fills the screens back surface using a specified colour.
Sprite Engine API
C2DGfxSpriteEngine instantiates the sprite engine.
SurfaceDB gets the Surface Database API.
Sprites gets the Sprites Manager API.
Surface Database API
NewSurface loads a new surface.
ReplaceSurface loads a new surface over an existing surface.
RenameSurface renames an existing surface.
GetSurfaceAddress gets the address of the specified surface..
Recreate unloads and reloads all the surface within the database.
Unload unloads all the surfaces within the database.
Reload reloads all the surfaces within the database.
GetSurfaceCount gets the number of surfaces within the database.
GetSize gets the combined size of all the surfaces within the database.
GetSizeLoaded gets the combined size of all the surfaces currently loaded within the database.
Surface API
IsInUse is the surface currently in use?
Load load a bmp into the surface.
Unload unload the bmp from the surface.
Reload reload a previously loaded surface.
IsLoaded is the bmp currently loaded into the surface?
SetName set the surface name.
GetName get the surface name.
SetHReg set the horizontal registration point for the surface.
SetVReg set the vertical registration point for the surface.
SetReg set both the horizontal and vertical registration points for the surface.
GetSize gets the memory used by the surface when loaded.
Blit blits the surface.
width set the width of the surface.
height set the height of the surface.
regPoint set the registration point for the surface.
Sprite Manager API
GetMaxSprites gets the number of sprites supported by the sprite engine.
GetSprite gets the address of the specified sprite.
Blit blits the sprites.
Sprite API
SetLoc set the sprites location.
SetLocH set the sprites horizontal location.
SetLocV set the sprites vertical location.
GetLoc get the sprites location.
GetLocH get the sprites horizontal location.
GetLocV get the sprites vertical location.
SetWidth set the width of the sprite.
GetWidth get the width of the sprite.
SetHeight set the height of the sprite.
GetHeight get the height of the sprite.
SetRect set the sprites bounding rectangle.
GetRect get the sprites bounding rectangle.
SetAutoProperties sets whether the sprites properties are to automatically updated when a new surface is selected.
SetBackgroundTransparent sets whether pure white is to be blitted or ignored.
IsBackgroundTransparent indicates whether pure white is being blitted or ignored.
SetSurface sets the surface used by the sprite.
GetSurfaceNumber get the number of the surface used by the sprite.
GetSurfaceName get the name of the surface used by the sprite.
IsPointWithin is the specified point within the sprites bounding rectangle?
Collision checks for collision detection between other sprites.
Sprite Animation Engine API
C2DGfxSpriteAnimEngine instantiates the sprite animation engine.
GetMaxSprites get the number of sprites supported by the animation engine.
GetAnimSprite get the address of the specified animation sprite.
Update update the animation sprites.
Animating Sprite API
SetAnim set an animation.
SetPlaybackDirection set the direction of the playback head.
GetPlaybackDirection get the direction of the playback head.
SetLoop set the number of times to loop the animation.
GetMaxLoop get the maximum number of times the animation is to loop.
GetCurrLoop get the current number of times the animation has looped.
IsInfiniteLoop is the animation set to loop indefinitely?.
SetOscillate set the animation to oscillate.
IsOscillate is the animation set to oscillate?
Play play the animation.
IsPlaying is the animation currently playing?
Stop stop the animation.
HasStopped has the animation stopped?
Pause pause the animation.
IsPaused is the animation paused?

E-mail info@christophercaleb.com
© Copyright 2002 Christopher Caleb.