Class Info |
|---|
class CGKitInterface CG Kit接口类,可设置、获取应用程序,获取屏幕宽高比及宽度、高度等。 |
Qualifier and Type |
Method Name and Description |
|---|---|
void |
SetApplication(BaseApplication* application) 设置应用程序。 |
const BaseApplication* |
GetApplication() const 获取当前应用程序。 |
GetAspectRatio() const 获取屏幕宽高比。 |
|
GetScreenWidth() const 获取屏幕宽度。 |
|
GetScreenHeight() const 获取屏幕高度。 |
|
bool |
IsPlatformSupported() const 判断CG Kit是否支持当前平台。目前支持Android 8.0及其以上版本。 |
GetProgramDirectory()const 获取工程目录。 |
|
static CGKitInterface& |
获取CG Kit接口实例。 |
bool |
SetMultiThreadRendering(bool isOpen) 设置多线程渲染开关,适用于CPU侧重负载场景,建议模型数在5000以上再开启。 |
SetThreadCount(u32 count) 设置多线程数,需在多线程开启前设置,开启后设置无效,可设置的区间为[2, 手机的核数];该方法为非必须调用,系统会默认设置线程数为手机核数的一半减一。 |
|
void |
SetSceneManagerType(SceneManagerType sceneManagerType) 设置场景管理器类型,不设置时默认使用四叉树场景管理器。 |
void |
SetRenderingSortType(RenderingSortType sortType) 设置渲染排序类型。 |
void |
SetMSAA(bool enable) 设置MSAA。 |
void |
SetSampleCount(SampleCountFlagBits sampleCount) 设置采样数。 |
void |
SetSampleShading(bool enable) 设置Sample Shading。 |
void |
SetMinSampleShading(f32 minSampleShading) 设置最小着色率。 |
Method |
|---|
void SetApplication(BaseApplication* application) 设置应用程序。 |
Parameters
Name |
Description |
|---|---|
application |
指向当前使用应用程序的指针。 |
Method |
|---|
const BaseApplication* GetApplication() const 获取当前应用程序。 |
Returns
Type |
Description |
|---|---|
const BaseApplication* |
返回指向当前应用程序的指针。 |
Method |
|---|
u32 GetScreenWidth() const 获取屏幕宽度。 |
Returns
Type |
Description |
|---|---|
返回32位无符号整数类型屏幕宽度。 |
Method |
|---|
u32 GetScreenHeight() const 获取屏幕高度。 |
Returns
Type |
Description |
|---|---|
返回32位无符号整数类型屏幕高度。 |
Method |
|---|
bool IsPlatformSupported() const 判断CG Kit是否支持当前平台。目前支持Android 8.0及其以上版本。 |
Returns
Type |
Description |
|---|---|
bool |
|
Method |
|---|
String GetProgramDirectory() const 获取工程目录。 |
Returns
Type |
Description |
|---|---|
工程目录。 |
Method |
|---|
static CGKitInterface& GetInstance() 获取CG Kit接口实例。 |
Returns
Type |
Description |
|---|---|
static CGKitInterface& |
返回CG Kit接口实例的引用。 |
Method |
|---|
bool SetMultiThreadRendering(bool isOpen) 多线程渲染开关接口,默认为false,关闭。 |
Parameters
Name |
Description |
|---|---|
isOpen |
关闭或者开启,true为开启,false为关闭。 |
Returns
Type |
Description |
|---|---|
bool |
|
Method |
|---|
| 设置多线程数,需在多线程开启前设置,开启后设置无效,可设置的区间为[2, 手机的核数];该方法为非必须调用,系统会默认设置线程数为手机核数的一半减一。 |
Parameters
Name |
Description |
|---|---|
设置开启的线程数,可设置的区间为[2, 手机的核数]。 |
Returns
Type |
Description |
|---|---|
返回成功设置的线程数。 |
Method |
|---|
void SetSceneManagerType(SceneManagerType sceneManagerType) 设置场景管理器类型,不设置时默认使用四叉树场景管理器。 |
Parameters
Name |
Description |
|---|---|
sceneManagerType |
场景管理器类型。
|
Parameters
Name |
Description |
|---|---|
sortType |
排序类型。默认值为RENDERING_SORT_TYPE_DISTANCE。 |
Parameters
Name |
Description |
|---|---|
enable |
|
Parameters
Name |
Description |
|---|---|
sampleCount |
采样数类型。默认值为SAMPLE_COUNT_1_BIT。 具体请参见SampleCountFlagBits。 |
Parameters
Name |
Description |
|---|---|
enable |
|
Parameters
Name |
Description |
|---|---|
minSampleShading |
最小着色率。默认值为0.0f。 取值范围为[0.0f, 1.0f],其值越接近1,图像越平滑。 |