summaryrefslogtreecommitdiff
path: root/engine/igame.h
diff options
context:
space:
mode:
Diffstat (limited to 'engine/igame.h')
-rw-r--r--engine/igame.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/engine/igame.h b/engine/igame.h
new file mode 100644
index 0000000..90f37c2
--- /dev/null
+++ b/engine/igame.h
@@ -0,0 +1,60 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $Workfile: $
+// $Date: $
+// $NoKeywords: $
+//===========================================================================//
+#ifndef IGAME_H
+#define IGAME_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+class IGame
+{
+public:
+ virtual ~IGame( void ) { }
+
+ virtual bool Init( void *pvInstance ) = 0;
+ virtual bool Shutdown( void ) = 0;
+
+ virtual bool CreateGameWindow( void ) = 0;
+ virtual void DestroyGameWindow( void ) = 0;
+
+ // This is used in edit mode to specify a particular game window (created by hammer)
+ virtual void SetGameWindow( void* hWnd ) = 0;
+
+ // This is used in edit mode to override the default wnd proc associated w/
+ // the game window specified in SetGameWindow.
+ virtual bool InputAttachToGameWindow() = 0;
+ virtual void InputDetachFromGameWindow() = 0;
+
+ virtual void PlayStartupVideos( void ) = 0;
+
+ // This will be the SDL_Window* under SDL, the WindowRef under Mac, and
+ // the HWND on Win32.
+ virtual void* GetMainWindow( void ) = 0;
+ // This will be the HWND under Direct3D, and the SDL_Window* or
+ // WindowRef under GL.
+ virtual void* GetMainDeviceWindow( void ) = 0;
+
+ virtual void** GetMainWindowAddress( void ) = 0;
+ virtual void GetDesktopInfo( int &width, int &height, int &refreshrate ) = 0;
+
+ virtual void SetWindowXY( int x, int y ) = 0;
+ virtual void SetWindowSize( int w, int h ) = 0;
+
+ virtual void GetWindowRect( int *x, int *y, int *w, int *h ) = 0;
+
+ // Not Alt-Tabbed away
+ virtual bool IsActiveApp( void ) = 0;
+
+ virtual void DispatchAllStoredGameMessages() = 0;
+};
+
+extern IGame *game;
+
+#endif // IGAME_H