//************************************************
//
//【Visual C++】游戏开发笔记系列配套源码 二十六
// Note_Code_26
// VS2010版
// 2012年 6月24日 Create by 毛星云
//源码配套博文链接 http://blog.csdn.net/zhmxy555/article/details/7688515
//更多内容请访问我的博客 http://blog.csdn.net/zhmxy555
//
//************************************************
#include<Windows.h>
//函数声明
LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam );
//****wWinMain函数,程序入口点函数**************************************
int WINAPI wWinMain( HINSTANCE hInstance, HINSTANCE prevInstance, LPWSTR cmdLine, int cmdShow )
{
UNREFERENCED_PARAMETER( prevInstance );
UNREFERENCED_PARAMETER( cmdLine );
WNDCLASSEX wndClass = { 0 };
wndClass.cbSize = sizeof( WNDCLASSEX ) ;
wndClass.style = CS_HREDRAW | CS_VREDRAW;
wndClass.lpfnWndProc = WndProc;
wndClass.hInstance = hInstance;
wndClass.hCursor = LoadCursor( NULL, IDC_ARROW );
wndClass.hbrBackground = ( HBRUSH )( COLOR_WINDOW + 1 );
wndClass.lpszMenuName = NULL;
wndClass.lpszClassName = "DX11BookWindowClass";
if( !RegisterClassEx( &wndClass ) )
return -1;
RECT rc = { 0, 0, 640, 480 };
AdjustWindowRect( &rc, WS_OVERLAPPEDWINDOW, FALSE );
HWND hwnd = CreateWindowA( "DX11BookWindowClass", "Blank Win32 Window",
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, rc.right - rc.left,
rc.bottom - rc.top, NULL, NULL, hInstance, NULL );
if( !hwnd )
return -1;
ShowWindow( hwnd, cmdShow );
// 初始化
MSG msg = { 0 };
while( msg.message != WM_QUIT )
{
if( PeekMessage( &msg, 0, 0, 0, PM_REMOVE ) )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
else
{
// 进行更新
// 进行绘图操作
}
}
// 收尾工作
return static_cast<int>( msg.wParam );
}
//****消息处理函数***********************************
LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam )
{
PAINTSTRUCT paintStruct;
HDC hDC;
switch( message )
{
case WM_PAINT:
hDC = BeginPaint( hwnd, &paintStruct );
EndPaint( hwnd, &paintStruct );
break;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
default:
return DefWindowProc( hwnd, message, wParam, lParam );
}
return 0;
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
博文的配套源码 《 【Visual C++】游戏开发笔记二十六 DirectX 11各组件的介绍&第一个DirectX 11 Demo的创建》 ,文章地址为http://blog.csdn.net/zhmxy555/article/details/7688515, 点击debug下的exe文件可以直接看到运行效果。 此为VS2010版,若没有安装VS2010以上版本的朋友,请用记事本打开,main.cpp文件并复制里面的代码,用自己的IDE新建工程,贴入代码即可。 我的博客地址是http://blog.csdn.net/zhmxy555,源码结合配套文章一起看效果更佳。 当然,必须是0资源分下载~~~~~~~~ 希望能和大家一起交流,共同学习,共同进步。
资源推荐
资源详情
资源评论
收起资源包目录
【Visual C++】Code_Note_26.rar (38个子文件)
【Visual C++】Code_Note_26
BlankWindowDemo.sln 912B
BlankWindowDemo.suo 13KB
BlankWindowDemo
BlankWindowDemo.vcxproj 4KB
main.cpp 2KB
BlankWindowDemo.vcxproj.user 143B
BlankWindowDemo.vcxproj.filters 942B
Debug
vc100.idb 347KB
BlankWindowDemo.exe.intermediate.manifest 381B
BlankWindowDemo.exe.embed.manifest 406B
CL.write.1.tlog 366B
BlankWindowDemo.log 3KB
CL.read.1.tlog 12KB
mt.read.1.tlog 370B
rc.write.1.tlog 350B
link.10256.write.1.tlog 2B
rc.read.1.tlog 342B
BlankWindowDemo.exe.embed.manifest.res 472B
mt.command.1.tlog 442B
cl.command.1.tlog 642B
link-cvtres.read.1.tlog 2B
main.obj 25KB
link.write.1.tlog 842B
link.10256-cvtres.write.1.tlog 2B
link.10256.read.1.tlog 2B
link-cvtres.write.1.tlog 2B
BlankWindowDemo.lastbuildstate 57B
link.command.1.tlog 2KB
rc.command.1.tlog 628B
link.read.1.tlog 3KB
BlankWindowDemo_manifest.rc 220B
link.10256-cvtres.read.1.tlog 2B
mt.write.1.tlog 370B
vc100.pdb 100KB
BlankWindowDemo.sdf 24.02MB
ipch
blankwindowdemo-cb631ccb
blankwindowdemo-f9133e11.ipch 30.63MB
Debug
BlankWindowDemo.exe 30KB
BlankWindowDemo.ilk 330KB
BlankWindowDemo.pdb 427KB
共 38 条
- 1
浅墨_毛星云
- 粉丝: 4w+
- 资源: 80
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页