Nice to see, that PowerDraw & Asphyre is not dead !
I am looking forward to new version...
my ideas to new version:
- some support of automatic "Format" parameter of all components (in actual version program must decide which format of texture is the best for use; it can be done by TPowerDraw, because it known everything about mode, settings, graphic card, etc)
- some (protected method can be good enough) acces to internal structures of TPowerDraw component; especially to internal vertex buffer; posibility to specify Z-axis coordinate (I need it to combine use of zbuffer simple planar rendering from d3d and bitmaps from PowerDraw)
- publish your internal (or in-tools) procedures; mainly for manipulating Vtdb, AGFImage, fonts. I created some hard-code in my VTDbManager, my unit PDrawUtils contains procedures (which are not in PowerDraw pack):
Code:
//PowerDraw exception
EPDrawError = class(Exception);
//checks PowerDraw return code<>0 and raises exception with string from ErrFunc procedure or standard ErrorString proc.
procedure CheckError(err:Integer;ErrFunc:TErrCallFunc=nil);
//saves font extra data, e.g. header and widths
procedure SaveFontExtraData(PCount,StChar,EnChar:Integer;Widths,Heights:Array of Integer;out Data:Pointer;out DataSize:Integer);
//creates VTDb font record in memory
procedure CreateVTDFont(stchar,endchar:Integer;Widths,Heights:Array of Integer;Img:TAGFImage;out Data:Pointer;out DataSize:Integer);
//transforms AGF to TBitmap for preview
procedure AGFToBmp(AGF:TAGFImage;aTexIndex:Integer;var aBmp:TBitmap);
//loads VTDB AGF record from memory into TBitmap
procedure LoadBmpAsAGF(Data:Pointer;Texture:Integer;aBmp:TBitmap;var ID,TexWidth,TexHeight,TexCount, PtWidth,PtHeight,PtCount:Integer;OnlyAlpha:Boolean;aBGColor:TColor=clBlack);overload;
procedure LoadBmpAsAGF(Data:Pointer;Texture:Integer;aBmp:TBitmap;aBGColor:TColor=clBlack);overload;
//creates VTDB AGF record from TBitmap (TGA,BMP,JPG,GIF,...)
procedure SaveBmpAsAGF(aBmp:TBitmap;TexWidth,TexHeight,PtWidth,PtHeight:Integer;TransColor:TColor;out Data:Pointer;out DataSize:Integer);
- better error handling. In most cases (Init, Load,...) raising exceptions are the best way, but in rendering / textures procedures, it can do some overhead, so using returncode is better. Maybe unique error code system and translating into strings can be enough.
thanks for reading....
Bookmarks