Thread: DirectDraw and C?

  1. #1
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709

    DirectDraw and C?

    I'm curious. I was reading an article on GD.net yesterday and following it along (what the hell) and when I got to a certain part, it stopped compiling. I read the forum thread on the article and apparently I would have to go C++ to get it to compile, but someone mentioned that "there is a way to do it in C", though he didn't say what. I've not found anything.

    It was something to do with using COM (the thing that wouldn't compile).

    Sorry if this sounds too vague, it's just a long shot to see if anyone knows.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  2. #2
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    >> apparently I would have to go C++

    You could try that forum too i suppose. They may know if it's C++ specific ... but you want a C solution i take it. Sorry, I can't help you there.

  3. #3
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    Hmm I'll get slapped for cross posting. Maybe this would've been better on the tech board.
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    DirectDraw and COM are windows things - moved to windows board.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,273
    I use DirectX in C all the time - what's your point?
    The main difference being that there's no this, so you have to specify the pointer to the instance of the object you're messing with as the first parameter to any member function. Also function pointers are acquired through a struct called "lpVtbl".

    So instead of
    pObject->Blah(...);

    You do
    pObject->lpVtbl->Blah(pObject, ...);

    Oh, and if you think that's hard, try forgoing explicit function calls and do it all through COM's IDispatch interface. In C. Fun fun fun!!!

  6. #6
    Supermassive black hole cboard_member's Avatar
    Join Date
    Jul 2005
    Posts
    1,709
    Well that seems simple enough (the first part).
    Good class architecture is not like a Swiss Army Knife; it should be more like a well balanced throwing knife.

    - Mike McShaffry

Popular pages Recent additions subscribe to a feed