Greetings! I've re-checked pixel code and it seems fine.
Open "Plasma" example and change the "TimerRender" function to the following:
[pascal]procedure TMainForm.TimerRender(Sender: TObject);
var
i, j: Integer;
begin
with PowerDraw.Device do
begin
Clear($FFFF0000);
BeginScene();
for j:= 0 to Images[0].TextureHeight - 1 do
for i:= 0 to Images[0].TextureWidth - 1 do
Images[0].Pixels[i, j, 0]:= Images[0].Pixels[i, j, 0] and $FFFF0000;
for j:= 0 to (PowerDraw.Height div 256) do
for i:= 0 to (PowerDraw.Width div 256) do
RenderEffect(Images[0], (i * 256), (j * 256), 0, effectNone);
Fonts[0].TextOut('FPS: ' + IntToStr(Timer.FrameRate), 4, 4, $FFFFFFFF, effectNone);
EndScene();
Present();
end;
end;[/pascal]
This uses Pixels property to read and write the entire texture. The example above makes Plasma look in red color only. I had no problems running this on ATI Radeon 9000, Nvidia GeForce 2 Go and Nvidia GeForce 2 MX400 (all run WinXP).
Maybe your problem is driver related? Although since you mentioned a lot of machines, then maybe you are still trying to access pixel outside image's boundaries? Check that your X and Y coordinates do not overpass TextureWidth and TextureHeight (that is, maximum value for X can be TextureWidth - 1, same applies to Y).
EDIT: I did not understood what you were trying to say related to TAsphyreImage... if you use TPowerDraw component it needs TAsphyreImages component to be asociated with it, otherwise no images will be created. When TAsphyreImages is asociated with TPowerDraw, each image class is created with TPowerDraw.Device.NewImage, which creates and returns an TAsphyreImage class which is compatible with the specific TAsphyreDevice (that is, TAsphyreDevice3 creates TAsphyreImage3 class instance).
Bookmarks