|
resonance 1.0.1
|
Base of every renderer, with a message queue and a router of its own. More...
#include <rendererbase.h>


Classes | |
| class | Router |
| Sink that forwards every message it receives to one other sink. More... | |
Public Member Functions | |
| RendererBase () | |
| Start the queue with the router as its one sink. | |
| virtual | ~RendererBase () |
| Release the queue and the router. | |
| virtual void | Dispatch (Message *pMsg) |
| Accept a message into the queue. | |
| virtual void | Start () |
| Start the renderer running. | |
| virtual void | Stop () |
| Stop the renderer running. | |
| virtual void | PollMessages () |
| Deliver every queued message. | |
| virtual void | Update ()=0 |
| Advance the renderer by one frame. | |
| virtual void | Draw ()=0 |
| Draw the frame. | |
| virtual void | UpdateSimple () |
| Advance the renderer by one frame without the full update. | |
| virtual void | DrawSimple () |
| Draw the frame without the full draw. | |
| Public Member Functions inherited from MsgSink | |
| void * | operator new (size_t nSize) |
| Allocate a sink from the tagged heap under the tag "MsgSink". | |
| void | operator delete (void *pBlock) |
| Release a sink to the tagged heap. | |
| virtual | ~MsgSink () |
| virtual void | DispatchPriv (Message *pMsg)=0 |
| Act on a message. | |
Base of every renderer, with a message queue and a router of its own.
It derives from MsgSink at offset 0, with its own type function at 0x00139e88. Three classes derive from it: MetRenderer, MetNullRenderer, and Renderer. Each of their constructors calls this class's constructor directly.
The table at 0x007d2d20 runs eleven entries against MsgSink's four, so slots 4 through 10 are the seven virtuals this class introduces. Slots 3, 7, and 8 address the pure-virtual stub at 0x005381a8, and the class is therefore abstract. Slot 3 is MsgSink::DispatchPriv(), which this class leaves pure. Slot 2 overrides MsgSink::Dispatch().
Each of the seven takes its name from the overrides and from the callers. MetaGameWorld runs slots 4 and 5 to start and stop the front end, GameManagerImpl::DrawFrame() runs slots 6, 7, and 8 on every frame, and GameManagerImpl::DrawFrameSimple() runs slots 9 and 10. The six MetRenderer overrides take no argument and return nothing, and Renderer's three overrides agree. Those overrides fix the signatures. The base bodies of slots 4, 5, 9, and 10 are empty and do not read an argument register.
| RendererBase::RendererBase | ( | ) |
Start the queue with the router as its one sink.
The router's target is this object, so every message the queue delivers arrives at this object's DispatchPriv().
|
virtual |
Release the queue and the router.
The body writes the MsgSink table pointer at +0x00 and again at +0x40, tears the queue down through MsgQueue::~MsgQueue(), and releases the object under its __in_chrg flag. The second table write is the router member rather than a second base, because the RTTI records MsgSink as the one base of this class and Router as a nested class with its own descriptor.
|
virtual |
Accept a message into the queue.
Slot 2. The message is stored rather than acted on, and reaches DispatchPriv() only when PollMessages() drains the queue. MetRenderer and Renderer both inherit this body.
| pMsg | The message to store. |
Reimplemented from MsgSink.
|
virtual |
Start the renderer running.
Slot 4, with an empty body in this class.
MetaGameWorld's forwarder at 0x003d4860 is the caller.
Reimplemented in MetRenderer.
|
virtual |
Stop the renderer running.
Slot 5, with an empty body in this class.
MetaGameWorld's forwarder at 0x003d4890 is a caller.
Reimplemented in MetRenderer.
|
virtual |
Deliver every queued message.
Slot 6.
The body drains the queue through MsgQueue::Poll(). MetRenderer inherits it, and Renderer's override calls it explicitly.
Reimplemented in Renderer.
|
pure virtual |
Advance the renderer by one frame.
Slot 7, pure in this class.
Implemented in MetNullRenderer, MetRenderer, and Renderer.
|
pure virtual |
Draw the frame.
Slot 8, pure in this class.
Implemented in MetNullRenderer, MetRenderer, and Renderer.
|
virtual |
Advance the renderer by one frame without the full update.
Slot 9, with an empty body in this class.
GameManagerImpl::DrawFrameSimple() is the caller.
Reimplemented in MetRenderer.
|
virtual |
Draw the frame without the full draw.
Slot 10, with an empty body in this class.
GameManagerImpl::DrawFrameSimple() is the caller.
Reimplemented in MetRenderer.