220#if TGR_RENDERER == TGR_RENDERER_GLIDE
bool FocusExistingBossRallyInstance(void)
Bring an instance of the game that is already running to the front.
LRESULT HandleWindowClose(HWND hWnd)
Handle WM_CLOSE.
int DestroyMainWindow(void)
Destroy the main window and its renderer.
LRESULT DetachRenderDeviceFromWindow(HWND hWnd, LPARAM lParam)
Clear the renderer that is releasing its objects from the user data of its window.
int(* g_apfnGameStateHandlers[])(void)
The routine that runs a frame of each state of the game.
bool CreateMainWindow(void)
Create the main window.
int g_nRallyMainCmdShow
The initial window display mode passed to RallyMain().
WPARAM g_dwAppActive
The first parameter of the last WM_ACTIVATE.
char g_szInstallDirectory[]
Directory the game is installed in, read from the registry, with a trailing separator.
LRESULT HandleWindowMove(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_MOVE.
int g_dwActivateMinimized
Whether the main window is minimised.
LRESULT HandleWindowSetCursor(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_SETCURSOR.
LRESULT HandleWindowEnterMenuLoop(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_ENTERMENULOOP.
LRESULT HandleWindowActivate(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_ACTIVATE.
LRESULT HandleWindowSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_SYSCOMMAND.
HINSTANCE g_hAppInstance
The module of the game, set by InitializeApplication().
int g_dwGameModeFrameCounter
The frames the mode of the game has run.
void UpdateAppActiveStateFromActivate(WPARAM wParam)
Set whether the application is active from the state of WM_ACTIVATE.
LRESULT HandleWindowGetMinMaxInfo(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_GETMINMAXINFO.
HINSTANCE g_hRallyMainPrevInstance
The previous application instance passed to RallyMain().
void GetDXVersion(unsigned *pdwVersion, unsigned *pdwPlatform)
Query the installed DirectX version by creating its objects in turn.
void ShowGlideSplashImage(const char *pszPath, int nChecksum)
Show an image of the Glide library over the whole screen.
LRESULT HandleWindowCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_COMMAND.
HRESULT CreateRenderWindow(DWORD dwExStyle, LPCSTR pszClassName, LPCSTR pszWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hParent, HMENU hMenu, HINSTANCE hInstance, LPVOID pParam, GUID *pDriverGuid, int nUnused, HWND *phWnd, DirectDrawRenderer **ppRenderer)
Create a window and the renderer that draws into it, and show the window.
int GameState_InitResources(void)
Open the pod of the game files, load the first sound set and the names of the controls of the game co...
HINSTANCE g_hRallyMainInstance
Arguments of WinMain() as the launcher passed them to RallyMain().
void ShutdownMainWindow(void)
Destroy the main window.
int GameState_ShowLoadingScreenAndInitGame(void)
Set the display mode of the configuration, show the loading screen, set up the game,...
LRESULT HandleWindowDestroy(HWND hWnd)
Handle WM_DESTROY.
HACCEL g_hAccelTable
The keyboard accelerators of the main window.
LRESULT HandleWindowActivateApp(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_ACTIVATEAPP.
LRESULT HandleWindowExitMenuLoop(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_EXITMENULOOP.
LRESULT HandleWindowPosChanging(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_WINDOWPOSCHANGING.
@ GAME_STATE_INIT_RESOURCES
Definition app.h:115
@ GAME_STATE_RUN_FRONT_END
Definition app.h:119
@ GAME_STATE_ENTER_GAME_MODE
Definition app.h:116
@ GAME_STATE_RUN_GAME_MODE
Definition app.h:117
@ GAME_STATE_LOAD_GAME
Definition app.h:118
HWND g_hMainWindow
The main window.
int g_dwGameModeContinue
What GameState_RunGameMode() returns, 1 at the start.
int g_dwAppExitCode
Exit code RallyMain() returns to the launcher.
int GameState_RunFrontEnd(void)
Run a frame of the front end.
bool InitializeApplication(void)
Start the application: refuse DirectX before version 6 and a second instance, then create the main wi...
LPSTR g_pszRallyMainCmdLine
The command line passed to RallyMain().
LRESULT HandleDisplayChange(HWND hWnd)
Handle WM_DISPLAYCHANGE.
LRESULT AttachRenderDeviceToWindow(HWND hWnd, LPARAM lParam)
Store the renderer that has created its objects in the user data of its window.
LRESULT HandleWindowSize(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_SIZE.
int GameState_EnterGameMode(void)
Go on to run the mode of the game.
void ReadInstallDirectoryFromRegistry(void)
Read the install directory from the registry into g_szInstallDirectory.
void SetGameStateFrontEnd(void)
Go back to the front end after a game, setting it up again.
LRESULT HandleWindowNcPaint(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_NCPAINT.
bool OpenBossRallyPodAndInit(void)
Open BossRally.pod, and set up the renderer, the damage bitmaps of the paint, DirectInput,...
int DispatchGameStateFrame(void)
Run a frame of the current state of the game.
void RefreshTotalPhysicalMemory(void)
Read the amount of physical memory the machine has.
LRESULT CALLBACK MainWindowProc(HWND hWnd, UINT nMessage, WPARAM wParam, LPARAM lParam)
Handle the messages of the main window.
HCURSOR g_hArrowCursor
The arrow cursor of the main window.
int g_dwGameState
The state of the game, an index into g_apfnGameStateHandlers.
size_t g_dwTotalPhysicalMemory
The amount of physical memory of the machine, in bytes.
void RunMessageLoop(void)
Run the message loop until the game quits.
int GameState_RunGameMode(void)
Run a frame of the mode of the game.
DirectDrawRenderer * g_pMainRenderWindow
The renderer of the main window.
LRESULT HandleWindowEraseBackground(HWND hWnd, WPARAM wParam, LPARAM lParam)
Handle WM_ERASEBKGND.
int g_dwActivateState
How the main window is activated, WA_INACTIVE, WA_ACTIVE, or WA_CLICKACTIVE.
The DirectDraw and Direct3D objects of a window.
Definition renderer.h:652
The size of the frame, and the routines of the screen the main loop calls.
The state of the session of the Boss Rally release the race shares with the front end.