summaryrefslogtreecommitdiff
path: root/engine/igame.h
blob: 90f37c20c805daca6550e6d626022f4094e41090 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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