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

Thread: DX or GDI?

  1. #1

    DX or GDI?

    I know that directX is a zillion times faster than GDI and I think there will be no other option for me than directX, but let me share with you what I'm doing and then you tell me if I'm in the right path.

    I'm creating a game very similar to pool. Basically I need the table surface and round objects that will slide/roll over this surface.
    As a test, I've created the table using a canvas, but when I created the balls and made them slide on my table, I had a horrible flicker (I'm not erasing the background and I'm using double buffering already).

    Here it is my rethorical question: should I keep using GDI or should I go to directX? I kind of like GDI because I don't have to worry about the directX version inferno, neither I have to worry about what OS my user is using, and I don't know how much more difficult directX is compared to drawing on a canvas.

    Any suggestions?

    Thanks
    The sky is not the limit, the ground is

  2. #2

    DX or GDI?

    try SDL, it should work fine, and it's completely crossplatform. Not to mention it includes other aspects on top of graphics like input and sound.
    My DGDev forum pascal syntax highlight settings:
    <br />[background=#FFFFFF][comment=#8080FF][normal=#000080]
    <br />[number=#C00000][reserved=#000000][string=#00C000]

  3. #3

    DX or GDI?

    Hmm I'm not sure SDL will be of any help here, since this application seems to be VCL-based ()

    The flicker you talk about is not normal. How do you make your double-buffering ? Do you draw to an offscreen canvas and then blit the whole offscreen canvas to the visible one ?

    If you could extract the core paint loop of your app, we might help you further.

  4. #4

    DX or GDI?

    Basically I'm using a second TBitmap to draw offscreen and then I use CopyRect. I tried to use BitLlt but I run into some problems. I've read somewhere that CopyRect and BitBlt have minimal or no performance difference.

    Right now it is VCL based (TGraphicControl inherited), but it doesn't need to be. My goal is to have a really smoth sliding effect, just like a pool ball.

    I also need to implement some sort of colision detection algorithm, but I realize that it has nothing to do with what display architecture I will use.
    The sky is not the limit, the ground is

  5. #5

    DX or GDI?

    I'd strongly recommend that you avoid GDI. It's really not very good. If you're worried about the learning curve, you could do worse than taking a look at Graphics32. It's much more fully featured than the VCL stuff (check out the demo programs at that URL, showing off anti-aliasing, blending, layers, rotation, etc.). Most importantly, it's flicker free!

    For the best speed, you should take a look at one of the many component sets out there wrapping up Direct3D, DirectDraw or OpenGL. There are plenty - for some names, just a have a look around the forum [DelphiX, PowerDraw, Omega Project, SDL, GLScene, GLXTreem, GameVision, and so on!].

    Don't let unfamiliarity stop you from trying out different libraries. The GDI is really rather inadequate the moment you need to do something interesting. You will be surprised by how much better the alternatives are in speed and quality once you are used to them.

    About the collision detection: check out a couple of articles over at gamasutra, Physics on the back of a cocktail napkin and a later one, Pool hall lessons: fast, accurate collision detection between circles or spheres -- free registration required before you can see the articles.
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  6. #6

    DX or GDI?

    I'm reading the last one, looks very appropriate to what I'm trying to do. I think you guys convinced me to try something else.
    The sky is not the limit, the ground is

  7. #7

    DX or GDI?

    Flickering is probably caused by your usage of TGraphicsControl - try change it to TCustomControl or even just to TPanel and enjoy the difference!
    There are only 10 types of people in this world; those who understand binary and those who don't.

  8. #8

    DX or GDI?

    You know what... yesterday I've donwloaded delphiX and played with it a little bit. I made up my mind. It's sooo easy to work with, and the results are explendid for my application.

    I think I'll just forget about the VCL and go directX
    The sky is not the limit, the ground is

  9. #9

    DX or GDI?

    Don't forget what original DelphiX uses DirectX 5 only. But there is UnDelphiX port (don't know is it supports DirectX 6 or DirectX 7).
    There are only 10 types of people in this world; those who understand binary and those who don't.

  10. #10

    DX or GDI?

    So, which library is the best one for directX, what version of directX is everybody using these days?
    The sky is not the limit, the ground is

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
  •