Re: [AD] Use GetMessage instead of PeekMessage (Win32)

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


Hi Trent,

On Wed, Aug 25, 2010 at 8:41 PM, Trent Gamblin <trent@xxxxxxxxxx> wrote:
> On 2010-08-25, at 5:37 PM, David Capello wrote:
>> Hello people, here I'm attaching a patch for Allegro 4.9 (svn)
>> for Windows platform (D3D and GL) to process messages
>> with GetMessage() directly (without using PeekMessage,
>> al_rest, etc.).
>
> I believe this patch will break D3D on some occasions. It
> needs to continually update the "lost" state of the device
> and as far as I know no Window events are related to that
> so the display could enter a lost state and nobody would
> realize until the next window event.

Well, I don't have too much D3D knowledge, but looking at
the code, the d3d_generic_window_message_loop() thread
is the message pump of the window messages, and
d3d_display_thread_proc() is the other thread checking
if the device was lost. In this last function is were al_rest(0.001)
is required to check the device status periodically.

I think that we would need to use PeekMessage if we had
only one thread: message pump + device regeneration in
the same thread. But this is not our case, we have two
threads doing different task each one. IMO.




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