http://bugs.winehq.org/show_bug.cgi?id=22918
--- Comment #39 from Tony Wasserka tony.wasserka@freenet.de 2010-07-25 04:45:14 --- (In reply to comment #36)
I noticed you had a separate basemesh.c file... not sure how he would feel about the ID3DXBaseMesh functions.
As far as implementing ID3DXBaseMesh, this is what he had told me at one point when I was still getting my feet wet.
There are no functions that directly return an ID3DXBaseMesh interface, it's just a base interface for ID3DXMesh. There should be plenty of similar constructions inside Wine, for an example look at IDirect3DTexture9 / IDirect3DBaseTexture9 in dlls/d3d9/texture.c. You do need to add stubs for the ID3DXBaseMesh methods in ID3DXMesh of course.
Yeah, I didn't know where to look for this either at first... Anyway, there were two methods of doing this: the wined3d/texture.c way and the dsound/dsound.c way (not sure if the filenames match, but you get the idea). I (think I) went for the wined3d way, since the dsound one was quite a bit complicated and wined3d seemed to have been added more recently.
In any case, I'm not on IRC very much (actually I don't use it but downloaded xchat-gnome after I saw your message. Usually find it distracting.
I did not see you on but my nick is misha680.
FWIW, I'll probably be online for the next 10 hours...
Feel free to email me too at misha680@gmail.com.
I hope you don't mind, just in case I emailed Owen Rudge with a link to your texture.c in your merge branch: http://repo.or.cz/w/wine/d3dx9TW.git/blob/e4dfdb7c2cc4264bbe89ef938c939a3965...
That's okay with me,
although I'm sure he's quite aware. I do not see either of the functions http://bugs.winehq.org/show_bug.cgi?id=23706 D3DXSaveSurfaceToFileInMemory
While not being implemented, this might be trivial to add since we're using WIC internally in d3dx9.
http://bugs.winehq.org/show_bug.cgi?id=22555 D3DXCreateCubeTexture
implemented but please correct me if I am incorrect.
That one was out of scope of my project and might require some serious refactoring of my code...
Anyway, I don't work on getting those patches merged anymore (due to various reasons), so feel free to pick up stuff from the patches and just add my copyright to the headers.
do you mean that I can send patches that use your code using my email address (not yours), and add a copyright notice at the top, and send them to the main Wine list?
Not sure where you were referring to, but I meant a copyright notice at the the top of the files which use my code, not necessarily the commit message (you're free to mention that quite a bit of the code was done by me though :P).
For now, I'm still waiting to hear about my D3DXCreateSphereTest patch, and was going to add some more tests, but D3DXCreateMesh is definitely in the ballpark.
Good luck getting all this commited then ;) Anyway, we definitely _should_ talk about at least .x file loading, since that code needs some more changes before committing.
As for your comments re declarator use internally, that was my ultimate intent, but I wanted to start with FVFs as that seemed like it would fix this bug in a more speedy fashion.
I am not sure how Henri/AJ will feel about this (I believe Henri has given some scrutiny to my patches, but I know he is quite busy).
It's not that hard to use declarators instead... D3DXCreateMeshFVF will just call D3DXDeclaratorFromFVF to get a vertex declaration and pass it to D3DXCreateMesh, it's as simple as that ;)
(In reply to comment #37)
Fyi, since you did mention a tesselation implementation (I know you mean an actual implementation of either D3DXTesselateTriPatch/TessellateRectPatch or ID3DXPatchMesh interface or both)
Actually, I wasn't referring to these functions. IIRC, I was using GetGlyphOutline with the GGO_NATIVE flag to get the vertex data of the text, but I had quite a few problems about indexing.
I was hoping that perhaps I might be able to either: i) Get some teapot code into Wine using a helper tessellation function as, e.g., in the attached code or ii) Alternately generate raw vertex and index data in OpenGL and then include that way
ii) sounds way to hacky to ever be included in Wine, so I'd go for i).
In theory, if we had a helper tesselator function, this could be quite useful for an eventual implementation of:
- D3DXCreateText
- D3DXTessellateTriPatch/D3DXTesselateRectPatch/ID3DXPatchMesh
D3DXCreateText shouldn't need the same tesselator functionality functionality provided by the other functions you mentioned. Stuff like that is handled in GetGlyphOutline already.
(In reply to comment #38)
Fyi, I did a Google search and found this rather helpful post that describes http://www.mail-archive.com/wine-devel@winehq.org/msg60225.html Tony Wasserka's work, as well as this more detailed breakdown: http://www.mail-archive.com/wine-devel@winehq.org/msg60350.html
Yeah, the e-mails didn't get as much usuable attention as I had hoped for them to get :/
Anyway, I'm glad someone picks my patches up, thanks for doing this ;)