1 ///////////////////////////////////////////////////////////////////////////////
2 // $Source: x:/prj/tech/libsrc/gameshel/RCS/dgshell.cpp $
4 // $Date: 1997/09/03 17:06:39 $
12 ///////////////////////////////////////////////////////////////////////////////
14 // Game shell create method
17 tResult LGAPI
_GameShellCreate(REFIID
, IGameShell
** ppGameShell
, IUnknown
* pOuterUnknown
, int fFlags
, int msecBlockSignal
)
19 return (new cDosGameShell(fFlags
, pOuterUnknown
) != 0) ? S_OK
: E_FAIL
;
22 ///////////////////////////////////////////////////////////////////////////////
24 // CLASS: cDosGameShell
28 // Pre-fab COM implementations
30 IMPLEMENT_SIMPLE_AGGREGATION_SELF_DELETE(cDosGameShell
);
32 ///////////////////////////////////////
34 // Construct an instance...
37 cDosGameShell::cDosGameShell(int fFlags
, IUnknown
* pOuterUnknown
)
39 // Add internal components to outer aggregate...
40 INIT_AGGREGATION_1( pOuterUnknown
,
47 ///////////////////////////////////////
49 // Destroy an instance...
52 cDosGameShell::~cDosGameShell()
56 ///////////////////////////////////////
58 // Pump-input and lock display surfaces (if specified when created)
61 STDMETHODIMP_(void) cDosGameShell::BeginFrame()
65 ///////////////////////////////////////
67 // Release locks, ensure screen is up-to-date
70 STDMETHODIMP_(void) cDosGameShell::EndFrame()
74 ///////////////////////////////////////
76 // Process pending events
78 // This model empties the queue rather than pumping only one event
81 STDMETHODIMP_(void) cDosGameShell::PumpEvents(int )
85 ///////////////////////////////////////
87 // Try to lock video memory.
90 STDMETHODIMP_(int) cDosGameShell::DisplayLock()
95 ///////////////////////////////////////
97 // Release a lock on memory
100 STDMETHODIMP_(int) cDosGameShell::DisplayUnlock()
105 ///////////////////////////////////////
107 // Verify display reflects what is expected
110 STDMETHODIMP_(void) cDosGameShell::DisplayFlush()
114 ///////////////////////////////////////
116 // Get the present tick count, in msec since initialization or timer restart
119 STDMETHODIMP_(unsigned long) cDosGameShell::GetTimerTick()
121 // @Note (toml 10-21-96): This is a totally fake time, stuck on ticks. Gotta fix
122 return clock() / CLOCKS_PER_SEC
;
125 ///////////////////////////////////////
127 // Reset the timer (by default, starts at zero from initialization)
130 STDMETHODIMP_(void) cDosGameShell::SetTimer(unsigned long )
134 ///////////////////////////////////////
136 STDMETHODIMP_(BOOL
) cDosGameShell::ShowHelp(const char * , uint
, ulong
)
141 ///////////////////////////////////////
143 STDMETHODIMP_(BOOL
) cDosGameShell::SetOSCursor(sGrBitmap
* , const Point
* )
148 ///////////////////////////////////////
150 STDMETHODIMP_(BOOL
) cDosGameShell::ShowOSCursor(BOOL
)
155 ///////////////////////////////////////
157 STDMETHODIMP_(void) cDosGameShell::SetCursorCallback(tGSCursorCallbackFunc
)
161 ///////////////////////////////////////
163 STDMETHODIMP_(BOOL
) cDosGameShell::Exec(const char * pszCommandLine
)
168 ///////////////////////////////////////////////////////////////////////////////
170 STDMETHODIMP_(BOOL
) cDosGameShell::SetFlags(int )
175 ///////////////////////////////////////////////////////////////////////////////
177 STDMETHODIMP_(BOOL
) cDosGameShell::GetFlags(int * )
182 ///////////////////////////////////////////////////////////////////////////////