XBOX
EVOLUTION
THE XBOX DIRECTX vs. DIRECTX8
Article version 0.1
The XBox is using a slightly different DirectX than the DirectX8
we are used to.
The main differences are:
* You don't need to create a window and run a message pump
like you have to in Windows. On XBox just create your Direct3D
object and draw! Kind of like the good old DOS days :)
* DInput has vanished and has been replaces with the gamepad
functions.
* DShow is no more. A new streaming API has been introduced.
* DirectDraw is out (since it was DX7 and earlier only).
* The fastest texture format is a "swizzled" format
(probably what nvidia uses internally on normal Geforces too,
but you never get to see it). If you only use D3DXLoadTexture
to load your textures and then don't do anything more with
them, you don't need to care. But if you lock a texture and
try to just write an image straight in there, it will look
seriously weird. You need to use the XGSwizzle functions in
the API to reorder the pixels to a format the GPU likes.
* DirectX objects are no longer full COM interfaces, but
Release() and AddRef remain. This means that it is, just like
on the PC, still VERY important that when you recieve an interface
through some Create function, after using it you ->Release()
it! if you don't do it (Ben_3D does this mistake in some of
his tutorials), you will slowly drain your xbox's memory,
until it freezes! So be SURE to release all interfaces you
recieve.
* Lots of old garbage has been stripped out, and some new
stuff introduced here and there. There is only Pure mode,
no "software emulation" of anything since that would
have been silly on a closed platform like the XBox.
* The XBox GPU has, unlike the Geforce 3 but like the Geforce
4, two vertex shader units. This has no real implications
when programming it other than the nice fact that the programmable
vertex processing speed is doubled since it can do two at
a time.
* You have direct access to the graphics chip's internal
push buffers. This is only needed to know about when you want
the ultimate performance, and so isn't too useful for simple
homebrew stuff. It's pretty cool tho.
* Everything runs in kernel mode, so you have access to any
memory you want. You never have to unlock textures/buffers,
so you can just lock them and retain the pointer. You can
mess with the internal data of D3D resource descriptors if
you want to, you can upload a huge chunk of data and just
tell the XBox that "that is a texture, and that is a
vertex buffer" through Register()-functions. This is
used by many samples, and the XFONT class.
I think this pretty much sums up the most important differences.
-ector^XL
The Hottest DCEmu Posters
|