本文整理汇总了C++中GHOST_ISystem::addEventConsumer方法的典型用法代码示例。如果您正苦于以下问题:C++ GHOST_ISystem::addEventConsumer方法的具体用法?C++ GHOST_ISystem::addEventConsumer怎么用?C++ GHOST_ISystem::addEventConsumer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GHOST_ISystem
的用法示例。
在下文中一共展示了GHOST_ISystem::addEventConsumer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GHOST_AddEventConsumer
GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
{
GHOST_ISystem *system = (GHOST_ISystem *) systemhandle;
return system->addEventConsumer((GHOST_CallbackEventConsumer *)consumerhandle);
}
示例2: main
//.........这里部分代码省略.........
}
else {
title = "blenderplayer";
}
#ifdef WIN32
if (scr_saver_mode == SCREEN_SAVER_MODE_PREVIEW)
{
app.startScreenSaverPreview(scr_saver_hwnd, stereoWindow, stereomode, aasamples);
}
else
#endif
{
if (parentWindow != 0)
app.startEmbeddedWindow(title, parentWindow, stereoWindow, stereomode, aasamples);
else
app.startWindow(title, windowLeft, windowTop, windowWidth, windowHeight,
stereoWindow, stereomode, aasamples);
if (SYS_GetCommandLineInt(syshandle, "nomipmap", 0)) {
GPU_set_mipmap(0);
}
GPU_set_anisotropic(U.anisotropic_filter);
GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
}
}
}
else {
app.StartGameEngine(stereomode);
exitcode = KX_EXIT_REQUEST_NO_REQUEST;
}
// Add the application as event consumer
system->addEventConsumer(&app);
// Enter main loop
bool run = true;
char *python_main = NULL;
pynextframestate.state = NULL;
pynextframestate.func = NULL;
#ifdef WITH_PYTHON
python_main = KX_GetPythonMain(scene);
#endif // WITH_PYTHON
if (python_main) {
char *python_code = KX_GetPythonCode(maggie, python_main);
if (python_code) {
#ifdef WITH_PYTHON
gpg_nextframestate.system = system;
gpg_nextframestate.app = &app;
gpg_nextframestate.gs = &gs;
pynextframestate.state = &gpg_nextframestate;
pynextframestate.func = &GPG_PyNextFrame;
printf("Yielding control to Python script '%s'...\n", python_main);
PyRun_SimpleString(python_code);
printf("Exit Python script '%s'\n", python_main);
#endif // WITH_PYTHON
MEM_freeN(python_code);
}
else {
fprintf(stderr, "ERROR: cannot yield control to Python: no Python text data block named '%s'\n", python_main);
}
}
else {
while (run) {
run = GPG_NextFrame(system, &app, exitcode, exitstring, &gs);