Insomnia struck so I fooled around a bit more with my WinQuake engine and implemented switchable video drivers for it. They're really cool and really easy to do; just 4 (but sometimes 5) functions need to be written and you have a new video driver.
Right now there are 4 drivers implemented: Null, GDI, GDI+ and DirectDraw. The Null driver just uses a memory buffer and draws nothing to screen. GDI is probably the fastest driver. GDI+ is deathly slow but is likely not even remotely optimized. DirectDraw is almost as fast as GDI but is slightly hampered by having to use a 32 bit back buffer, so it needs to write the screen to memory, then expand that to 32 bit via a palette into the backbuffer before blitting it to screen. Nasty. If I can find a way to make DirectDraw use an 8 bit back buffer in windowed modes and without having to change the display mode it should get even faster.
I'm going to go for broke and add a Direct3D driver to it later on. It will be just D3D using surfaces in the same way as DirectDraw does, but it will be nice to do a performance comparison. OpenGL should also be possible too, but the setup will be ugly. If I can get an 8 bit backbuffer with one of these it will be nice.
I mentioned in passing that you can switch between drivers while the game is running and see the end results immediately. This is via a vid_driver cvar at the moment, but it's not incredibly user friendly. I'm going to see if I can do anything about that, but first I need me a coffee.
Tuesday, April 6, 2010
More WinQuake
Posted by
mhquake
at
7:15 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment