-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWWindow.h
More file actions
executable file
·55 lines (47 loc) · 1.64 KB
/
WWindow.h
File metadata and controls
executable file
·55 lines (47 loc) · 1.64 KB
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
#pragma once
#include <d3dx9.h>
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
//#include <iostream.h>
#define SafeRelease(pObject) if(pObject != NULL) {pObject->Release(); pObject=NULL;}
//---------------------------------------------------------------------------
class WWindow
{
public:
// We will use a default constructor to declare a window
WWindow();
// The Create() method wil be used to initialize a window
HWND Create(HINSTANCE hinst,
LPCTSTR clsname,
LPCTSTR wndname,
HWND parent = NULL,
DWORD dStyle = WS_OVERLAPPEDWINDOW,
DWORD dXStyle = 0L,
int x = CW_USEDEFAULT,
int y = CW_USEDEFAULT,
int width = CW_USEDEFAULT,
int height = CW_USEDEFAULT);
// This method will be used to display the window
BOOL Show(int dCmdShow = SW_SHOWNORMAL);
// Because each window is of type HWND, we will need a way
// to recognize the window handle when used in our application
operator HWND();
/************************************************************
*GLOBALS
*************************************************************/
LPDIRECT3D9 g_pD3D; // Direct3D Pointer
LPDIRECT3DDEVICE9 g_pD3DDevice; // Device Pointer
HWND getHandle();
void setHandle(HWND newHandle);
HRESULT InitialiseD3D(HWND hWnd);
void CleanUp();
int getScreenWidth();
int getScreenHeight();
void setScreenWidth(int newWidth);
void setScreenHeight(int newHeight);
private:
HWND handle;
int screenWidth;
int screenHeight;
};
//---------------------------------------------------------------------------