游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2335|回复: 5

关于surface->GetDC()

[复制链接]

13

主题

25

帖子

25

积分

注册会员

Rank: 2

积分
25
发表于 2008-4-11 12:12:00 | 显示全部楼层 |阅读模式
为什么我调用总是失败?surface是从texture取得的

54

主题

2916

帖子

3765

积分

论坛元老

Rank: 8Rank: 8

积分
3765
QQ
发表于 2008-4-11 17:36:00 | 显示全部楼层

Re:关于surface->GetDC()

也许得用这个生成的Surface才行:
IDirect3DDevice9::CreateOffscreenPlainSurface

14

主题

345

帖子

376

积分

中级会员

Rank: 3Rank: 3

积分
376
QQ
发表于 2008-4-12 19:25:00 | 显示全部楼层

Re:关于surface->GetDC()

IDirect3DSurface9::GetDC is valid on the following formats only: D3DFMT_R5G6B5, D3DFMT_X1R5G5B5, D3DFMT_R8G8B8, and D3DFMT_X8R8G8B8. Formats that contain Alpha are not supported because the GDI implementations don't have a well-defined behavior on the alpha channel. For more information about formats, see D3DFORMAT.

14

主题

345

帖子

376

积分

中级会员

Rank: 3Rank: 3

积分
376
QQ
发表于 2008-4-12 19:26:00 | 显示全部楼层

Re:关于surface->GetDC()

IDirect3DSurface9::GetDC will fail if the surface is already locked. If the surface is a member of a mipmap or cubemap, IDirect3DSurface9::GetDC fails if any other mipmap or cubemap member is locked.
IDirect3DSurface9::GetDC fails on render targets unless they were created lockable (or, in the case of back buffers, with the D3DPRESENTFLAG_LOCKABLE_BACKBUFFER flag).
For surfaces not created with IDirect3DDevice9::CreateOffscreenPlainSurface, IDirect3DSurface9::GetDC will fail on default pool (D3DPOOL_DEFAULT) surfaces unless they are dynamic (D3DUSAGE_DYNAMIC) or are lockable render targets.
IDirect3DSurface9::GetDC will fail on D3DPOOL_SCRATCH surfaces.

13

主题

25

帖子

25

积分

注册会员

Rank: 2

积分
25
 楼主| 发表于 2008-4-14 09:21:00 | 显示全部楼层

Re:关于surface->GetDC()

是这样的,我在系统内存里建立的一个Texture,然后直接从这个Texture取的一个表面,这个Texture的Format是D3DFMT_X8R8G8B8,再GetDC就出错了。

13

主题

25

帖子

25

积分

注册会员

Rank: 2

积分
25
 楼主| 发表于 2008-4-14 09:24:00 | 显示全部楼层

Re:关于surface->GetDC()

OK,已经解决拉
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2026-1-22 20:03

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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