描述
bin目录中的Urho3D播放器应用程序包含所有引擎运行时功能。但是,它不包含任何内置逻辑,因此必须提供它应该运行的应用程序脚本文件的名称:
Urho3DPlayer <scriptfilename> [options]
默认支持的脚本语言是AngelScript(http://www.angelcode.com/angelscript); 脚本文件的扩展名为.as,需要放在bin/Data或bin/CoreData子目录下,以便Urho3DPlayer可以找到它们。应用程序脚本需要有void Start()函数,该函数将在启动引擎主循环之前执行。该函数负责初始化应用程序并连接到任何必要的事件,例如每帧发生的更新。
可以选择内置Lua语言支持,请参阅构建选项。
如果Urho3DPlayer没有任何命令行参数,它将从文件bin/Data/CommandLine.txt中读取命令行。这主要用于无法输入命令行的移动平台。默认情况下,将运行NinjaSnowWar示例。
命令行选项
可以使用以下命令行选项配置引擎。
-x <res> Horizontal resolution
-y <res> Vertical resolution
-m <level> Enable hardware multisampling
-v Enable vertical sync
-t Enable triple buffering
-w Start in windowed mode
-s Enable resizing when in windowed mode
-q Enable quiet mode which does not log to standard output stream
-b <length> Sound buffer length in milliseconds
-r <freq> Sound mixing frequency in Hz
-pp <paths> Resource prefix path(s), separated by semicolons, default to executable path
The resource prefix paths can also be defined using URHO3D_PREFIX_PATH env-var
When both are defined, the paths set by -pp takes higher precedence
-p <paths> Resource path(s) to use, separated by semicolons, default to 'Data;CoreData'
-pf <files> Resource package file to use, separated by semicolons, default to none
-ap <paths> Resource autoload path(s), separated by semicolons, default to 'AutoLoad'
-log <level> Change the log level, valid 'level' values: 'debug', 'info', 'warning', 'error'
-ds <file> Dump used shader variations to a file for precaching
-mq <level> Material quality level, default 2 (high)
-tq <level> Texture quality level, default 2 (high)
-tf <level> Texture filter mode, default 2 (trilinear)
-af <level> Texture anisotropy level, default 4. Also sets anisotropic filter mode
-opengl Use OpenGL API
-gl2 Force OpenGL 2 use even if OpenGL 3 is available
-d3d9 Use Direct3D 9 API
-d3d11 Use Direct3D 11 API
-flushgpu Flush GPU command queue each frame. Effective only on Direct3D
-borderless Borderless window mode
-lowdpi Force low DPI mode on Retina display
-headless Headless mode. No application window will be created
-landscape Use landscape orientations (iOS only, default)
-portrait Use portrait orientations (iOS only)
-monitor <num> Monitor number to use
-hz <freq> Monitor refresh rate to use
-prepass Use light pre-pass rendering
-deferred Use deferred rendering
-renderpath <name> Use the named renderpath (must enter full resource name)
-lqshadows Use low-quality (1-sample) shadow filtering
-noshadows Disable shadow rendering
-nolimit Disable frame limiter
-nothreads Disable worker threads
-nosound Disable sound output
-noip Disable sound mixing interpolation
-touch Touch emulation on desktop platform