12/28/2022 0 Comments Directdraw surface residueHence,we could write another layer of software on top of my layer (which has someDirectX-centric parts to it) and totally be machine-independent, but Idon't think it's worth the time. I wanted the thinnest layer to DirectX for performance reasons. The only drawback to using the engine from the first Tricks is that afew of the data structures, and the design itself, were predicated on DirectXitself. The algorithms will stay the same forall the 3D code. All you would haveto do is emulate the low-level interfaces, such as the double-buffered graphicssystem, sound, music, and input devices. Using this layer of indirection, most of the 3D code will be generic enoughthat you could port it to Mac or Linux with very little work. Therefore, instead of trying to explain every single detail of Win32, theDirectX foundation, and all that stuff (which I did in the first Tricks),we are simply going to use the API I wrote for that book as a tool to create ageneric virtual computer on which we can run our 3D graphics experiments andwrite our games. So,all we really need is a black screen, the capability to talk to the joystick,keyboard, and mouse, and to maybe play some sound effects andmusic—right? Because99% of our work is going to be related to rasterization, texture mapping,lighting, hidden surface removal, and so forth, this approach is feasible. As longas you can communicate with a double-buffered, linearly-addressable graphicssystem that has support for input, sound, and music, who cares how it works? Weare interested in the 3D graphics programming, not the low-level setup. ![]() Ultimately, this really makes a lot of sense for a number of reasons. You use GL libraries and/oradd-ons that handle the low-level device-specific interfacing and housekeepingof whatever system you're on, including opening windows and gettinginput. This is basically the approach that OpenGL takes. However, because ofthe sheer size of the engine, we still have a lot to discuss. Alas, my solution is to create a"virtual computer" based on the engine I developed in Tricks of theWindows Game Programming Gurus that you will simply use as a black box, sowe can focus on the 3D graphics and game programming part. Eventhough you should have some idea of Win32 programming and DirectX after readingthe last chapter, it's still a bummer. However,my dilemma as an author is how to focus the book on just that, without talkingabout all the low-level details of Win32 programming, DirectX, and so on. The goal of this book is to teach 3D graphics and game programming. Implementing the virtual computer with T3DLIB The API listing of the enhanced T3DLIB library from Tricks ofthe Windows Game Programming Gurus ![]() The design of a virtual computer graphics interface ![]() With this interface, we can focus the remainder of the book on 3Dmath, graphics, and game programming. It will support a linear 8- or 16-bitframe buffer (double buffered) and input devices, along with sound and musiccapabilities. In this chapter, we're basically going to build up a virtual computersystem based on a software interface. "N O P E A C E." ≼aptured alien, Independence Day Introduction to the Virtual Computer Interface Tricks of the 3D Game Programming Gurus-Advanced 3D Graphics and Rasterization
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |