Ticket #34 (closed enhancement: fixed)

Opened 19 months ago

Last modified 18 months ago

Change Cafu to use wxWidgets for screen, main window and OS event queue management

Reported by: Carsten Owned by:
Priority: normal Milestone:
Component: Cafu Engine Version: svn-head
Keywords: DirectX, DirectInput, wxWidgets Cc:
Platform:

Description

Currently, some parts of the proprietary implementation of Cafu OS-specific code come with several problems:

  • Current use of DirectX7 under Windows for mouse input
    • prevents successful linking under 64-bit Windows,
    • doesn't work with touch or pen tablet input,
    • is worse(!) in performance than using the Win32 message queue (see below for reference).
  • Has no support for Mac OS X yet.

Modifying Cafu to employ the wxWidgets library (just like the editor CaWE) for display, main window and event handling would resolve these problems, plus yield (or at least make available for future use) all the other benefits of wxWidgets as well.

Regarding mouse input accuracy and performance, not using DirectInput seems to be favorable as well, see  Taking Advantage of High-Definition Mouse Movement for details.
So nothing is lost by replacing DirectInput under Windows, and if the need arises, it can still be re-added besides wxWidgets later.

This ticket is a (recommended) prerequisite for ticket #19.

Change History

Changed 18 months ago by Carsten

Some resources regarding event queue processing and performance / simulating the "master game loop" in wxWidgets:

1. Idle Events

2. Own Event Loop

  •  http://article.gmane.org/gmane.comp.lib.wxwidgets.general/66493
  • A viable alternative to idle events that potentially also works when idle events don't, but is also more complex and may turn out very similar to idle events anyway.
  • We would have to check the implementations, idle events might in fact be even closer to what we really want:
    while (true)
    {
        while (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE))
        {
            ...;
        }
    
        OurCode();
    }
    
    instead of
    while (true)
    {
        while (PeekMessage(&Message, NULL, 0, 0, PM_REMOVE))
        {
            ...;
            OurCode();    // This is called too frequently!
        }
    }
    

Changed 18 months ago by Carsten

  • status changed from new to closed
  • resolution set to fixed

Happily closed by r136. :-)

Note: See TracTickets for help on using tickets.