POV-Ray : Newsgroups : povray.off-topic : Quick C++ question... : Re: Quick C++ question... Server Time
5 Sep 2024 03:24:40 EDT (-0400)
  Re: Quick C++ question...  
From: Darren New
Date: 11 Nov 2009 20:51:54
Message: <4afb6a3a$1@news.povray.org>
Warp wrote:
>   Why wouldn't it work? 

Hmmm. I remember.
You get an IDirectFB by calling
   IDirectFB* myIDFB;
   good = DirectFBCreate(&myIDFB);
You get a "screen" by calling
   IDirectFBScreen* myIDFBScreen;
   good = myIDFB->GetScreen(myIDFB, this, that, &myIDFBScreen);

In other words, DirectFB is allocating and initlaizig the space, as well as 
filling in pointers (like the GetScreen pointer) for each one, and then 
putting the space it allocated into the pointer whose address you passed in.

I'm not sure how to cleanly turn that into a class without wrapping every 
single function. None of those functions take a pointer to your own class, 
so there's a bunch of casting on every creation at a minimum, and you have 
to hope your class is laid out the same as the parent struct and all that.

Maybe it'll work, but it's 9 hours of working on this stuff today already, so...

-- 
   Darren New, San Diego CA, USA (PST)
   I ordered stamps from Zazzle that read "Place Stamp Here".


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.