Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Main.cpp
Package: directx8中文教程.zip [view]
Upload User: whgydz
Upload Date: 2007-01-12
Package Size: 2259k
Code Size: 2k
Category:
Other Books
Development Platform:
HTML/CSS
- #include "Game.h"
- CGame* g_pGame = NULL;
- void CleanUp()
- {
- SafeDelete(g_pGame);
- }
- //The windows message handler
- LRESULT WINAPI WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- switch(msg)
- {
- case WM_DESTROY:
- PostQuitMessage(0);
- return 0;
- break;
- case WM_KEYUP:
- switch (wParam)
- {
- case VK_ESCAPE:
- //User has pressed the escape key, so quit
- DestroyWindow(hWnd);
- return 0;
- break;
- }
- break;
- }
- return DefWindowProc(hWnd, msg, wParam, lParam);
- }
- //Application entry point
- INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, INT)
- {
- //Register the window class
- WNDCLASSEX wc = {sizeof(WNDCLASSEX), CS_CLASSDC, WinProc, 0L, 0L,
- GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
- "DX Project 8", NULL};
- //Set the mouse pointer to an arrow
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- RegisterClassEx(&wc);
- //Create the application's window
- HWND hWnd = CreateWindow("DX Project 8", "www.andypike.com: Tutorial 8",
- WS_OVERLAPPEDWINDOW, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN),
- NULL, NULL, wc.hInstance, NULL);
- g_pGame = new CGame();
- g_pGame->EnableLogging();
- //Initialize Direct3D
- if(g_pGame->Initialise(hWnd, 800, 600))
- {
- //Show our window
- ShowWindow(hWnd, SW_SHOWDEFAULT);
- UpdateWindow(hWnd);
- //Start game running: Enter the game loop
- g_pGame->GameLoop();
- }
- CleanUp();
- UnregisterClass("DX Project 8", wc.hInstance);
- return 0;
- }