⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.h

📁 <B>很多DirectX 9.0游戏编程源码例子</B>
💻 H
字号:
//-----------------------------------------------------------------------------
// Name: D3D_MouseZones
//
// Description: Example code showing how to implement simple menu navigation
//				in a game. 
//
// File Function: Header file for the program (main.h)
//
// Code: 
//		Copyright (c) 2002 LostLogic Corporation. All rights reserved.
//
// Libraries Required:
//		d3d9.lib dxguid.lib d3dx9dt.lib d3dxof.lib comctl32.lib	winmm.lib
//
// Local Files Required:
//		main.cpp
//		main.h
//		MouseZoneClass.h
//		MouseZoneClass.cpp
//
// DX Files: 
//		Copyright (c) 1997-2001 Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#ifndef MAIN_H
#define MAIN_H

#define STRICT
#include <windows.h>
#include <commctrl.h>
#include <commdlg.h>
#include <math.h>
#include <tchar.h>
#include <stdio.h>
#include <D3DX9.h>
#include "DXUtil.h"
#include "D3DUtil.h"
#include "MouseZoneClass.h"

//-----------------------------------------------------------------------------
// Global variables
//-----------------------------------------------------------------------------
LPDIRECT3D9             g_pD3D				= NULL; // Used to create the D3DDevice
LPDIRECT3DDEVICE9       g_pd3dDevice		= NULL; // Our rendering device
LPDIRECT3DVERTEXBUFFER9 g_pVBInterface		= NULL; // Buffer to hold vertices

// Global array to hold interface graphics
LPDIRECT3DTEXTURE9      g_pTexture[ 32 ];

// Viewable window offsets
int						g_iXOffset = 0;
int						g_iYOffset = 0;

// Window dimensions
int						g_iWindowWidth	= 640;
int						g_iWindowHeight = 480;

// A structure for our custom vertex type
struct CUSTOMVERTEX
{
    D3DXVECTOR3 position;	// The position
	D3DXVECTOR3 vecNorm;	// The normal
    FLOAT       tu, tv;		// The texture coordinates
	FLOAT       tu2, tv2;   // The texture coordinates
};
// Custom FVF, which describes the custom vertex structure
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX2)

//-----------------------------------------------------------------------------
// Function headers
//-----------------------------------------------------------------------------
void vDrawInterfaceObject( int iXPos, int iYPos, float fXSize, float fYSize, int iTexture );
void vInitInterfaceObjects( void );
LRESULT WINAPI fnMessageProcessor( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
HRESULT InitD3D( HWND hWnd );
void vRender( void );
void vCleanup( void );
void vCheckInput( void );
void vSetupMouseZones( int iMenu );

// Global mouse zone class
MouseZoneClass	MZones;

// Navigation menu ID
int		g_iCurrentScreen = 0;

// Mouse button state variables
bool	g_bLeftButton = 0;
bool	g_bRightButton = 0;

// Global handle to the game window
HWND	g_hWnd;

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -