cppman Posted April 7, 2007 Posted April 7, 2007 (edited) Here is the updated version of my Direct3D plugin. It provides you functions for drawing sprites now Here is a list of the functions, and the parameters they take: (I prefixed all of the functions with A2D) A2DCreateDevice($hWnd, $nWidth, $nHeight, $nFullscreen, $nFormat) A2DReleaseDevice() A2DCreateSprite($sImage, $surface_width, $surface_height, $transparent_color, $nFormat) A2DReleaseSprite($nSpriteID) A2DClear($nClearColor) A2DBeginScene() A2DEndScene() A2DPresentScene() A2DDrawPixel($x, $y, $color) A2DDrawLine($x1, $y1, $x2, $y2, $color) A2DDrawRectangle($x, $y, $width, $height, $color) A2DDrawSprite($id, $x, $y, $width, $height) A2DDrawSpriteEx($id, $src_x, $src_y, $src_w, $src_h, $dest_x, $dest_y, $dest_w, $dest_h) oÝ÷ Ù8^~æjÚZ©µêÜjvÞz+azº'zíçè®f±×ªÞv)ÚÙÖ®Ý:,zÛayج¦V²^~ée±ÊÞzz+Â)Ý£Êj{¬zÞ¡ûayÊ'²Ö§¶Æ¥²^rV«yاkgZ»}7è XC9aÓ~Ø1T,´DA !ü¨¹ªÞlº·nÂú+«m¢ëÊj{¬{Mú`Å9L1BÓjwb¶ë²Ø^r©º×«ßÛyö®×b²ZÉú+«H}©Þ®º+¡Ç.®·z'zíçîËb¢{"·¥·º¹õ¢Ø^¯¬z+pYkzÛ«J+jr즸z̨º»)®+^Ƭ²('yÖ§Ûajܨ¹Æ§¥«,¶ax ¶°JâµçîËb¢qè¥ëaÈ^,¢g©zex:0Zu«miÈfz{ Edited April 10, 2007 by chris95219 Miva OS Project
karman Posted April 7, 2007 Posted April 7, 2007 Oh, very cool.. I enjoyed playing around with this. I'm looking forward to try the new stuff you will add
NELyon Posted April 7, 2007 Posted April 7, 2007 Hmm, i think it has a problem with the Plug-in and the functions not declaring correctly: >Running AU3Check (1.54.6.0) from:C:\Program Files\AutoIt3 C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(15,15) : ERROR: InitDirect3D9(): undefined function. InitDirect3D9() ~~~~~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(16,36) : ERROR: CreateDevice(): undefined function. CreateDevice($hWnd, 1024, 768, $opt) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(32,12) : ERROR: Clear(): undefined function. Clear($col) ~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(33,13) : ERROR: BeginScene(): undefined function. BeginScene() ~~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(34,58) : ERROR: DrawRectangle(): undefined function. DrawRectangle($x, $y, 50, 50, random(0x000000, 0xFFFFFF)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(35,11) : ERROR: EndScene(): undefined function. EndScene() ~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(36,10) : ERROR: Present(): undefined function. Present() ~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(41,17) : ERROR: ReleaseDirect3D(): undefined function. ReleaseDirect3D() ~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3 - 8 error(s), 0 warning(s) !>19:41:16 AU3Check ended.rc:2 >Running:(3.2.2.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3" C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3 (15) : ==> Unknown function name.: InitDirect3D9() ^ ERROR
cppman Posted April 7, 2007 Author Posted April 7, 2007 (edited) Hmm, i think it has a problem with the Plug-in and the functions not declaring correctly: >Running AU3Check (1.54.6.0) from:C:\Program Files\AutoIt3 C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(15,15) : ERROR: InitDirect3D9(): undefined function. InitDirect3D9() ~~~~~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(16,36) : ERROR: CreateDevice(): undefined function. CreateDevice($hWnd, 1024, 768, $opt) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(32,12) : ERROR: Clear(): undefined function. Clear($col) ~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(33,13) : ERROR: BeginScene(): undefined function. BeginScene() ~~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(34,58) : ERROR: DrawRectangle(): undefined function. DrawRectangle($x, $y, 50, 50, random(0x000000, 0xFFFFFF)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(35,11) : ERROR: EndScene(): undefined function. EndScene() ~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(36,10) : ERROR: Present(): undefined function. Present() ~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3(41,17) : ERROR: ReleaseDirect3D(): undefined function. ReleaseDirect3D() ~~~~~~~~~~~~~~~~^ C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3 - 8 error(s), 0 warning(s) !>19:41:16 AU3Check ended.rc:2 >Running:(3.2.2.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3" C:\Documents and Settings\Owner\My Documents\nick\D3D\Direct3D\Test.au3 (15) : ==> Unknown function name.: InitDirect3D9() ^ ERRORThats weird.. I get the same errors when I run au3check, but when I just run the script, or compile it, it runs perfectly fine. Have you tried running the script by itself? It shouldn't be the plugin code because I have it setup just as the example plugin shows you.. AU3_PLUGIN_FUNC g_AU3_Funcs[] = { {"InitDirect3D9", 0, 0}, {"CreateDevice", 4, 4}, {"ResetDevice", 4, 4}, {"DrawPixel", 3, 3}, {"DrawRectangle", 5, 5}, {"CreateSprite", 2, 2}, {"DrawSprite", 6, 6}, {"Clear", 1, 1}, {"BeginScene", 0, 0}, {"EndScene", 0, 0}, {"Present", 0, 0}, {"ReleaseDirect3D", 0, 0} }; and for each function I have declared like this(the first one.. as an example): AU3_PLUGIN_DEFINE(InitDirect3D9) { AU3_PLUGIN_VAR *pResult; g_D3D = Direct3DCreate9(D3D_SDK_VERSION); pResult = AU3_AllocVar(); if (g_D3D == NULL) { AU3_SetInt32(pResult, -1); } AU3_SetInt32(pResult, 0); return AU3_PLUGIN_OK; } Edited April 7, 2007 by chris95219 Miva OS Project
sandman Posted April 8, 2007 Posted April 8, 2007 This is what I got when I tried to run: A messagebox from windows saying: "This application has failed to start because d3dx9_32.dll was not found." I also get an Au3Check Error of "InitDirect3D9() Error: Unknown Function Name. So.. yeah.. where can I get this dll? [center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]
NELyon Posted April 8, 2007 Posted April 8, 2007 (edited) I still get an Unknown Function Name for InitDirect3d9 when i directly run the script Edited April 8, 2007 by D-Generation X
Kourath Posted April 8, 2007 Posted April 8, 2007 This is what I got when I tried to run:A messagebox from windows saying:"This application has failed to start because d3dx9_32.dll was not found."I also get an Au3Check Error of "InitDirect3D9()Error: Unknown Function Name.So.. yeah.. where can I get this dll?http://www.dll-files.com/dllindex/dll-files.shtml?d3dx9_32 nice work chris95219. very interesting.
cppman Posted April 8, 2007 Author Posted April 8, 2007 http://www.dll-files.com/dllindex/dll-files.shtml?d3dx9_32 nice work chris95219. very interesting.thankyou.. i don't understand why it isn't working for everyone. Miva OS Project
smashly Posted April 8, 2007 Posted April 8, 2007 (edited) Thank you for your plugin chris95219, nice work m8 .. dig it for those that get the "ERROR: InitDirect3D9(): undefined function." as well as other errors similar to undeclared functions while running the test.au3 ... You could try adding/declaring in the script to hush those errors. #compiler_plugin_funcs = InitDirect3D9 #compiler_plugin_funcs = CreateDevice #compiler_plugin_funcs = Clear #compiler_plugin_funcs = BeginScene #compiler_plugin_funcs = DrawPixel #compiler_plugin_funcs = DrawRectangle #compiler_plugin_funcs = EndScene #compiler_plugin_funcs = Present #compiler_plugin_funcs = ReleaseDirect3DoÝ÷ Ø l¢ÈhºWHmç%¢È§Ø^¦[ |!zxßÛx¬çpØ^«¢+ÙA±Õ¥¹ ±½Í ÅÕ½ÐíáÔ̹±°ÅÕ½Ðì¤ Cheers Edited April 8, 2007 by smashly
CoderDunn Posted April 8, 2007 Posted April 8, 2007 (edited) wow this is awsome. Iv'e been playing around with DirectX 8 in VB 6 for a while but if I can do this in AutoIt, screw VB! Thank you soooo much! I can't wait until this is more functional. Hallman Edited April 8, 2007 by Hallman
WeMartiansAreFriendly Posted April 8, 2007 Posted April 8, 2007 wow this is awsome. Iv'e been playing around with DirectX 8 in VB 6 for a while but if I can do this in AutoIt, screw VB! Thank you soooo much!Hallmanthis is cool.. suprisinly uses less cpu usage than other plugins..i also got an error, but fixed after i added d3dx9_32.dll to the script folder.. Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()
NELyon Posted April 8, 2007 Posted April 8, 2007 I am still getting the error about the Unknown Function Name (NOT undefined function)
ConsultingJoe Posted April 9, 2007 Posted April 9, 2007 (edited) I had issues too. Here is a good clean version with both dlls, the closeplugin, and the compilerpluginfuncs#compiler_plugin_funcs=InitDirect3D9, SetClearColor, CreateDevice, Clear, BeginScene, DrawRectangle, EndScene, Present, ReleaseDirect3DUpdate first post with this.Updated: Test.zipGreat Work, More functions please!thanks Edited April 9, 2007 by CyberZeroCool Check out ConsultingJoe.com
NELyon Posted April 9, 2007 Posted April 9, 2007 I had issues too. Here is a good clean version with both dlls, the closeplugin, and the compilerpluginfuncsUpdate first post with this.Updated: Test.zipGreat Work, More functions please!thanksNope, i still get the error in both examples.
ConsultingJoe Posted April 9, 2007 Posted April 9, 2007 Nope, i still get the error in both examples.I still get an error when I run just the script, try to use Scite to edit the script and run it with beta from there using Alt+F5 Check out ConsultingJoe.com
CoderDunn Posted April 9, 2007 Posted April 9, 2007 (edited) question ... what are using to compile this plugin? I'm trying to learch C++ but I dont know a good compiler ... Thanks, Hallman Edited April 9, 2007 by Hallman
cppman Posted April 9, 2007 Author Posted April 9, 2007 question ... what are using to compile this plugin? I'm trying to learch C++ but I dont know a good compiler ... Thanks, HallmanVisual C++msdn.microsoft.com/vstudio/express/downloads/C++ is fun but Direct3D isn't quite the easiest library to use, lol.As, for all of those errors.. I have no clue on how to fix it, or why it doesn't even work.I'm working on adding some new functions right now Miva OS Project
ConsultingJoe Posted April 9, 2007 Posted April 9, 2007 Visual C++msdn.microsoft.com/vstudio/express/downloads/C++ is fun but Direct3D isn't quite the easiest library to use, lol.As, for all of those errors.. I have no clue on how to fix it, or why it doesn't even work.I'm working on adding some new functions right now Thanks for the functions, I can't waitI would say about the errors to:Using latest betaHave both DLLsHave compiler lines to ignore the unknown functionsDownload test scripts Check out ConsultingJoe.com
CoderDunn Posted April 9, 2007 Posted April 9, 2007 Visual C++msdn.microsoft.com/vstudio/express/downloads/C++ is fun but Direct3D isn't quite the easiest library to use, lol.As, for all of those errors.. I have no clue on how to fix it, or why it doesn't even work.I'm working on adding some new functions right now ok thanks!Hallman
cppman Posted April 9, 2007 Author Posted April 9, 2007 ok thanks!HallmanI just updated my first post.It supports sprites now -I think that is all the functions I'm going to add.. the rest seem pointless.(Getting the number of adapters and stuff like that can easily be done through the registry). Miva OS Project
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now