Chris Muench - writing managed 3D app for mobile devices
- Posted: Mar 16, 2006 at 8:10 PM
- 67,929 Views
- 13 Comments
Download
How do I download the videos?
- To download, right click the file type you would like and pick “Save target as…” or “Save link as…”
Why should I download videos from Channel9?
- It's an easy way to save the videos you like locally.
- You can save the videos in order to watch them offline.
- If all you want is to hear the audio, you can download the MP3!
Which version should I choose?
- If you want to view the video on your PC, Xbox or Media Center, download the High Quality WMV file (this is the highest quality version we have available).
- If you'd like a lower bitrate version, to reduce the download time or cost, then choose the Medium Quality WMV file.
- If you have a Zune, WP7, iPhone, iPad, or iPod device, choose the low or medium MP4 file.
- If you just want to hear the audio of the video, choose the MP3 file.
Right click “Save as…”
- Mid Quality WMV (Lo-band, Mobile)
- WMV (WMV Video)
Comments Closed
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
No, I'm not going to use some Commercial, ad ridden s*** off Download.com.
What's the expected growth of this segment?
EDIT: hm, looks like that game will not work on a HTC Universal. It throws an Microsoft.WindowsMobile.DirectX.DriverUnsupportedException.
[C]
Actually, CNet has a policy stating that no downloads they host will have ad-ware in it. There's no policy against annoying shareware, however
http://www.freedownloadmanager.org/
No ads, great bit of software.
Stephen.
There are just a couple things to keep in mind because of the reduced functionality on the mobile platform. Obvi, all the shaders and effects stuff in the programmable pipeline isn't included, but the next generation of mobile GPU's will be almost pc-quality..
I am still using OnPaint to render my scenes, like the code in this demo. There was a lot of debate about this in managed DirectX for winforms and Tom Miller posted a 'perfect' render loop using interop to hook into the windows message pump. Is there a perfect render loop that can be implemented in managed mobile DirectX development?
Personally I think performance is good enough using the builtin events and it's better to optimize the game code. But any increase in performance is welcome in pushing the edge
It helps to identify the D3DM driver and configure accordingly. On the HTC, a software reference driver cripples D3DM framerates
LINK:
http://blogs.msdn.com/markprenticems/archive/2006/03/10/547983.aspx
"Tom Miller posted a 'perfect' render loop" - I didn't see his render loop, but for games a simple yet effective loop that I use is this (pseudo-code):
while()
{
PeekMessage(&msg)
TranslateMessage(&msg)
DispatchMessage(&msg)
DoSomethingElseWithMessage(&msg)
Clear(&msg)
DoGameLoop()
Sleep(0) // throw in a Sleep(0) or Sleep(1) if having timing issues
}
That is the basis of it. You may want to loop to process all messages in the queue before calling DoGameLoop. And you may want to only call DoGameLoop every 1/60 of a second or something (use QueryPerformanceCounter for timing). But yeah basically that is it.
Ignore WM_PAINT by simply returning 0 and only draw the backbuffer to the screen in DoGameLoop and WM_ERASEBKGND messages (return non-zero for WM_ERASEBKGND).
Don't actually write game code in WNDPROC, just build a queue of received input and process the queue in DoGameLoop.
It is that simple and will speed up your game whether you are using GDI or Direct3D.
If graphics is another culprit of main slowdown, then figure out whether your platform supports accelerated 2d and/or 3d rendering. If no 3d acceleration but yes 2d acceleration, then use 2d acceleration to make a faster 3d game (or just write a 2d game). But to do that you'll need direct write access to video memory, which as far as I know the only 2d graphics API that gets you that is DirectDraw. Though I don't know if DirectDraw exists for WinCE.
Otherwise you are stuck with GDI/GDI+ (only GDI+ for C#). And if you use GDI and need pixel access use CreateDIBSection to create your backbuffer HDC's HBITMAP.
http://msdn.microsoft.com/mobility/windowsmobile/howto/windowsmobile5/api/default.aspx
So yes again if your hardware supports 2d acceleration use DirectDraw.
As a test of how slow GDI is, if all you do in your loop is blit the backbuffer to the screen, you'll max out at about 30fps (the test was conducted in XP). This is when using CreateDIBSection to create a backbuffer whose memory you have direct access to (because to a game programmer SetPixel is the worst function in the world). Even when using DDB sections instead of DIB, it is a little bit faster but you don't have memory access.
DirectDraw is always blazing-fast and you get direct memory access. Video memory writes are traditionally faster than system memory writes, and because there is not a huge PCI bus in your way video memory reads may actually be faster too.
If you have a fast software 3d rendering engine at your disposal and a 2d-accelerated WinCE device that supports DirectDraw, you can combine the two to maximize speed. Like the good-ol days back again!
Thanks for the quick reply, CW!
The interop code for handling messages works fine in CF.
The problems I am encountering have to do with the limits of the managed Forms classes. For one, there is no Application.Idle event in which to peek messages and launch my frame update and render calls. Only Application.DoEvents. Second, there is no WndProc method to override in my managed CF winform. So I am not really sure where to place my hook..
For now I am using Application.DoEvents and concentrating on optimizing game code.
I will continue to work on it and include some more Direct3D diagnsotics and troubleshooting.
In one of the games I worked on, the graphics engine programmer did all the lighting and [part of] the transformation themselves (can't calculate lighting manually without some initial transforming). That allowed the game to be compatible with more types of hardware too (didn't need hardware lighting).
I'm thinking of porting one of my old Win32 DirectX Apps to Windows Mobile. Hmm ... thinking ...
Remove this comment
Remove this thread
close