|
TDX_DRAW_LIBRARY INFORMATION
|
|
If you would like to know more information about something not on this page, ask us and we'll add it to a page.
OVERVIEW OF THE TDX_DRAW_LIBRARY
Top
Next
The TDx_Draw_Library is a library of 24 Borland C++ Builder (BCB) rapid application development (RAD) components
that "wrap" all available DirectDraw(tm) functionality into easy-to-use BCB Visual Component Library (VCL) components,
supplying a complete framework for harnessing all the power of DirectDraw(tm) and Borland C++ Builder.
These components make DirectDraw(tm) very easy to use, make DirectDraw(tm) work with Borland C++ Builder,
have many added extras designed to help you mix DirectDraw(tm) and Borland C++ Builder - quickly and easily.
All components come complete with full source code, project files, auto-installer, full [F1] context-sensitive help
covering all of DirectDraw(tm) plus additional features, and demos with full source code.
These components talk to video cards, monitors and videoport devices, and enable you to :-
- Draw Images Very Quickly
- Draw Images Using Blit Effects
- Overlay Images (ie: images with z-ordering)
- Setup & Rotate Color Palettes
- Apply Clip Regions
- Apply Gamma Effects
- Use Pixel Formats
- Stream Output from Video Ports
- Draw all images quickly and efficiently
- Draw images on any or all hardware devices
By fully utilizing the underlying DirectDraw(tm) engine, the TDx_Draw_Library supplies :-
- Realtime bit-blitting of many images
- Realtime modification of image data
- Realtime control of image blitting effects, including image rotation, palette translations, etc.
- A new programming paradigm, rapid application development DirectDraw, or "RAD DirectX" for short.
The TDx_Draw_Library contains much added functionality designed to make your life significantly easier, including :-
- Fully optimized for BCB and the VCL
- A solution to integration problems between BCB and DirectX where necessary.
- Automatic error detection & redirection to easy-to-use OnError() events.
- Automatic callback handling & redirection to easy-to-use OnEnum...() events.
- Simple integration with BCB paint routines that use a TCanvas component for drawing.
- Simple resource management with fully integrated CreateFrom..(), LoadFrom...() and SaveTo..() functions.
For more information, click :-
For background information on the entire TDx_Library, click :-
RAPID APPLICATION DEVELOPMENT DIRECTDRAW
Top
Next
Prev
The TDx_Draw_Library components are available to drag & drop to visually create a BCB application that uses DirectDraw.
For example, to create a working DirectDraw test application, use a standard BCB5 TForm.
Then add 1 x TButton, 1 x TDx_Draw, 2 x TDx_DrawSurface, 1 x TDDSurfaceDesc & 1 x TDDSCaps :-
Add a little bit of code :-
// ------------------------------------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
// create an interface to the default DirectDraw device
if (Dx_Draw1->Create(NULL))
 {
 // make sure we have exclusive access to this device
 Dx_Draw1->SetCooperativeLevel( Application->Handle, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE );
// setup to create a primary surface
DDSurfaceDesc1->SCaps = DDSCaps1;
DDSurfaceDesc1->SCaps->Caps = DDSCAPS_PRIMARYSURFACE;
// create a primary surface
if (Dx_DrawSurface1->Create( DDSurfaceDesc1, Dx_Draw1))
{
// create an offscreen surface from a file
if (Dx_DrawSurface2->CreateFromFile( Dx_Draw1, "TEST.BMP" ))
{
// display the test image while stretching it to fit the entire screen
Dx_DrawSurface1->Blt( NULL, Dx_DrawSurface2, NULL, 0, NULL );
// destroy the offscreen surface
Dx_DrawSurface2->Destroy();
}
// destroy the primary surface
Dx_DrawSurface1->Destroy();
}
 // destroy the DirectDraw interface
 Dx_Draw1->Destroy();
 }
}
Press F9 to build the project: a DirectDraw(tm) test application displaying a file called TEST.BMP
RAD DirectDraw in action.
For more information, click :-
DETAILS OF THE TDX_DRAW_LIBRARY
Top
Next
Prev
The 24 TDx_Draw_Library components :-
- supply advanced 2d graphics support to BCB applications
- automatically handle everything related to DirectDraw(tm)
- are quite "smart" - they fully maintain everything required to make DirectDraw(tm) work very well inside BCB
- supply an easy to use toolset designed to remove the vast majority of effort required to utilize DirectDraw(tm)
- let you focus mostly on the creative side of using DirectDraw(tm) rather than the underlying SDK technology
They supply much value-added functionality :-
- simple surface auto-creation from .bmp files
- automatic cross-updating of relevant datasets
- automatic callback translations to easy-to-use BCB OnAAA() events
Basically, everything required to make DirectDraw(tm) incredibly easy to use with Borland C++ Builder.
When starting to use the components, you can ignore most of DirectDraw's advanced capabilities and get quality results in minutes, then as you become familiar with the components and how they work, you can experiment with some of the more advanced features.
You have complete access to component internals, meaning you can mix & match with "normal" DirectDraw(tm) code if you want.
Overall, the TDx_Draw_Library supplies everything required to add advanced 2d graphics capabilities to any BCB application.
The TDx_Draw_Library offers :-
- Simple management of everything related to DirectDraw(tm)
- Simple access to all available DirectDraw(tm) functionality
- Automatic creation, destruction and maintenance of DirectDraw(tm) interfaces
- Automatic creation of draw surfaces from .bmp files
- Easy access to image data
- Easy access to image format information
- Easy static or dynamic image data storage
- Easy manipulation of blitting and blitting effects
- Easy access to all display devices
- Comprehensive BCB context-sensitive help [ press F1 in BCB ]
For more information, click :-
COMPONENTS OF THE TDX_DRAW_LIBRARY
Top
Next
Prev
The table below contains details on each TDx_Draw_Library component, and also contains links to individual reference pages ( context sensitive version is available within BCB at the press of the F1 key ) :-
COMPONENT LOGO |
COMPONENT NAME |
WRAPPER TYPE |
COMMENT |
|
TDDBltFX
|
Wrapper
|
The TDDBltFX component wraps a single DDBLTFX structure.
It describes various effects applied to a surface during a bit-blit operation, including various settings for
alpha channels,
nonstandard raster operations,
standard raster operations,
color keys,
surface fills,
pattern fills,
surface rotations and
z-buffers
for a directdraw surface.
Additional functionality :-
A Size property for determining the sizeof(DDBLTFX). The internal fDDBLTFX.dwSize structure member is automatically set to this value when calling the Clear() method.
A Clear() method for clearing the contents of the internal DDBLTFX structure and auto-resetting the internal fDDBLTFX.dwSize structure member.
An OnError() event that is called whenever any problems occur inside the TDDBltFX component.
An ErrorValue property for determining the value of the last error result that triggered the OnError() event.
|
|
TDDCaps
|
Wrapper
|
The TDDCaps component wraps a single DDCAPS structure.
It describes the capabilities of a particular DirectDraw device, including:
Alignment Settings,
Alpha Settings,
Color Key Capabilities,
General Capabilities,
Video Ports Settings,
Overlay Settings,
Alpha FX Capabilities,
General FX Capabilities,
Non-Local-Video Blit Capabilities,
FourCC Capabilities,
Palette Capabilities,
Raster Operations,
System-To-System Blit Capabilities,
Video-To-System Blit Capabilities,
Free Video Memory and
Total Video Memory Settings.
Additional functionality :-
A Size property for determining the sizeof(DDCAPS). The internal fDDCAPS.dwSize structure member is automatically set to this value when calling the Clear() method.
A Clear() method for clearing the contents of the internal DDCAPS structure and auto-resetting the internal fDDCAPS.dwSize structure member.
An OnError() event that is called whenever any problems occur inside the TDDCaps component.
An ErrorValue property for determining the value of the last error result that triggered the OnError() event.
|
|
TDDColorControl
|
Wrapper
|
The TDDColorControl component wraps a single DDCOLORCONTROL structure.
It describes color controls such as
brightness,
color enable,
contrast,
gamma,
hue,
saturation and
sharpness that can be applied to a primary surface, an overlay surface or a video port and can be used to define color controls to be applied to the primary surface.
Additional functionality :-
A Size property for determining the sizeof(DDCOLORCONTROL). The internal fDDCOLORCONTROL.dwSize structure member is automatically set to this value when calling the Clear() method.
A Clear() method for clearing the contents of the internal DDCOLORCONTROL structure and auto-resetting the internal fDDCOLORCONTROL.dwSize structure member.
An OnError() event that is called whenever any problems occur inside the TDDColorControl component.
An ErrorValue property for determining the value of the last error result that triggered the OnError() event.
|
|
TDDColorKey
|
Wrapper
|
The TDDColorKey component wraps a single DDCOLORKEY structure.
It describes color key or color range information for a directdraw surface that is being bit-blitted or overlaid.
Additional functionality :-
A Size property for determining the sizeof(DDCOLORKEY).
A Clear() method for clearing the contents of the internal DDCOLORKEY structure. The DDCOLORKEY structure does not contain a dwSize structure member.
An OnError() event that is called whenever any problems occur inside the TDDColorKey component.
An ErrorValue property for determining the value of the last error result that triggered the OnError() event.
|
|
TDDDeviceIdentifier
|
Wrapper
|
The TDDDeviceIdentifier component wraps a single DDDEVICEIDENTIFIER2 structure.
It describes the
driver description,
device id,
device identifier,
driver name,
driver version,
driver revision,
subsystem id,
vendor id and
certification level
for a particular directdraw device.
Additional functionality :-
A Size property for determining the sizeof(DDDEVICEIDENTIFIER2).
A Clear() method for clearing the contents of the internal DDDEVICEIDENTIFIER2 structure. The DDDEVICEIDENTIFIER2 structure does not contain a dwSize structure member.
An OnError() event that is called whenever any problems occur inside the TDDDeviceIdentifier component.
An ErrorValue property for determining the value of the last error result that triggered the OnError() event.
|
|
TDDGammaRamp
|
Wrapper
|
The TDDGammaRamp component wraps a single DDGAMMARAMP structure.
It describes the
red,
green and
blue
components of a gamma ramp that is applied to the primary directdraw surface.
Additional functionality :-
A Size property for determining the sizeof(DDGAMMARAMP).
A Clear() method for clearing the contents of the internal DDGAMMARAMP structure. The DDGAMMARAMP structure does not contain a dwSize structure member.
An OnError() event that is called whenever any problems occur inside the TDDGammaRamp component.
An ErrorValue property for determining the value of the last error result that triggered the OnError() event.
|
|
TDDOverlayFX
|
Wrapper
|
The TDDOverlayFX component wraps a single DDOVERLAYFX structure.
It describes various effects applied to an overlay surface during an overlay operation, including
alpha settings,
source & destination color keys,
effects settings and
source & destination surfaces used as overlay alpha channels.
Additional functionality :-
A Size property for determining the sizeof(DDOVERLAYFX). The internal fDDOVERLAYFX.dwSize structure member is automatically set to this value when calling the Clear() method.
A Clear() method for clearing the contents of the internal DDOVERLAYFX structure and auto-resetting the internal fDDOVERLAYFX.dwSize structure member.
An OnError() event that is called whenever any problems occur inside the TDDOverlayFX component.
An ErrorValue property for determining the value of the last error result that triggered the OnError() event.
|
|
TDDPixelFormat
|
Multi - Wrapper
|
The TDDPixelFormat component wraps and manages any number of DDPIXELFORMAT structures.
It describes the raw pixel format information for a directdraw surface including various
bit depths,
bit masks,
bump maps,
general format,
FourCC codes,
luminence masks,
RGB color masks,
RGB bit-depths,
stencil bit depths,
YUV color masks and
YUV bit-depths and
z-buffer bit-depths.
Additional functionality :-
An ArraySize property that determines the total # of internal DDPIXELFORMAT structures maintained by the TDDPixelFormat component.
A Size property for determining the sizeof(DDPIXELFORMAT). All internal fDDPIXELFORMAT[index].dwSize structure members are set to this value when calling the Clear() and ClearAll() methods.
A SizeAll property for determining the byte size of all internal DDPIXELFORMAT structures, equivalent to ArraySize * Size.
A Clear() method for clearing the contents of the specified internal DDPIXELFORMAT structure and auto-resetting the specified fDDPIXELFORMAT.dwSize structure member.
A ClearAll() method for clearing the contents of all internal DDPIXELFORMAT structures and auto-resetting all fDDPIXELFORMAT[index].dwSize structure members.
An OnError() event that is called whenever any problems occur inside the TDDPixelFormat component.
An ErrorValue property for determining the value of the last error result that triggered the OnError() event.
|
|
TDDSCaps
|
Wrapper
|
The TDDSCaps component wraps a single DDSCAPS structure.
It describes the capabilities of a directdraw surface including
surface flags and
more surface flags.
Additional functionality :-
A Size property for determining the sizeof(DDSCAPS).
A Clear() method for clearing the contents of the internal DDSCAPS structure.
An OnError() event that is called whenever any problems occur inside the TDDSCaps component.
An ErrorValue property for determining the value of the last error result that triggered the OnError() event.
Special Note :-
To use the TDDSCaps component (optional), link it to a TDDSurfaceDesc component using the TDDSurfaceDesc::SCaps property.
Once linked, the TDDSCaps will be automatically maintained to contain the same data as is in the parent TDDSurfaceDesc.
Also, you can use one TDDSCaps, and link it on-the-fly to many different TDDSurfaceDesc components.
For more information, refer to the TDDSurfaceDesc component immediately below.
|
|
TDDSurfaceDesc
|
Wrapper
|
The TDDSurfaceDesc component wraps a single DDSURFACEDESC2 structure.
It describes the properties of a directdraw surface, including
bit depths,
number of back buffers in the flip chain,
color keys,
general flags,
width,
height,
pitch,
pixel format,
refresh rate and
texture stage.
Additional functionality :-
A SCaps property which can be linked to a TDDSCaps component to enable retrieval of the caps information.
A PixelFormat property which can be linked to a TDDPixelFormat component to enable BCB-style usage of the DDPIXELFORMAT structure stored inside the DDSURFACEDESC2 structure.
A Size property for determining the sizeof(DDSURFACEDESC2).
A Clear() method for clearing the contents of the internal DDSURFACEDESC2 structure.
An OnError() event that is called whenever any problems occur inside the TDDSurfaceDesc component.
An ErrorValue property for determining the value of the last error result that triggered the OnError() event.
Special Note :-
The DDSURFACEDESC2 structure contains it's own internal DDSCAPS and DDPIXELFORMAT structures.
In the TDx_Library, these are called "structures in structures" and are all handled generically, with additional properties being created and relevant code added to each DirectX function.
These additions work together to automatically "map" the internal structures of linked components and keep data accurate.
For example, the DDSURFACEDESC2 structure contains a DDSCAPS structure internal to the DDSURFACEDESC2 structure.
In the TDx_Draw_Library, an additional property "SCaps" has been created that can be linked to a TDDSCaps component.
Once linked, the TDDSCaps component's internal DDSCAPS structure is (when required) identical to the DDSCAPS structure internal to the DDSURFACEDESC2.
There will be much more information describing the internal TDx_Library processes soon.
|
|
TDDVideoPortBandwidth
|
Wrapper
|
The TDDVideoPortBandwidth component wraps a single DDVIDEOPORTBANDWIDTH structure.
It describes the bandwidth chararacteristics for an overlay surface,
including it's
interpretation capabilities,
color keying stretch factor,
overlay stretch factor and
y-interpolation.
|
|
TDDVideoPortCaps
|
Wrapper
|
The TDDVideoPortCaps component wraps a single DDVIDEOPORTCAPS structure.
It describes the capabilities and alignment restrictions of a video port, including
alignment boundaries,
crop boundaries,
crop width,
prescale width,
general capabilities,
video port effects,
current settings,
video port height,
video port width,
actual number of autoflip surfaces,
optimal number of autoflip surfaces,
filter taps,
preshrink along an axis and
video port id.
|
|
TDDVideoPortConnect
|
Multi - Wrapper
|
The TDDVideoPortConnect component wraps and manages multiple DDVIDEPORTCONNECT structures.
It describes a video port connection, including
general capabilities,
physical pin width and
video port type identifiers.
|
|
TDDVideoPortDesc
|
Wrapper
|
The TDDVideoPortDesc component wraps a single DDVIDEOPORTDESC structure.
It describes a video port including
field height,
field width,
raw bandwidth,
time frames,
vbi width,
video port id and
video port type.
|
|
TDDVideoPortInfo
|
Wrapper
|
The TDDVideoPortInfo component wraps a single DDVIDEOPORTINFO structure.
It describes the transfer of data from a video port to a surface,
including
crop area,
pixel format,
x origin,
y origin,
prescale width,
prescale height,
vbi height,
vbi input format,
vbi output format and
general settings.
|
|
TDDVideoPortStatus
|
Wrapper
|
The TDDVideoPortStatus component wraps a single DDVIDEOPORTSTATUS structure.
It describes the status of a video port
including it's
current settings,
if it's currently in use and
video port type, a pointer to a TDDVideoPortConnect component.
|
|
TDx_Draw
|
Interface
|
The TDx_Draw component wraps and manages a single IDirectDraw7 interface.
This is the main root component of the TDx_Draw_Library, everything else ultimately requires this component.
It supplies direct access to a particular DirectDraw device interface, and is used to interact with a video hardware (graphics card) and display devices (monitors).
It can be used to
create a directdraw interface,
create a clipper,
create a surface,
enumerate all devices,
destroy a directdraw interface,
duplicate a surface,
enumerate display modes,
enumerate surfaces,
evaluate a display mode,
reset the win32 display surface,
get available video memory,
retrieve a devices capabilities,
retrieve a device identifier,
retrieve current display mode settings,
retrieve FourCC codes,
retrieve the win32 display surface,
retrieve the monitor frequency,
destroy a directdraw device,
retrieve the video hardware scanline,
get a surface from a Device Context,
get the vertical blank status,
restore all surfaces,
restore the default display mode,
set the cooperative level,
set the display mode,
start a test to determine available display modes,
test the current cooperative level and
wait for a vertical blank to complete.
Additional functionality :-
OnCreate(), OnDestroy() and OnError() events triggered during creation, destruction, and whenever any error occurs.
A modified DDEnumerate() method which automatically calls the OnDDEnumerate() callback event, which makes responding to device enumeration simple.
A modified EnumDisplayModes() method which automatically calls the OnEnumDisplayModes() callback event, which makes responding to display mode enumeration simple.
A modified EnumSurfaces() method which automatically calls the OnEnumSurfaces() callback event, which makes responding to surface enumeration simple.
An ErrorValue property for determination of the last error result returned from DirectDraw(tm) or the TDx_Draw_Library.
|
|
TDx_DrawClipper
|
Interface
|
The TDx_DrawClipper component wraps and manages a single IDirectDrawClipper interface.
It manages clip lists that can be applied to a surface to produce clipping effects.
It can be used to
create a clipper interface,
destroy a clipper interface,
set & retrieve a clip list,
set & retrieve the window handle associated with the clipper and
determine if the clip list has changed.
|
|
TDx_DrawColorControl
|
Interface
|
The TDx_DrawColorControl component wraps and manages a single IDirectDrawColorControl interface.
It manages color controls that can be applied to a surface.
It can be used to
create a color control interface,
destroy a color control interface,
retrieve color controls and
set color controls.
|
|
TDx_DrawGammaControl
|
Interface
|
The TDx_DrawGammaControl component wraps and manages a single IDirectDrawGammaControl interface.
It manages gamma controls that can be applied to a surface.
It can be used to
create a gamma ramp interface,
destroy a gamma ramp interface,
retrieve gamma ramps and
set gamma ramps.
|
|
TDx_DrawPalette
|
Interface
|
The TDx_DrawPalette component wraps and manages a single IDirectDrawPalette interface.
It manages palettes that can be applied to a surface.
It can be used to
create a palette interface,
destroy a palette interface,
get palette capabilities,
get palette entries,
load a palette from a file,
load a palette from a resource and
set palette entries.
|
|
TDx_DrawSurface
|
Interface
|
The TDx_DrawSurface component wraps and manages a single IDirectDrawSurface7 interface.
This is the second most important component of the TDx_Draw_Library.
The IDirectDrawSurface7 interface handles all image related data inside directdraw surfaces and contains many options you can use to display your image data very quickly.
It can be used to
create a surface interface,
destroy a surface interface,
create a surface from a file,
create a surface from a surface,
load a surface from a file,
load a surface from a surface,
manage a surface flip-chain,
bit-blit (display) images,
set & retrieve uniqueness values,
enumerate surfaces in the flip chain,
enumerate overlay z-orders,
page flip,
get the bit-blit status,
retrieve surface capabilities,
set & retrieve a clipper,
set & retrieve color keys,
retrieve a device context,
retrieve a surface's DirectDraw interface,
retrieve the current flip status,
set & retrieve the level of detail,
set & retrieve the overlay position,
set & retrieve the surface's palette,
retrieve the surface's pixel format,
set & retrieve a texture surface's priority,
retrieve the surface's pixel format,
set & retrieve private data,
set & retrieve a surface's description,
determine if a surface has been lost,
lock & access a surface's internal image data,
lock a surface into non-paging memory,
save a surface to a file,
update an overlay surface's position and
update an overlay surface's z-order.
|
|
TDx_DrawVideoPort
|
Interface
|
The TDx_DrawVideoPort component wraps and manages a single IDirectDrawVideoPort interface.
It channels live content from a video port to a surface.
It can be used to
create a video port interface,
destroy a video port interface,
use a new surface for the next output frame,
retrieve bandwidth info,
set & retrieve color controls,
retrieve field polarity,
retrieve input formats,
retrieve output formats,
retrieve the current scanline,
retrieve the video signal status,
set the surface used for video playback,
start video playback,
stop video playback,
update video playback and
wait for vertical sync.
|
|
TDx_DrawVideoPortContainer
|
Interface
|
The TDx_DrawVideoPortContainer component wraps and manages a single IDDVideoPortContainer interface.
It creates and manipulates video ports.
It can be used to
create a video port container,
destroy a video port container,
create a video port,
enumerate video ports,
retrieve connection information for a video port and
query the status of a video port.
|
MORE INFORMATION ABOUT THE TDX_DRAW_LIBRARY
Top
Prev
Over time we will add much more information about the TDx_Draw_Library.
In the meantime, the table below contains details on the current status of the entire TDx_Library, and links to more information :-
|
|