游戏开发论坛

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

In DirectX9, how to swap fastly two textures

[复制链接]

414

主题

611

帖子

621

积分

高级会员

Rank: 4

积分
621
发表于 2008-3-8 01:37:00 | 显示全部楼层 |阅读模式
LPDIRECT3DTEXTURE9 texture1;
LPDIRECT3DTEXTURE9 texture2;

CreateTexture....

I have a special case and need to swap two textures.
How do I reach the goal to swap them?
If the two textures have the same size and format.

way1:
LPDIRECT3DTEXTURE9 texture3;
texture3=texture1;
texture1=texture2;
texture2=texture3;

way2:
Lock the two textures and memcpy the pBits of the D3DLOCKED_RECT.
But I have a problem how do I know the pBits's size?

Or another way that is fast.

1

主题

57

帖子

59

积分

注册会员

Rank: 2

积分
59
QQ
发表于 2008-3-8 11:11:00 | 显示全部楼层

Re:In DirectX9, how to swap fastly two textures

Oh my god!A foreign guy?

22

主题

309

帖子

353

积分

中级会员

Rank: 3Rank: 3

积分
353
QQ
发表于 2008-3-8 11:47:00 | 显示全部楼层

Re:In DirectX9, how to swap fastly two textures

交换指针就可以了吧-_-

119

主题

1367

帖子

1393

积分

金牌会员

Rank: 6Rank: 6

积分
1393
发表于 2008-3-8 13:14:00 | 显示全部楼层

Re:In DirectX9, how to swap fastly two textures

The way1 is enough, only point swap

1

主题

11

帖子

11

积分

新手上路

Rank: 1

积分
11
发表于 2008-3-9 01:10:00 | 显示全部楼层

Re: Re:In DirectX9, how to swap fastly two textures

r2power: Re:In DirectX9, how to swap fastly two textures

Oh my god!A foreign guy?



应该是台湾的吧
我在gamedev上见过这ID

414

主题

611

帖子

621

积分

高级会员

Rank: 4

积分
621
 楼主| 发表于 2008-3-19 01:59:00 | 显示全部楼层

Re:In DirectX9, how to swap fastly two textures

??GameDev的也是我,我在台?车?您??好
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2025-12-20 11:07

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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