博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
VS 2008 修改C++文件默认模板
阅读量:7028 次
发布时间:2019-06-28

本文共 2050 字,大约阅读时间需要 6 分钟。

1.找到目录..\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcprojectitems 下的newc++file.cpp文件;

2.用管理员身份运行记事本程序打开该文件(win7中直接打开无法修改);

3.修改该模板文件,成功。

newc++file.cpp
1 /* 2 Author: ShiJiabin@nbu.cn 3 */ 4 #include "D3D9_Utility.h" 5  6 /* 7 * Globals 8 */ 9 10 IDirect3DDevice9* Device = 0;11 12 /*13 * Framework Functions14 */15 16 bool Setup()17 {18     // Nothing to setup in this sample.19     return true;20 }21 22 void Cleanup()23 {24     // Nothing to cleanup in this sample.25 }26 27 bool Display(float timeDelta)28 {29     if ( Device )30     {31         // Instruct the device to set each pixel on the back buffer black -32         // D3DCLEAR_TARGET: 0x00000000 (black) - and to set each pixel on33         // the depth buffer to a value of 1.0 - D3DCLEAR_ZBUFFER: 1.0f.34         Device->Clear(0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0);35 36         // Swap the back and front buffers.37         Device->Present(0, 0, 0, 0);38 39     }40     return true;41 }42 43 /*44 * WndProc45 */46 47 LRESULT CALLBACK D3D9::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)48 {49     switch( msg)50     {51     case WM_DESTROY:52         PostQuitMessage(0);53         break;54     case WM_KEYDOWN:55         if (wParam == VK_ESCAPE)56             DestroyWindow(hwnd);57         break;58     }59     return DefWindowProc(hwnd, msg, wParam, lParam);60 }61 62 /*63 * WinMain64 */65 66 int WINAPI WinMain(HINSTANCE hinstance,67                    HINSTANCE prevInstance,68                    PSTR cmdLine,69                    int showCmd)70 {71     if ( !D3D9::InitD3D(hinstance,72         Width, Height, true, D3DDEVTYPE_HAL, &Device) )73     {74         MessageBox(0, TEXT("InitD3D() - FAILED"), 0, 0);75         return 0;76     }77 78     if (!Setup())79     {80         MessageBox(0, TEXT("Setup() - FAILED"), 0, 0);81         return 0;82     }83 84     D3D9::EnterMsgLoop( Display );85 86     Cleanup();87 88     Device->Release();89 90     return 0;91 }

 

 

转载于:https://www.cnblogs.com/superbin/archive/2012/11/18/2775616.html

你可能感兴趣的文章
我的友情链接
查看>>
CXF+Spring+Hibernate实现RESTful webservice服务端示例
查看>>
HTML网络效果收集---HTML
查看>>
css @语法,@规则 @import @charset @font-face @fontdef @media @page
查看>>
asp.net系统过滤器、自定义过滤器
查看>>
CSS3 Animation
查看>>
重新认识java-忽视的注释
查看>>
Sierpinski三角
查看>>
Dos下查看端口
查看>>
深入探讨Java类加载器
查看>>
Go 开发 HTTP
查看>>
textview的滚动
查看>>
使用JQuery.validate后的bootstrap风格校验提示‏
查看>>
jvm gc日志分析
查看>>
springmvc hello-servlet.xml配置文件
查看>>
kindeditor + syntaxhighlighter 使文章内的插入代码高亮显示
查看>>
angular2 学习二 [property] - 绑定属性
查看>>
airodump-ng wlan0mon doesn't work
查看>>
iostat 实例分析
查看>>
php学习日记
查看>>