Jump to content
  • Advertisement
Sign in to follow this  
Vagos

Delphi-7 and delphix (directx draw): ploting pixels issue

This topic is 2490 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I use delphi 7 and delphix so I can have ddraw and be able to create a surface to play with pixels.

so in a button trigger i use this:

for i:=1 to 100 do
for j:=1 to 100 do
dxdraw1.Surface.Pixels[i,j]:=250;

where dxdraw1 is a ddraw object, a surface.

The problem is that it works, but the result shows after I hoover another window above my program, like it is not updating the rectangle area with the pixels.
(I press the button, the cpu usage is getting up for a short and the rectangle remains black until I hoover another window.)

Also its slow, as I read somewhere else:

"...
DXDraw.Surface.Canvas.Pixels[X,Y]:=clBlue;
DXDraw.Surface.Canvas.Release;
..."

for using do play with pixels, and after another said this:

"... Just remember that this function (above) is extremely slow . It's locking and unlocking the surface on every pixel set.. not very usable. PixelDX and turboPixel don't, you manually lock the surface, do all of your pixel operations and then unlock it.. 1000 times faster. ..."

How to use these functions? I cant find them (and I have no idea since I am beginner on ddraw)? How to lock first and then unlock?

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!