ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Who wants to experience C# depths of hell and evilness? (directx code)

(1/7) > >>

mouser:
So i spent a good portion of today trying to get this code to compile and work:
http://spazzarama.wordpress.com/2011/03/14/c-screen-capture-and-overlays-for-direct3d-9-10-and-11-using-api-hooks/

I did eventually manage to get it to COMPILE AND RUN (but not work) on windows xp; trying to do so on win7 was an epic adventure in frustration and anger.

I swear I will never ever ever be able to comprehend how Microsoft managed to make .net building so insanely prone to such an evil convoluted hell of incompatible versions, insane dependency strangeness, UAC pain, and just a general all around insane mess of deployment and execution.  They took some very nice language design and made it a cesspool of evilness when you actually want to run the stuff.  I have said it a million times -- nothing that Microsoft does makes sense unless you assume that half the employees are saboteurs absolutely devoted like samurai to destroying the company.

Hell is other people's code.

ANYWAY.. I beg you not to embark on trying to get that code to actually build and work (that is capture directx screenshots) -- because i don't want to inflict the pain on you.  And I am warning you it requires dlls and installing an additional "assembly" (slimdx).

BUT..

If you do manage to get it to work please let me know, i'd love to modify this to be a standalone commandline c# directx window grabber that I could invoke from my Screenshot Captor tool.  (or even better, convert the code to c++).

Renegade:
I've done a fair amount with P/Invoke, but it still is a kind of black science. I most certainly wouldn't want to venture into unknown territory... :(

If you can remember, make sure to set things to x86. You'll likely have a lot better luck that way. I know it sounds retarded, but...

Ath:
(or even better, convert the code to c++).
-mouser (February 07, 2012, 11:01 PM)
--- End quote ---
But there are also a lot of examples in C++, why not start/try with those :tellme:?
Like this on CodeProject or this on StackOverflow

mouser:
None of those methods do what needs to be done to capture direct x.
It's quite confusing -- but the DIRECTX methods of screen capture (which the codeproject tutorial does) is not the same as capturing from a running directx app.

To do the later you need to inject a dll into the target process and reroute directx rendering functions.  And it has to be done differently for different directx versions..

The first link I posted has everything that *should* be needed to make it work.. If it could be made to work..


Don't get me wrong, I'd *MUCH* rather have C++ code than C# for this, but i haven't found any good code for c++.   Converting this code to C++ might still be the best way to go..

Ath:
Or sneakily integrate Gadwin Printscreen Free and call that from SSC ;D ;D ;D

Navigation

[0] Message Index

[#] Next page

Go to full version