Function _IrrStartAdvanced

au3Irr2

au3Irr2 Function Reference

_IrrStartAdvanced

Opens the IrrlichtWrapper.dll and starts Irrlicht engine with advanced method.

#Include <au3Irrlicht2.au3>
_IrrStartAdvanced($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, $i_TypeOfDevice=0, $b_DoublebufferEnabled=$IRR_OFF, $i_AntialiasEnabled=0, $b_HighPrecisionFpu=$IRR_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
$i_TypeOfDevice [optional] Devicetype allows a specific type of device for example a windows screen or a console to be selected. For the time being this should be set to 0 which automatically selects the best device.
$b_DoublebufferEnabled [optional] Doublebufferenabled is used to control whether double buffering is used. When double buffering is used two drawing surfaces are created one for display and the other that is used for drawing too. Double buffering is required for anit-aliasing the options are:
$IRR_ON or $IRR_OFF
$i_AntialiasEnabled [optional] Antialiasenabled is used to enable the antialiasing effect, this effect produces a blurring at the edges of object giving their lines a smooth natural appearence. There is usually a big penalty for using this effect though sometimes as high as 30% of the frame rate or more. This is a value for the anti-aliasing and should be a power of 2.
(e.g: 2, 4, 8, 16)
$b_HighPrecisionFpu [optional] Highprecisionfpu is used to enable high precision Floating point calculations, that produce more accurate result at the expense of a slower operating speed.

 

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

_IrrStart, _IrrRunning, _IrrStop

 

Example


#include "au3Irrlicht2.au3"

_IrrStartAdvanced ( $IRR_EDT_OPENGL, 800, 600, $IRR_BITS_PER_PIXEL_32, _
        $IRR_WINDOWED, $IRR_SHADOWS, $IRR_CAPTURE_EVENTS, $IRR_VERTICAL_SYNC_ON, _
        0, $IRR_ON, 4, $IRR_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()