DirectX 9“加载纹理”进度条

发布于 2024-09-24 14:55:02 字数 83 浏览 1 评论 0原文

它不需要看起来像进度条。
我需要它说的是“正在加载图像...”,而纹理正在加载,然后在加载完成时说“完成”。

我不知道该怎么做?

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

十二 2024-10-01 14:55:02

我在我正在开发的 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's DrawText 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 my redraw function was called, so before I loaded the textures, I added a Dialog 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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文