directdraw


Getting programmicaly Device Caps for DirectX 6.1 (DDraw4)


I am writing windows32 hooks around DirectX 6.1 library to DirectX 9.0c; Idea is to replace all calls to DX 6.1 3D device with calls to Direct 9.0c and inject some custom code, so old game which I am patching (99' year) will be able to use shaders, post-effects, etc.
The old DX 6.1 3D device was created by creating DDraw module. Game is then enumerating device caps. In my module the entire DDraw module is skiped and 3D view is initialized. So I have problem as I can't give the game Ddraw4 device caps which it requires as I do not have DDraw device at all!
So my question is how to obtain DDraw4 device caps without initiaizing DDraw4 device. Perhaps it will be sufficient to create fixed list and feed it to the game, but I have no idea what should be on that list (I gave what I thought it should be, and the game exited - logger showed it was just after device caps checked)
I've never tried this, but you might try the following. Assuming you don't have the 6.1 SDK, you could make the DDCAPS structure (the DirectDraw one) yourself (it's basically just DWORDs), then get the capabilities (D3DCAPS9) using the DX9 GetDeviceCaps function. Next, take the values you need from the acquired caps (using DX9) and set the equivalent values for DirectDraw in your DDCAPS structure. You could then feed this populated caps structure to the game. A few caveats--as you mentioned, you don't know what it needs specifically, so it's kind of hit and miss (unless you have the source code). Also, there may not be a 1:1 mapping for the caps structure values (between DX9 and DDraw). Finally--this ties in with not having the 6.1 SDK--if you don't know the flag values, you might set a flag incorrectly when setting the values according to the acquired caps. As I mentioned, this may be way off (or require a lot of detective work), but I figured it might be something you could try.
The solution was a bit crude, but most importantly - is working flawlessly.
I've written small self-contained utility, which initialize DDraw 6.1, than gets device caps, then dump them to the file on disk (device caps is Plain Old C format structure, so saving it is really simple) and quits. Then I can read the device caps file from disk and return it when application ask me for them.

Related Links

How do you draw text in DirectX 12?
how can I detect the maximum size of overlay hardware via Direct Draw library?
Getting programmicaly Device Caps for DirectX 6.1 (DDraw4)

Categories

HOME
grok
turing-machines
api
c++11
nvd3.js
wakanda
dns
swt
sh
edge
visual-studio-emulator
onclick
google-cloud-datalab
gluon-mobile
angularfire2
computer-science
pcl-crypto
openpyxl
fhir
distribution
why3
pybossa
renjin
alpacajs
digital-signature
undertow
springfox
libigl
dpdk
interpreter
comparator
ckfinder
dapper-extensions
definitelytyped
pic32
motion-detection
dotspatial
cognos-bi
deltaspike
wacom
clickjacking
papaparse
login-script
vue-chartjs
yowsup
searchkit
projects-and-solutions
css-position
ogc
odoo-website
datacachefactory
phpdbg
trojan
excel-dna
lsyncd
gpg-signature
javafx-css
juice-ui
choice
parfor
iotivity
burrows-wheeler-transform
wso2developerstudio
xdoclet
tracker-enabled-dbcontext
bizagi
np-spring
rewrite
pax-exam
finalbuilder
zscript
dronekit-android
sql-server-data-tools
osc
rickshaw
formview
ora-00904
rcaller
functional-java
hibernate-entitymanager
printdialog
neos-server
dolby-audio-api
pclzip
swfobject
apache-abdera
booksleeve
os.system
fitbounds
urlrewriter
landscape-portrait
mysql-error-1205
cdonts
delimited-text
office-2007
murmurhash
product-management

Resources

Encrypt Message