Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: StretchDraw= Poor Quality, DrawAdd = Too Slow.

  1. #1

    StretchDraw= Poor Quality, DrawAdd = Too Slow.

    Hi.

    I've been working with a TImageList and drawing some of it's pictures with various effects. I wan't to draw a ball that once hit by another one, will grow and grow till it fits the screen, slowlly getting less opaque till it disappears.

    My problem is that i want to use a good quality plasma ball with coronas and other light effects. I can rotate it without slowing the game much using DrawRotateAdd (rotation makes it look even nicer) but when i stretch the image (give it a bigger TRect size) it gets slow as hell. If i use StretchDraw, then it's byebye transparency and good looking coronas.

    As anione got any ideas on how i can solve my problem? :shock:

  2. #2

    StretchDraw= Poor Quality, DrawAdd = Too Slow.

    Use Direct3D :twisted:
    There are only 10 types of people in this world; those who understand binary and those who don't.

  3. #3

    StretchDraw= Poor Quality, DrawAdd = Too Slow.

    Gee... thanks... :roll:

    I'm using the instructions from DelphiX, as far as i know Delphi doesn't have 'DrawRotateAdd' built in as an instruction...

  4. #4

    StretchDraw= Poor Quality, DrawAdd = Too Slow.

    Delphi doesn't have 'DrawRotateAdd' built in as an instruction
    There are only 10 types of people in this world; those who understand binary and those who don't.

  5. #5

    StretchDraw= Poor Quality, DrawAdd = Too Slow.

    DrawRotateAdd is a DelphiX function, not a Delphi one. So, if you paid enougth attention to my previous post you'd probbbly notice that i was already using foreign instructions that do not come with Delphi.

    BTW, how do you draw a circle on a DXDraw.Surface.Canvas? When i call the Elipse nothing is drawed on the screen (and yes, i'm fliping the buffer)

  6. #6

    Rotate Add

    You could rotate first, then stretch and finally drawadd the ball to surface.

    But If drawadd is soo slow it's a good idea to use some kind of 3d accelleration.

  7. #7

    StretchDraw= Poor Quality, DrawAdd = Too Slow.

    Quote Originally Posted by theWaver
    DrawRotateAdd is a DelphiX function, not a Delphi one. So, if you paid enougth attention to my previous post you'd probbbly notice that i was already using foreign instructions that do not come with Delphi.

    BTW, how do you draw a circle on a DXDraw.Surface.Canvas? When i call the Elipse nothing is drawed on the screen (and yes, i'm fliping the buffer)
    You will need to set the properties of the DXDraw.Surface.Pen and .Brush first. Also you should call DXDraw.Surface.Release after you have finished using the canvas. Generally, it is best to use something like this:
    [pascal]with DXDraw.Surface.Canvas do try
    Pen.Color := clRed;
    // more stuff
    finally
    Release;
    end;[/pascal]
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

  8. #8

    StretchDraw= Poor Quality, DrawAdd = Too Slow.

    thanks, that helped a lot!

    It's working almost like the way i wanted it to. Is there any way to draw the Elipse using semi-transparency?

  9. #9

    StretchDraw= Poor Quality, DrawAdd = Too Slow.

    Quote Originally Posted by theWaver
    Is there any way to draw the Elipse using semi-transparency?
    Not directly. However, you could create a new TDirectDrawSurface, draw the Elipse to that using the canvas, then DrawAlpha the surface onto the screen.
    [size=10px][ Join us in #pgd on irc.freenode.net ] [ Sign the Petition for a Software Patent Free Europe ][/size]

  10. #10

    StretchDraw= Poor Quality, DrawAdd = Too Slow.

    Quote Originally Posted by Useless Hacker
    Quote Originally Posted by theWaver
    Is there any way to draw the Elipse using semi-transparency?
    Not directly. However, you could create a new TDirectDrawSurface, draw the Elipse to that using the canvas, then DrawAlpha the surface onto the screen.
    And would that be any faster that simply drawing a bitmap from a TImageList using DrawAdd in the same DXDraw?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •