Howdy,
I'm having intermittent problems on the Mac when
attempting to display graphics using blit inside a
process thread in full screen mode.
Here is the general flow of my project.
1. Main game graphics are displayed via a thread that
is spawned at program startup.
2. The game graphics are displayed on the Mac using a
typically buffered setup where I use draw_sprite() to
assemble the display frame into a system memory bitmap
then blast the system memory bitmap to the global
allegro screen variable using blit().
The problem I'm encountering on the Mac is that the
client gets into a state where the final blit doesn't
appear to do anything and the expected graphics don't
show up on the screen. My program gets into this
state about 20% of the time. It's a situation where
it either works for the entire duration of program
execution or it doesn't work at all.
What I've done to debug the situation:
1. I've verified that calling blit from the main
program thread and drawing a test graphic to the
screen works when the program gets into this situation
where calling blit from the display thread fails to
display any graphics.
2. I've verified that replacing the non-functioning
blit() in the display thread with draw_sprite() does
indeed draw the system memory bitmap to screen
(although the drawing speed is unacceptably slow).
2. I've verified that the display thread is properly
assembling the system memory bitmap frame buffer.
There doesn't seem to be any lock issues with the
system memory bitmap or algorithm problems.
3. I've verified that 'screen' doesn't seem to be
locked by putting in a gratuitous release_screen()
right before calling blit().
4. I've rebuilt the Allegro library and my client with
DEBUGMODE=1 to see if any error TRACEs were being
emitted. All debug output showed no obvious errors.
5. I've verified that this problem only happens on
the Mac while in fullscreen mode. The Mac client does
not encounter this problem when running in windowed
mode. The clients built from the same source code
running on Windows and Linux do not encounter this
problem.
The key things that stand out while trying to debug
the problem:
1. draw_sprite() works fine in the cases where
blit() sometimes doesn't.
2. only happens in fullscreen mode.
3. using blit from the main program thread works
fine in cases where calling blit() from the display
thread doesn't.
If someone who has a more intimate knowledge of the
Allegro codebase could think of what might be causing
the problem, I would be grateful.
Thank you!
Kirk Black
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
--
https://lists.sourceforge.net/lists/listinfo/alleg-developers