Function _IrrStart

au3Irr2

au3Irr2 Function Reference

_IrrStart

Opens the IrrlichtWrapper.dll, starts Irrlicht interface and opens a window for rendering.

#Include <au3Irrlicht2.au3>
_IrrStart($i_DeviceType=$IRR_EDT_DIRECT3D9, $i_ScreenWidth=800, $i_ScreenHeight=600, $i_BitsPerPixel=$IRR_BITS_PER_PIXEL_32, $b_FullScreen=$IRR_WINDOWED, $b_Shadows=$IRR_NO_SHADOWS, $b_InputCapture=$IRR_IGNORE_EVENTS, $b_VSync=$IRR_VERTICAL_SYNC_OFF)

 

Parameters

$i_DeviceType [optional] specifies the renderer to use when drawing to the display this may be one of the following types:
$IRR_EDT_NULL - A NULL device with no display
$IRR_EDT_SOFTWARE - Irrlichts default software renderer
$IRR_EDT_SOFTWARE2 - An improved quality software renderer
$IRR_EDT_OPENGL - Hardware accelerated OpenGL renderer
$IRR_EDT_DIRECT3D8 - Hardware accelerated DirectX 8 renderer
$IRR_EDT_DIRECT3D9 - Hardware accelerated DirectX 9 renderer
$i_ScreenWidth [optional] Screen width specifies the width of the viewport in pixels
$i_ScreenHeight [optional] Screen height specifies the height of the viewport in pixels
$i_BitsPerPixel [optional] The number of color bits that is used for each pixel 32 bit color gives 24 million different colors whereas 16 bit color gives only 32,000 colors. However the advantage of 16 bit color is that some operations use half the memory and can run at up to twice the speed.
This setting can be either of:
$IRR_BITS_PER_PIXEL_16
$IRR_BITS_PER_PIXEL_32
$b_FullScreen [optional] Specifies whether the display is to opened in full screen mode or in a window:
$IRR_WINDOWED - For window mode
$IRR_FULLSCREEN - For fullscreen mode. When using full screen mode you will need to adjust the window size to the same dimensions as a supported screen resolution on the target display 640x400 for example.
$b_Shadows [optional] Use shadows starts the engine in a mode that supports the rendering of stencil shadows.
$IRR_NO_SHADOWS - For a display that does not support shadows.
$IRR_SHADOWS - For a display that supports shadows.
$b_InputCapture [optional] Capture mouse and keyboard specified whether you want to capture keyboard and mouse events, if you choose to ignore them they will be handled by Irrlicht for FPS camera control. This parameter should be either of:
$IRR_IGNORE_EVENTS
$IRR_CAPTURE_EVENTS
$b_VSync [optional] Vertical syncronisation specifies whether the display of each new frame is syncronised with vertical refresh of the graphics card. This produces a smoother display and avoids 'tearing' where the viewer can see parts of two different frames at the same time. The setting can be either of:
$IRR_VERTICAL_SYNC_OFF
$IRR_VERTICAL_SYNC_ON

 

Return Value

Success: True
Failure: False and sets @error:
    1 - error occured on dll call
    2 - IrrlichtWrapper.dll not found

 

Remarks

if .dll cannot be opened, path environment is extended with:
- .\bin (allows an au3Irr2 script to have its binaries in a subdir) and
- .\.. (allows au3Irr2 examples to be started from their \include subdir).
Nevertheless, ensuring DLL's in a permanent dir reachable via path may be the better way, as the temporary update of environment can be time-consuming.

Other needed .dll's (Irrlicht.dll + maybe msvcp71.dll, msvcr71.dll) are NOT checked but simply expected to be at last in same dir as the IrrlichtWrapper.dll.

 

Related

_IrrStartAdvanced, _IrrRunning, _IrrStop

 

Example


#include "au3Irrlicht2.au3"

_IrrStart( $IRR_EDT_OPENGL, 800, 600, $IRR_BITS_PER_PIXEL_32, _
        $IRR_WINDOWED, $IRR_SHADOWS, $IRR_CAPTURE_EVENTS, $IRR_VERTICAL_SYNC_ON )

local $Camera = _IrrAddCamera(10,10,10, 0,0,0 )
local $testNode = _IrrAddTestSceneNode()
_IrrSetNodeMaterialTexture( $testNode, _IrrGetTexture(".\media\au3irr2_logo.jpg"), 0)
_IrrSetNodeMaterialFlag( $testNode, $IRR_EMF_LIGHTING, $IRR_OFF )

WHILE _IrrRunning()
    _IrrBeginScene(0, 0, 0)
    _IrrDrawScene()
    _IrrEndScene()
WEND

_IrrStop()