convert line ends
[canaan.git] / prj / tech / libsrc / gameshel / dgshell.cpp
blob260f6b85e7c0fdce89685347955505b9701567ee
1 ///////////////////////////////////////////////////////////////////////////////
2 // $Source: x:/prj/tech/libsrc/gameshel/RCS/dgshell.cpp $
3 // $Author: KEVIN $
4 // $Date: 1997/09/03 17:06:39 $
5 // $Revision: 1.9 $
6 //
8 #include <lg.h>
9 #include <time.h>
10 #include <dgshell.h>
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,
41 IID_IGameShell, this,
42 kPriorityLibrary,
43 NULL );
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()
92 return 1;
95 ///////////////////////////////////////
97 // Release a lock on memory
100 STDMETHODIMP_(int) cDosGameShell::DisplayUnlock()
102 return 0;
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 )
138 return FALSE;
141 ///////////////////////////////////////
143 STDMETHODIMP_(BOOL) cDosGameShell::SetOSCursor(sGrBitmap * , const Point * )
145 return FALSE;
148 ///////////////////////////////////////
150 STDMETHODIMP_(BOOL) cDosGameShell::ShowOSCursor(BOOL)
152 return FALSE;
155 ///////////////////////////////////////
157 STDMETHODIMP_(void) cDosGameShell::SetCursorCallback(tGSCursorCallbackFunc)
161 ///////////////////////////////////////
163 STDMETHODIMP_(BOOL) cDosGameShell::Exec(const char * pszCommandLine )
165 return FALSE;
168 ///////////////////////////////////////////////////////////////////////////////
170 STDMETHODIMP_(BOOL) cDosGameShell::SetFlags(int )
172 return FALSE;
175 ///////////////////////////////////////////////////////////////////////////////
177 STDMETHODIMP_(BOOL) cDosGameShell::GetFlags(int * )
179 return FALSE;
182 ///////////////////////////////////////////////////////////////////////////////