added directx and divx checkers and divx auto installer

This commit is contained in:
Chris Danford
2001-11-26 08:28:48 +00:00
parent 6dee14eb22
commit 6d5e88563a
5 changed files with 133 additions and 1 deletions
+30 -1
View File
@@ -67,7 +67,7 @@ void Update(); // Update the game logic
void Render(); // Render a frame
void ShowFrame(); // Display the contents of the back buffer to the screen
void SetFullscreen( BOOL bFullscreen ); // Switch between fullscreen and windowed modes.
void TestForDirectX(); // check for DirectX 8
// Functions that work with game objects
HRESULT CreateObjects( HWND hWnd ); // allocate and initialize game objects
@@ -123,6 +123,9 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow )
if( NULL == g_hWndMain )
exit(1);
TestForDirectX();
// Load keyboard accelerators
HACCEL hAccel = LoadAccelerators( NULL, MAKEINTRESOURCE(IDR_MAIN_ACCEL) );
@@ -478,3 +481,29 @@ void SetFullscreen( BOOL bFullscreen )
SCREEN_HEIGHT );
RestoreObjects();
}
//-----------------------------------------------------------------------------
// Name: TestForDirectX()
// Desc: check for DirectX 8
//-----------------------------------------------------------------------------
#include "getdxver.h"
void TestForDirectX()
{
if( GetDXVersion() < 0x0800 )
{
int iRetVal = MessageBox( NULL, "We're sorry, but you have an old version of the Microsoft DirectX drivers.\n\
This application requires DirectX version 8.1 or higher.\n\n\
Would you like to visit the Microsoft DirectX site to download the latest version?", "Sorry", MB_YESNO|MB_ICONSTOP );
if( iRetVal == IDYES )
{
GotoURL("http://www.microsoft.com/directx/homeuser/downloads/default.asp");
}
exit(1);
}
}