游戏开发论坛

 找回密码
 立即注册
搜索
查看: 1845|回复: 4

DX9?MFC共存

[复制链接]

414

主题

611

帖子

621

积分

高级会员

Rank: 4

积分
621
发表于 2005-11-2 01:20:00 | 显示全部楼层 |阅读模式
//程式的header如此?s出?很多的warning,但是?绦惺强梢猿晒Φ
//我?掉所有的warning,???如何做
//?是一??DirectX9.0的?例我想加入MFC,include <afxwin.h>

#ifndef __d3dUtilityH__
#define __d3dUtilityH__

#include <afxwin.h>
#pragma warning(disable: 4786)
#pragma warning(disable: 4663)
#pragma warning(disable: 4018)
#pragma warning(disable: 4100)

#include <d3dx9.h>
#include <string>

#include <mmsystem.h>

namespace d3d
{
bool InitD3D(
HINSTANCE hInstance, // [in] Application instance.
int width, int height, // [in] Backbuffer dimensions.
bool windowed, // [in] Windowed (true)or full screen (false).
D3DDEVTYPE deviceType, // [in] HAL or REF
IDirect3DDevice9** device);// [out]The created device.

int EnterMsgLoop(
bool (*ptr_display)(float timeDelta));

LRESULT CALLBACK WndProc(
HWND hwnd,
Uint msg,
WPARAM wParam,
LPARAM lParam);

template<class T> void Release(T t)
{
if( t )
{
t->Release();
t = 0;
}
}

template<class T> void Delete(T t)
{
if( t )
{
delete t;
t = 0;
}
}
}

#endif // __d3dUtilityH__


/////
出?的warning如下

Compiling...
d3dInit.cpp
c:\program files\microsoft visual studio\vc98\include\xlocale(296) : warning C4663: C++ language change: to explicitly specialize class template 'codecvt' use the following syntax:
     template<> class codecvt<unsigned short,char,int> ...
c:\program files\microsoft visual studio\vc98\include\xlocale(387) : warning C4018: '<' : signed/unsigned mismatch
c:\program files\microsoft visual studio\vc98\include\xlocale(519) : warning C4663: C++ language change: to explicitly specialize class template 'ctype' use the following syntax:
     template<> class ctype<char> ...

182

主题

445

帖子

459

积分

中级会员

Rank: 3Rank: 3

积分
459
QQ
发表于 2005-11-2 13:07:00 | 显示全部楼层

Re:DX9?MFC共存

什么叫共存?
本来就不冲突

2

主题

19

帖子

31

积分

注册会员

Rank: 2

积分
31
发表于 2005-11-2 14:07:00 | 显示全部楼层

Re: DX9?MFC共存

我已经用MFC写了几个地图编辑器的东东,
主窗口里就是用DX9渲染得呀。
看来楼主在DX方面还有很大的成长空间。

414

主题

611

帖子

621

积分

高级会员

Rank: 4

积分
621
 楼主| 发表于 2005-11-2 23:21:00 | 显示全部楼层

Re:DX9?MFC共存

我是以win32 project然後include afxwin.h
不是以 MFC Project去加入DX9
??? michaelalei
你是用VC++6.0或VC++.Net
是用Win32 project或MFC project?

2

主题

19

帖子

31

积分

注册会员

Rank: 2

积分
31
发表于 2005-11-3 09:36:00 | 显示全部楼层

Re: DX9?MFC共存

是在VC++.Net下建立的MFC Project。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2026-1-22 11:50

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表