开发者

stop vb.net pausing when i scroll or move windows

I'm making... well, it's sort of like a game in VB.net (using VS2008, if it matters). Being sort of like a game, it's dependent on timing, but it also has a large area (have to scroll the window on pretty much any resolution).

The problem I'm having is that whenever I scroll the window (or move any of the smaller, additional windows) the program pauses what it's doing, and doesn't start again until I stop scrolling (or moving windows, or whatever).

I hate to sound picky, but the program keeping track of how much time it's lost and making it up for it when you're finished scrolli开发者_JAVA百科ng isn't going to cut it.

So is there any way to stop it pausing when you scroll or move windows? Thanks for your answers.


Essentially, you can’t (reliably). Don’t use scroll controls, or in fact any controls at all. It’s a common beginners’ error to use multiple controls in a game.

Render all your game in one PictureBox control and scroll that using e.g. the ScrollDC Windows API function, or by building up the graphic incrementally as the user scrolls. This is more difficult but also usually more efficient since you only need to draw a smaller area (i.e. the visible area, and nothing more).

If that’s not fast enough, chances are that GDI+ graphics won’t cut it and you need to resort to DirectX/XNA.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜