[comp.os.os2.programmer] GpiCorrelate performance

bking@nro.cs.athabascau.ca (Barry King) (04/30/91)

I'm developing a PM graphics application under OS/2 v1.3.  I am using 
chained segments (retained graphics) where each segment contains a 
graphics object.  I use GpiCorrelateChain to detect hits on objects for 
moving/deleting.  This works fine except that as the number of segments 
in the chain increases (or the complexity of a graphics object in a 
segment is high) the correlation operation can take up several seconds.
This is on a 386/33 machine, BTW.
 
My question is, is there a better way to do this using the Gpi functions 
and get some decent performance?  I'd like to avoid writing my own 
routines to manage and detect the graphics objects.
 
Also, when redrawing a delected object, I only invalidate the bounding 
rectangle of the object.  I then use GpiCorrelateChain again with the 
pick aperature set to the bounding rectangle for the update region and 
only redraw those segments which are in the pick aperature.  This works 
okay too but, again, GpiCorrelateChain takes to long and a side effect is 
that the heirarchy of the redrawn objects is not retained.  That is, they 
aren't drawn in the original order.  I could maybe use GpiSetPriority - 
type function to set the priority of a segment and then draw the segments 
in priority order but I'd have to sort the segment tags first - kind of a 
pain but doable.
 
Maybe the application will have to perform it's own object management?  
Hell, any suggestions would be welcome.
 
Thanks!

Barry King             ersys!bking@nro.cs.athabascau.ca
Edmonton Remote Systems:  Serving Northern Alberta since 1982