void HsQMLContextControl::componentComplete() { mDefer = false; if (mPending && mWhen) { controlContext(); } }
void HsQMLContextControl::doWindowChanged(QQuickWindow* win) { if (mWindow) { QObject::disconnect(mWindow, 0, this, 0); } mWindow = win; if (mWindow) { QObject::connect( mWindow, SIGNAL(sceneGraphInitialized()), this, SLOT(doSceneGraphInit())); mOriginal = mWindow->requestedFormat(); mCurrent = mWindow->openglContext() ? mWindow->openglContext()->format() : mWindow->format(); } else { mOriginal = QSurfaceFormat(); mCurrent = QSurfaceFormat(); } contextChanged(); if ((mMajorVersion >=0) || (mMinorVersion >= 0) || (mContextType != TypeUnset) || (mContextProfile != ProfileUnset) || !mDeprecatedFunctionsSet) { controlContext(); } }
void HsQMLContextControl::setWhen(bool when) { mWhen = when; if (mPending && !mDefer && mWhen) { controlContext(); } }
void HsQMLContextControl::setStencilBufferSize(int size) { bool change = mStencilBufferSize != size; mStencilBufferSize = size; if (change) { controlContext(); } }
void HsQMLContextControl::setDepthBufferSize(int size) { bool change = mDepthBufferSize != size; mDepthBufferSize = size; if (change) { controlContext(); } }
void HsQMLContextControl::setContextProfile(ContextProfile profile) { bool change = mContextProfile != profile; mContextProfile = profile; if (change) { controlContext(); } }
void HsQMLContextControl::setContextType(ContextType type) { bool change = mContextType != type; mContextType = type; if (change) { controlContext(); } }
void HsQMLContextControl::setMinorVersion(int minor) { bool change = mMinorVersion != minor; mMinorVersion = minor; if (change) { controlContext(); } }
void HsQMLContextControl::setDeprecatedFunctions(bool df, bool set) { bool change = (mDeprecatedFunctionsSet != set) || (mDeprecatedFunctionsSet && (mDeprecatedFunctions != df)); mDeprecatedFunctions = df; mDeprecatedFunctionsSet = set; if (change) { controlContext(); } }
int gameloop(GLFWwindow* window) { GLFWControlContext controlContext(window); GlhckGLFWRenderContext renderContext(window); GLFWTimeContext timeContext; ew::Engine engine(&controlContext, &renderContext, &timeContext); glfwSetWindowUserPointer(window, &engine); glfwSetWindowSizeCallback(window, windowResizeCallback); GameState::init(); GameState game(&engine); engine.addState(0, &game); engine.setState(0); glhckMemoryGraph(); engine.run(); GameState::term(); return EXIT_SUCCESS; }