[AD] Re: Intermittent problem with blit on Mac

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> Just to be clear - are you creating another thread
yourself to > draw the 
> graphics (if so, how? Using pthreads?)

Yes, I create a thread that handles displaying the
game graphics from within main() using pthreads.  This
display thread runs without interuption from network
processing or user input processing. As soon as it
finishes assembling one frame buffer, it starts the
next. 

The main thread (the one I create that is) handles
network message processing (the network itself also
runs in its own pthread and focuses exclusively on
recving network data and putting it on a message queue
for the main thread to process when it gets around to
it), game AI, user input and animation frame
advancement for animating entities in the game.

> I'll need to do some testing but it _may_ be that
what you ask > is 
> impossible. The reason is that OSX uses Mach Ports
internally > to 
> communicate between processes and these ports are
tied to a  particular 
> thread on creation.

Not quite sure what you mean by "impossible".  At any
rate, after various test changes to the code to verify
certain aspects of the problem, it strikes as a
possible thread permissions problem although the fact
that draw_sprite() works when replacing blit() in the
failure cases kind of throws that theory for a loop.

> Could you possibly make a minimal program that shows
the problem? Code 
> speaks louder than words!

I will work something up over the holidays and email
you the code.  Thanks a lot for your help, Pete.





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/