Author |
Topic: Creating D3DX8BBC.DLL for BBCBASIC for Windows (Read 2387 times) |
|
knudvaneeden
Developer
member is offline


Posts: 32
|
 |
Re: Creating D3DX8BBC.DLL for BBCBASIC for Windows
« Reply #19 on: Sep 20th, 2009, 3:08pm » |
|
on Sep 20th, 2009, 12:30pm, Michael Hutton wrote:On a related note I have now been able to create a new PerlinDLL which includes a new "GeneratePerlinTexture3d" function which will create a 2d texture based on a third (float) z parameter. Now you can scroll through 3 dimensions to create clouds etc. |
|
Maybe create a Wiki about how you created the DLLs (generalizing, ..., simple steps 1, 2, 3, ...), so that that information is conserved and reusable for other projects? That would be great. Otherwise show it here maybe? (e.g. in a separate thread).
Thanks,
with friendly greetings, Knud van Eeden
|
|
Logged
|
|
|
|
Michael Hutton
Developer
member is offline


Gender: 
Posts: 248
|
 |
Re: Creating D3DX8BBC.DLL for BBCBASIC for Windows
« Reply #21 on: Sep 20th, 2009, 11:51pm » |
|
Knud,
I must admit I don't really feel qualified yet. I expanded in the PerlinDLL by loading in the solution file to VC++E and then typing in a new function and adding a few lines of code which "look right". I built it and it worked, albeit resulting in a file about 7x larger! I do not think that I should be writing any "how to" guides yet!!
I will have a deeper look at the DirectDXD3 dll now I *think* I understand a little bit more about what is going on, but please don't expect anything from this end very soon.
Michael
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Creating D3DX8BBC.DLL for BBCBASIC for Windows
« Reply #22 on: Sep 21st, 2009, 11:42am » |
|
Quote:| looking at the ASM output the code seems *very* inefficient |
|
The key word there is "seems"; have you actually compared the timings? I don't know about Visual C, but gcc, with the maximum level of optimisation, can sometimes generate code which outperforms 'naive' hand-written assembler, the reason being that it understands the CPU's internal architecture better.
Don't be too quick to judge the code the compiler generates on the basis of what it looks like to you!
Quote:| It is interesting to see the way the compiler will translate c = (r << 16) || (g <<8) || b and compare to c = (r << 16) + (g <<8) + b |
|
But this is a meaningless comparison. The first is using Boolean logic and the second is using arithmetic.
Surely, to make any kind of sensible comparison the first should be:
Code:c = (r << 16) | (g <<8) | b that is, single | (bitwise OR) rather then double || (Boolean OR) operators. With that change I would be surprised if the code was radically different from the addition example.
If you're at a stage of learning C that you still confuse | and || you've got a very long way to go!
Richard.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Creating D3DX8BBC.DLL for BBCBASIC for Windows
« Reply #23 on: Nov 30th, 2009, 08:25am » |
|
If you want something doing, do it yourself! I installed Visual Studio 2008 Express on my Vista machine and, despite never having used it before, within a few hours I'd successfully built a complete D3DX8BBC.DLL. I was surprised how easy it was, especially considering some of the earlier comments made in this thread. I had no problems with 'name decoration', and did not need to create a .def file.
One thing I made a particular point of doing was to keep the source file as d3dx8bbc.c rather than renaming it as .cpp so whether that helped I don't know.
I've uploaded the hopefully functional, but largely untested, version of D3DX8BBC.DLL here:
http://groups.yahoo.com/group/bb4w/files/Libraries/D3DX8BBC.dll
This exports 199 functions in total, including those implemented in C++ (which were the ones I couldn't incorporate using GCC). It should be functionally equivalent to Microsoft's D3DX8D.DLL but is slightly smaller (not being a Debug version) and - most importantly - should be entirely legitimate to distribute.
It has had virtually no testing, so I would welcome reports of any problems such as missing functions or incorrect behaviour.
Richard.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Creating D3DX8BBC.DLL for BBCBASIC for Windows
« Reply #25 on: Dec 4th, 2009, 5:21pm » |
|
D3DX8BBC.DLL has a dependency on the C run-time library MSVCR90.DLL. Unfortunately, unlike MSVCRT.DLL (which is present on every Windows system from Win98 onwards), some PCs appear not to have MSVCR90.DLL installed.
Therefore I've uploaded a new version of D3DX8BBC.DLL without the dependency (although it increases the file size somewhat):
http://groups.yahoo.com/group/bb4w/files/Libraries/D3DX8BBC.dll
I've also updated the Tumbling Teapot executable to use this new version:
http://groups.yahoo.com/group/bb4w/files/Graphics/tumblingteapot.exe
Richard.
|
|
Logged
|
|
|
|
Michael Hutton
Developer
member is offline


Gender: 
Posts: 248
|
 |
Re: Creating D3DX8BBC.DLL for BBCBASIC for Windows
« Reply #26 on: Jan 13th, 2010, 11:52am » |
|
Quote:| It has had virtually no testing, so I would welcome reports of any problems such as missing functions or incorrect behaviour. |
|
I couldn't seem to find the D3DXCreateText function in the dll. Is this only with the DirectX9 version ? (I am currently downloading the "old" DirectX8 SDK to check).
Michael
|
|
Logged
|
|
|
|
Michael Hutton
Developer
member is offline


Gender: 
Posts: 248
|
 |
Re: Creating D3DX8BBC.DLL for BBCBASIC for Windows
« Reply #27 on: Jan 13th, 2010, 12:22pm » |
|
Doh. They are there as
D3DXCreateTextA - ANSI version
and D3DXCreateTextW - UNICODE version
Should have thought of that before..
Michael
|
|
Logged
|
|
|
|
|