// 库文件引入
#ifdef __QNX__
screen_window_t* kzsWindowNativeGetScreenWindow(struct KzsWindowNative* windowNative);
struct KzsDesktopNative* kzsDesktopGetNative(const struct KzsDesktop* desktop);
screen_context_t* kzsDesktopNativeGetScreenContext(struct KzsDesktopNative* desktopNative);
#include
#include
#include
#define EGL_EGLEXT_PROTOTYPES = 1
#define GL_GLEXT_PROTOTYPES = 1
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#endif
// 配置可执行程序name=TestDemo
#ifdef __QNX__
shared_ptr output = dynamic_pointer_cast(getGraphicsOutput());
KzsDesktopNative* desktopNative = kzsDesktopGetNative(output->getDesktop());
screen_window_t mainWindow = *kzsWindowNativeGetScreenWindow(kzsWindowGetNative(output->getWindow()));
char new_name[64] = "TestDemo";
screen_set_window_property_cv(mainWindow, SCREEN_PROPERTY_ID_STRING, sizeof(new_name), new_name);
screen_buffer_t screen_buf[2];
screen_get_window_property_pv(mainWindow, SCREEN_PROPERTY_RENDER_BUFFERS, (void **)screen_buf);
//KzLogDebug(("set Window Name {}", new_name));
int rc = screen_post_window(mainWindow, screen_buf[0], 0, NULL, 0);
if (rc) {
//KzLogDebug(("Kanzi screen_post_window failed."));
}
#endif
virtual void onConfigure(ApplicationProperties& configuration) KZ_OVERRIDE
{
configuration.binaryName = "demotest.kzb.cfg";
// 配置可执行程序的groupname
configuration.defaultWindowProperties.groupName = string("TEST_DEMO");
configuration.defaultWindowProperties.width = 1280;
configuration.defaultWindowProperties.height = 720;
// 配置kanzi工程的rgba参数为8位使在kzb中设置透明背景生效
configuration.defaultSurfaceProperties.bitsColorR = 8;
configuration.defaultSurfaceProperties.bitsColorG = 8;
configuration.defaultSurfaceProperties.bitsColorB = 8;
configuration.defaultSurfaceProperties.bitsAlpha = 8;
}
SurfaceBitsRed = 8
SurfaceBitsGreen = 8
SurfaceBitsBlue = 8
SurfaceBitsAlpha = 8
DefaultDisplayIndex = 1
application.cfg example |
|
example |
|