Jump to content

Can ObjCreate be used with a program created in Autoit?


kokoilie
 Share

Go to solution Solved by Werty,

Recommended Posts

I'm using irrlight to display 3D models in a window but I can't create any controls in this window
and I thought I could compile the code and use objcreate () to display the irrlight (3D) part and overlay it with the autoit gui controls

if it won't work is there a way to add gui controls on to the window created by the .dll?

Edited by kokoilie
Link to comment
Share on other sites

I have never used it myself but maybe the >Au3Irrlicht UDF is what you are looking for.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

About the Irrlicht UDF that's exactly what i'm using.

How exactly do I cache the render and use it as background? Or more importantly how resource effective this will be?

Edited by kokoilie
Link to comment
Share on other sites

Maybe it will be the same way as to render texture from the camera, but if I can't do it with irrlicht can you tell me about a 3D system that you used or know how to work with?

I'm sorry but I have never actually done 3D programming. I know that if you hook in to DirectX or OpenGL directly instead of using a helper library, you can use almost anything as a texture source.

Link to comment
Share on other sites

  • Solution

It can be done by punching holes in the Gui like so...

#include "./Bin/au3Irrlicht2.au3"
#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

$Gui = GUICreate("AutoIt Window", 800, 600, -1, -1)
HotKeySet("{ESC}", "_exit")

;Embed Irrlicht RenderWindow---------------------------------------------------------------------------------------
_IrrStart($IRR_EDT_opengl, 1024, 768, $IRR_BITS_PER_PIXEL_32, $IRR_windowed, $IRR_SHADOWS, $IRR_capture_EVENTS, $IRR_VERTICAL_SYNC_Off)
_IrrSetWindowCaption( "IrrLicht Window")

    Local $outer_rgn, $inner_rgn, $combined_rgn

    $outer_rgn = _WinAPI_CreateRectRgn(0, 0, 800, 600)
    $inner_rgn = _WinAPI_CreateRectRgn(103, 102, 200, 122)
    $combined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0)
    _WinAPI_CombineRgn($combined_rgn, $outer_rgn, $inner_rgn, $RGN_DIFF)
    _WinAPI_DeleteObject($outer_rgn)
    _WinAPI_DeleteObject($inner_rgn)
    _WinAPI_SetWindowRgn(WinGetHandle("IrrLicht Window", ""), $combined_rgn)

GUICtrlCreateButton("Hey", 100, 80, 100, 22)

WinMove("IrrLicht Window", "", -3, -22)
_WinAPI_Setparent(WinGetHandle("IrrLicht Window", ""), $Gui)
WinActivate("AutoIt Window")

GUISetState()
;--------------------------------------------------------------------------------------------------------------------
;add your IrrLicht stuff here.....

WHILE _IrrRunning()

    _IrrBeginScene(128,128,128)
    _IrrDrawScene()
    _IrrEndScene()
    Sleep(5)
WEND

Func _exit()
    _IrrStop()
    Exit
EndFunc ; _exit

Some guy's script + some other guy's script = my script!

Link to comment
Share on other sites

Thanks Werty, works like a charm.

Never thought I could use that (actually never knew it's an option). Well guess i'm still green and have much to learn.

One more thing... can I put those "punched holes" back or should I try to make the whole gui that way?

Link to comment
Share on other sites

It would be easier just making the autoit window wider than the irrlicht window, now that's it's embedded, and then use the extra space for controls like buttons, tabs etc.

Then there's no need to punch holes.

Something like this...

#include "./Bin/au3Irrlicht2.au3"
;#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

$Gui = GUICreate("AutoIt Window", 800, 458, -1, -1)
HotKeySet("{ESC}", "_exit")

;Embed Irrlicht RenderWindow---------------------------------------------------------------------------------------
_IrrStart($IRR_EDT_opengl, 640, 480, $IRR_BITS_PER_PIXEL_32, $IRR_windowed, $IRR_SHADOWS, $IRR_capture_EVENTS, $IRR_VERTICAL_SYNC_Off)
_IrrSetWindowCaption( "IrrLicht Window")
_WinAPI_SetWindowRgn(WinGetHandle("IrrLicht Window", ""), _WinAPI_CreateRectRgn(3, 22, 640, 480)) ; Cut off IrrLicht Window Border

GUICtrlCreateButton("Hey1", 680, 40, 100, 22)
GUICtrlCreateButton("Hey2", 680, 80, 100, 22)
GUICtrlCreateButton("Hey3", 680, 120, 100, 22)


WinMove("IrrLicht Window", "", -3, -22)
_WinAPI_Setparent(WinGetHandle("IrrLicht Window", ""), $Gui)
WinActivate("AutoIt Window")

GUISetState()
;--------------------------------------------------------------------------------------------------------------------
;add your IrrLicht stuff here.....

WHILE _IrrRunning()

    _IrrBeginScene(128,128,128)
    _IrrDrawScene()
    _IrrEndScene()
    Sleep(5)


WEND

Func _exit()
    _IrrStop()
    Exit
EndFunc ; _exit

Some guy's script + some other guy's script = my script!

Link to comment
Share on other sites

Actually now that I started playing with it and reversed the setparrent part so that the gui is child to the irrlicht render
so to hide the controls I don't want to see I just call GUISetState (@SW_HIDE)

Also the way I want to make it I don't even need to make the gui transparent while it's visible 

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

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

×
×
  • Create New...