DirectXDemo

所属分类:DirextX编程
开发工具:Visual C++
文件大小:196KB
下载次数:2
上传日期:2009-07-11 01:13:42
上 传 者ly1988
说明:  dx 的一个小程序 十分有意思 会对读者有所启示
(dx a small program readers will be very interesting revelation)

文件列表:
FPTR.E (4668, 2001-05-30)
dx8.ew (69602, 2001-05-29)
DXDEMO.EXW (9615, 2001-05-31)
EUCOM.EW (21455, 2001-05-24)
tk_mem.e (27462, 2001-05-02)
Win32Lib.ew (730576, 2001-05-23)
w32Keys.e (7067, 2000-10-08)
VARIANT.EW (9264, 2001-05-22)
compat01.ew (1088, 2000-12-22)
tk_trim.e (11499, 2000-12-15)
tk_misc.e (6868, 2000-10-31)
tk_maths.e (6459, 2000-11-07)
tk_fileio.e (2114, 2000-10-31)
UNICODE.EW (4477, 2001-05-16)

DirectX 8.0 Demo For EuCOM by Matt Lewis matthewwalkerlewis@yahoo.com This is a simple demo for using DirectX 8.0 with EuCOM, which means you'll need DirectX 8.0 (about an 11MB d/l from MS if you don't have it). Only Euphoria and some assembly are used. No DLL's are needed! I haven't been able to get all DirectX features to work yet. For instance, I can't call Direct3DVertexBuffer8 methods, and some of the DX3DMatrix... functions return garbage instead of correct matrices. But others work as advertised. These all seem to work fine from VC++, so I don't want to guess at what's going on. I got around the vertex buffer problem by using DrawPrimitiveUP, which uses a user provided buffer. I can't get DX to work in 24-bit color (that includes the demos that came with it). Also, my video card apparently doesn't have 3D acceleration (it's a fairly old machine, so I'm not surprised). This isn't a release version of EuCOM, and although I don't think there are any bugs in it, there are some as yet undocumented routines. The main thing is call_interface_ptr. This works similar to call_interface, except that it calls methods on COM objects that aren't created by EuCOM. If you use COM, this will happen a lot. In fact, any time an object passes you another, you'll need to do this. (In the next release, you'll be able to add the object to EuCOM's created objects and use it the same way.) Typically, you'll have to supply an 'address to a pointer' (see my use of ppv) to a function, and it fills in the pointer's value. In C/C++ you'll see a lot of &ppv sort of thing. In Eu, you simply allocate 4 bytes and pass that. Then you peek the value there to get the pointer. To get what it's pointing at, you peek again: ppv = acquire_mem(0,4) -- calling a function that 'returns' another object void = call_interface( my_object, the_interface, func_vtbl_offset, {arg1, arg2, ppv}) new_obj_this = peek4u( ppv ) new_obj_vtbl = peek4u( new_obj_this ) void = call_interface_ptr( new_obj_this, new_obj_vtbl, func_vtbl_offset, {args....}) See? Not so bad, although passing the address of a pointer to a pointer to an array of pointers to functions sounds pretty confusing. :) There's also invoke_ptr(), but you won't need that for DirectX. I've included my copy of win32lib.ew, so you won't have to d/l that if you don't have it. dx8.ew is a *partial* wrapper of dx8vb.dll, which is the typelib for directx8. There are lots of things not included, including things that I used. Some of the functions aren't as obvious as they could be, since the literal values are often used, rather than the constants. Be careful with the structures defined in it. If I didn't use it in the demo, the members are probably out of order (it's a problem with my automatic wrapper that I'm working on). I used the C++ DirectX SDK in developing this. It's a huge d/l (~44MB), and unless you have a high speed connection, you're probably better off going to MSDN for documentation, although you might be able to simply d/l the docs, which are about 7MB, I think.

近期下载者

相关文件


收藏者