|
From: Daniele C. <dca...@in...> - 2007-09-07 16:26:00
|
For obtain an image with a good resolution I use TQ3PixmapDrawContextData.
It is work fine but if I use Quesa shared render opengl I don't see shadow.
The function is this:
/
TQ3DrawContextObject MyNewDrawContext(long larg,long alt)
{
TQ3PixmapDrawContextData myDrawContextData;
CRect srcRect ;
TQ3ColorARGB coloreSfondo;
coloreSfondo.r=(float) (GetRValue(gPOG.coloreSfondo3D)/255.);//copia
RGBColor in TQ3ColorRGB É
coloreSfondo.g=(float) (GetGValue(gPOG.coloreSfondo3D)/255.);//É
convertendo dal range 0..65535 É
coloreSfondo.b=(float) (GetBValue(gPOG.coloreSfondo3D)/255.);//É al
range 0,0..1,0
coloreSfondo.a=1;// alfa channel = 1 (solid)
myDrawContextData.drawContextData.clearImageMethod =
kQ3ClearMethodWithColor;
myDrawContextData.drawContextData.clearImageColor = coloreSfondo;
myDrawContextData.drawContextData.paneState = kQ3False;
myDrawContextData.drawContextData.maskState = kQ3False;
myDrawContextData.drawContextData.doubleBufferState = kQ3False;
srcRect.SetRect(0,0,larg,alt);
myDrawContextData.pixmap.width = srcRect.right - srcRect.left;
myDrawContextData.pixmap.height= srcRect.bottom - srcRect.top;
myDrawContextData.pixmap.pixelSize=32;
myDrawContextData.pixmap.rowBytes =
Pixmap_GetRowBytes(myDrawContextData.pixmap.width,myDrawContextData.pixmap.pixelSize);
myDrawContextData.pixmap.pixelType = kQ3PixelTypeRGB32;
myDrawContextData.drawContextData.paneState=kQ3True;
myDrawContextData.drawContextData.pane.min.x=(float)srcRect.left;
myDrawContextData.drawContextData.pane.min.y=(float)srcRect.top;
myDrawContextData.drawContextData.pane.max.x=(float)srcRect.right;
myDrawContextData.drawContextData.pane.max.y=(float)srcRect.bottom;
myDrawContextData.pixmap.bitOrder = kQ3EndianLittle;
myDrawContextData.pixmap.byteOrder = kQ3EndianLittle;
pBits = (BYTE*)
malloc(myDrawContextData.pixmap.rowBytes*myDrawContextData.pixmap.height);
::ZeroMemory(pBits,myDrawContextData.pixmap.rowBytes*myDrawContextData.pixmap.height);
myDrawContextData.pixmap.image = pBits ;
return Q3PixmapDrawContext_New(&myDrawContextData);
}
/
It Maybe the problem is not here.
Have you some advice?
Thanks
|