Comments (5)
Of course, passing a "real" interface to SetStreamSource
instead of a wrapper helped - but is it me just being dumb and forgetting something or something wrappers didn't account for so far?
EDIT:
Looks like your wrapper is aware of that quirk... are there any other methods which behave like that?
from dxwrapper.
I am not exactly sure which quirk you are asking about. I have found several different issues with wrapping DirectX APIs. I was hoping to write up a wiki to discuss each of them in more detail, but never got around to it.
The crash happens at that location, but the issue could have been a ways up the stack. The problem with wrappers is that if you don't wrap everything correctly then it is possible for the process to get the actual d3d9 interface rather than your wrapper interface. This can cause all kinds of issues. In one game I saw a case where the real interface was exposed at the beginning of the game but it did not crash until you left the game or started a new match, which could be hours later.
Actually in d3d9 I believe you have a chance of crashing, depending on what the game does, if you don't wrap every interface. I believe every interface in d3d9 has at least one function where you need to swap the address with the wrapper address.
For the VertexBuffer there is function called GetDevice
. For Textures there is a function called GetSurfaceLevel
. Etc...
I am not sure if this is useful or not. Let me know if you need any specific data. You are always welcome to use my wrappers. I spent a good amount of time trying to make sure they can fully wrap all interfaces. It is strictly a wrapper with no additional code in it.
from dxwrapper.
What I haven't noticed at the moment of creating this issue is what in any function passing resources to the device (like SetStreamSource
) you are passing underlying resources instead of the wrapper itself. On the second thought it makes sense, since D3D has a right to internally assume those resources are "final" and thus refer to them directly and not via virtual methods.
Example:
https://github.com/elishacloud/dxwrapper/blob/master/d3d9/IDirect3DDevice9.cpp#L576
from dxwrapper.
Yes, you need to pass the real resource to D3D and the wrapper interface to the game process. If you check out my DirectX-Wrappers project and look at the d3d9 wrapper you can see which functions I pass either the real or the wrapper interface.
If the function just has a return ProxyInterface->(function_name)
then you don't need to do anything to that function. Example: https://github.com/elishacloud/DirectX-Wrappers/blob/master/d3d9/IDirect3D9Ex.cpp#L57
For other functions there will be additional code to either do one of these three things:
- Lookup the wrapper address.
- Create a new wrapper interface.
- Lookup the resource address.
I should also mention that when I lookup the wrapper address if it does not exist then I create a new interface.
from dxwrapper.
Cool! So it was purely an oversight on my part and not some thing everyone forgot about... good to know!
from dxwrapper.
Related Issues (20)
- On the Page for Blood II The Chosen - Dead Link for Dege's High Resolution Patch HOT 3
- Tropico Mouse Scaling Native Resolution Issue HOT 1
- Query on Direct3D driver files HOT 3
- Star Trek Armada: in game bik video not rendered correctly HOT 6
- Star Trek Armada: transparent cursor HOT 4
- Allow for dxwrapper and its stub to hook through xlive.dll HOT 11
- Fellowship of the Ring black screen on startup (DX8 game)
- Issues when using Ultimate ASI Loader alongside DXWrapper HOT 8
- Thief TFix
- Crash with NV D3D12 HOT 5
- [Exception in memory or whatever] State of Emergency HOT 4
- Virtua Fighter PC
- Instability when testing Buggy (1998, d3d) HOT 2
- Understanding direct 3d 7?? HOT 13
- Lego Rock Raiders - Incompatibility / Black screen
- Gangsters: Organized Crime not starting HOT 4
- Tropico dd7to9 causes "No 3D Hardware available" tropico Steam Version HOT 28
- How to contact you? HOT 4
- How to properly remove dxwrapper HOT 2
- [Warning] Area 51 (2005)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dxwrapper.