Jump to content

Direct3D


trancexx
 Share

Recommended Posts

Being part of the great AutoItObject.au3 project I was able to witness some brilliant moves done on the field of understanding the essence of the object programming on windows.

That helped me a lot in my efforts, of course, of understanding the same thing.

When AutoItObject would be published you will see how great it is. Until then here's some side effects...

DirectX.

So is it possible in AutoIt? I know there was some efforts but I just can't find the examples anywhere. :D

Nevertheless. When you see some object as a group of pointers to some pointers wrapped in a pointer to pointer and then some more pointers, you realize that you can point your self to a place that points to a pointer of a solution pointer. :huggles:

Problem with AutoIt is that you can't define custom interface that you would be able to access. You either use IDispatch interface or you don't work with objects at all.

Direct3D I'm showing here uses IDirect3D9 interface. Also it uses IDirect3DDevice9 (see that monster) interface, etc...

monoceres said: "I will get that freaking pointer!" (my interpretation of his words). I tried the same here.

Script (more like a proof of concept):

DirectX.au3

x86 only.

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Yay! Here is the example you were looking for: http://www.autoitscript.com/forum/index.php?showtopic=84532&view=findpost&p=606233

Maybe objbase.au3 wll be of some help, too :D

objbase.au3

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

After OpenGL now Direct3D! Your are awesome! :D

Also to ProgAndy for his Direct3D code!

Nice to have such talented coders around!

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Nice! I remember working with this interface was a nightmare, then again, I did not understand it at the time.

Maybe a fusion between IUnknown powered interfaces and AutoitObject would be cool? Definitely something to think about.

Keeping sane when you have pointers all around you is hard (then again, are we really sane in the first place?).

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Nice! I remember working with this interface was a nightmare, then again, I did not understand it at the time.

Maybe a fusion between IUnknown powered interfaces and AutoitObject would be cool? Definitely something to think about.

Keeping sane when you have pointers all around you is hard (then again, are we really sane in the first place?).

I see no bigger problems for porting other interfaces to IDispatch.

We could use $riid parameter of GetIDsOfNames of IDispatch to pass function pointer of different interface to Invoke. Peace of cake, right? :D

_UnprotectMemory($riid, 4)
DllStructSetData(DllStructCreate("ptr", $riid), 1, DllStructGetData($tInterface, $sName))

Then in Invoke collect all parameters and just use function like _D3D9_Call() to call method.

Should I go for it? ProgAndy? (I said I'll ask you)

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Link to comment
Share on other sites

Maybe do not replace the vTable-Entries since this destroys the functions located at postion 6 and 7 of the vTable. I think it would be better to create a Wrapper object that has the original object as property.

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Maybe do not replace the vTable-Entries since this destroys the functions located at postion 6 and 7 of the vTable. I think it would be better to create a Wrapper object that has the original object as property.

No it doesn't. New object is created. Check there.

edit :D

Saving the old functions pointers and then calling them before returning from modified - if required methods are placed at 6th or 7th place of the object tags (RegExp)?

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Run. Gives errors. Then I see this:

x86 only.

FUUUUUUUUU

Any screen shots of what this does so I can see?

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Link to comment
Share on other sites

Just run it as x86. You always get x86 version of autoit when installing.

Oh yeah :D well now I get this error:

---------------------------

AutoIt Error

---------------------------

Line 416 (File "C:\Users\minikori\Desktop\DirectX.au3"):

Local Static $tCode = _AllocateExeCode(58)

Local ^ ERROR

Error: No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement.

---------------------------

OK

---------------------------

Edited by Minikori

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Link to comment
Share on other sites

What version are you using? It appears that you're not recognizing the Static keyword appropriately. You may need to update to the latest version of AutoIt.

Link to comment
Share on other sites

What version are you using? It appears that you're not recognizing the Static keyword appropriately. You may need to update to the latest version of AutoIt.

I feel quite stupid today :D. We need an auto check for updates.

EDIT: Okay now when ran nothing happens for a few seconds then it crashes :|

Edited by Minikori

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Link to comment
Share on other sites

FYI, 'Static' support is still very beta and partially broken even in 3.3.5.1. For example, the help file Static example fails when it tries to redim the static array (known issue).

My?

Static is there for testing, because it needs testing.

Script can do without it.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...