DirectX 9“加载纹理”进度条
它不需要看起来像进度条。
我需要它说的是“正在加载图像...”,而纹理正在加载,然后在加载完成时说“完成”。
我不知道该怎么做?
It doesn't need to look like a progress bar.
All I need it to say is "Loading images..." while the texture is loading, then saying "Done" when it's done loading.
I have no idea, how to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在我正在开发的 DirectX 应用程序中做过类似的事情。
其背后的想法是使用 D3DXSPRITE 接口将文本绘制到屏幕上。开始使用 Direct3D 设备绘制场景,开始使用精灵进行绘制,调用精灵的
DrawText
函数,然后结束精灵和设备场景。注意:这要求您在开始加载纹理之前初始化 Direct3D 设备和精灵。
我这样做的方式是,我有一堆
Dialog/Popup
对象,每次调用redraw
函数时,我都会将它们绘制到屏幕上,所以在加载纹理之前,我添加了一个带有加载消息的Dialog
,重新绘制了屏幕,然后开始加载,然后用“完成!”替换/修改了对话框。消息,并重新绘制。希望有帮助!
I've done something like this in a DirectX application I was working on.
The idea behind it is to use the
D3DXSPRITE
interface to draw text to the screen. Begin drawing the scene with the Direct3D device, begin drawing with the sprite, call the sprite'sDrawText
function, and then end the sprite and the device scene.NOTE: This requires that your Direct3D device and sprite be initialized before you start loading textures.
The way I did it was that I had a stack of
Dialog/Popup
objects that I drew to the screen every time myredraw
function was called, so before I loaded the textures, I added aDialog
with the loading message, redrew the screen, then started loading, and then replaced/modified the dialog with the "Done!" message, and redrew again.Hope it helps!