Re: commit (head): gr_Graphics

From: Tomas Frydrych (tomasfrydrych_at_yahoo.co.uk)
Date: Thu Mar 18 2004 - 02:16:06 EST

  • Next message: Sharuzzaman Ahmat Raslan: "Re: Can't check out STABLE"

    > > Please, from now on do not access any static
    > > functions inside
    > > GR_Graphics and GR_Win32Graphics by their fully
    > > qualified names. For
    > > example instead of calling XAP_App::getApp(), use
    > > getApp().
    >
    > Why? IMO, XXX::getApp() should be removed. There is
    > only ever 1 instance of an XAP_Application object.
    > There should not be FV_View::getApp() or
    > GR_Graphics::getApp() methods.
    >
    > Why/how would the graphics' application differ from
    > the program's app?

    Sure, there is only one instance of the app, but that is not the
    issue here. When compiling a graphics plugin, gr_Graphics.cpp has to
    be compiled into the resulting (stand-alone) module, and the linker
    for the plugin module cannot resoves static XAP_App::getApp() to
    anything (since it does not live in the compiled files). The plugin
    needs to be given a pointer to the app instance when loaded and use
    that pointer.

    At the moment, the pointer is set by the constructors, which is
    unnecessary; it would be enough to initialise it in the first call to
    GR_Graphics constructor for the buil-in classes and in the plugin
    loader for plugins. I was contemplating changing GR_Graphics::m_pApp
    to a static member and remove XAP_App * from the parameters of all
    the constructors, but as there was a good chance of some platform
    breakage, I have decided not to for now (I have caused enough
    breakage in the past couple of weeks :)).

    Tomas



    This archive was generated by hypermail 2.1.4 : Thu Mar 18 2004 - 02:18:26 EST