ID3DXFont::DrawText modifying the IDirect3DDevice9 vtable
I am mess开发者_运维问答ing around with Direct3D - modifying vtable entries for a device object so that my functions get called instead the provided ones. I noticed that despite this mostly working, at points something restores the IDirect3DDevice9
vtable, for example ID3DXFont::DrawText
- the very first call; ulterior ones don't touch it.
Why does this happen?
Modifying vtables is pretty much undefined behavior. Maybe there are caches or different copies of the vtable. It's all implementation dependent. You're lucky it works at all!
精彩评论