Re: [AD] [WIN] Patch to fix input with external windows

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


> > Keyboard input works perfectly now in my custom-window program :)
> 
> Great!
> 
> Are you ok with the following addition to the docs ?
> 
> --- cvsroot/allegro/docs/src/allegro._tx Thu Apr 25 13:27:42 2002
> +++ allegro/docs/src/allegro._tx Sat Apr 27 00:22:46 2002
> @@ -7832,7 +7832,9 @@
>     window; in particular, you are responsible for processing the events as
>     usual (Allegro will automatically monitor a few of them, but will not
>     filter out any of them). You can then use every component of the library
> -   (graphics, mouse, keyboard, sound, timers and so on).
> +   (graphics, mouse, keyboard, sound, timers and so on), bearing in mind
> +   that some Allegro functions are blocking (e.g readkey() if the key buffer
> +   is empty) and thus must be carefully manipulated by the window thread.
> 
>  @@void @win_set_wnd_create_proc(HWND (*proc)(WNDPROC));
>     Registers an user-defined procedure to be used by Allegro for creating
> 

Yes, I think that should be enough, who is using his own window peocedure
probably knows that it has to be updated periodically.

Something I had problems with at first, I tried doing the windows message loop
in its own thread, so the program would fail. But that's windows related, and
has nothing to do with Allegro.

Maybe a simple example could be added, which has an update loop like e.g.
exflip, but uses a custom window, to show how the
PeekMessage()/DispatchMessage() functions have to be called periodically (or
is there already an example which does that?)

I also just noticed, that resizing my window doesn't crash allegro anymore,
good work :)

I must experiment now if I also can draw into the added window area without a
crash, and if I can also use a transparent background, so I could have an
oddly shaped window like all those MP3 players, and still use DirectX-Allegro
to do GFX in it.. :)

--
Elias Pschernig



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