- Joined
- Dec 25, 2010
- Messages
- 46
- Reaction score
- 0
- Points
- 0
Hi, I'm trying to cache an increasingly complex overlay for the hud, as clbkDrawHUD procs ~150 times per second...and there is no need to fetch data, recalculate geometry, parse html, etc, more than 10 times a second. I had hoped to do this by spewing a buffered surface via oapiBlt onto the hud, however, the big white diagonal line I had hoped to produce, does not appear. It seems skp->GetSurface() returns null in clbkDrawHUD.
Am I doing it wrong, or is it just not possible to blit onto the hud? If it's not possible, is anyone aware of another means to this end?
Am I doing it wrong, or is it just not possible to blit onto the hud? If it's not possible, is anyone aware of another means to this end?
Code:
oapi::Sketchpad *vskp;
protected:
int vhudCreated;
SURFHANDLE vhud;
(snip)
bool ORION::clbkDrawHUD (int mode, const HUDPAINTSPEC *hps, oapi::Sketchpad *skp) {
if(vhudCreated!=1) {
dprint("got %i x %i",hps->W,hps->H);
vhud=oapiCreateSurface (hps->W,hps->H);
vhudCreated=1;
dprint("vud==NULL? %i",(vhud==NULL?1:0));
oapiSetSurfaceColourKey(vhud,0x010203);
vskp=oapiGetSketchpad(vhud);
dprint("vskp==NULL? %i",(vskp==NULL?1:0));
}
(snip)
if(vhudCreated==1) {
oapiColourFill (vhud,0x010203,0,0,200,200);
oapi::Pen * wut=oapiCreatePen(1,3,0xFEFEFE);
vskp->SetPen(wut);
vskp->Line(10,10,500,500);
oapiReleasePen(wut);
SURFHANDLE wtf=skp->GetSurface();
dprint("hudsurface==NULL? %i",(wtf==NULL?1:0));
oapiBlt(vhud,skp->GetSurface(),1,1,1,1,hps->W-20,hps->H-20);
}
Code:
orion -- 0.0100000000 -- 18 31 14 0109 -- got 1274 x 994
orion -- 0.0100000000 -- 18 31 14 0125 -- vud==NULL? 0
orion -- 0.0100000000 -- 18 31 14 0125 -- vskp==NULL? 0
orion -- 0.0100000000 -- 18 31 14 0203 -- hudsurface==NULL? 1
orion -- 0.0200000000 -- 18 31 14 0234 -- hudsurface==NULL? 1