Пример #1
0
void HsQMLContextControl::componentComplete()
{
    mDefer = false;
    if (mPending && mWhen) {
        controlContext();
    }
}
Пример #2
0
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();
    }
}
Пример #3
0
void HsQMLContextControl::setWhen(bool when)
{
    mWhen = when;
    if (mPending && !mDefer && mWhen) {
        controlContext();
    }
}
Пример #4
0
void HsQMLContextControl::setStencilBufferSize(int size)
{
    bool change = mStencilBufferSize != size;
    mStencilBufferSize = size;
    if (change) {
        controlContext();
    }
}
Пример #5
0
void HsQMLContextControl::setDepthBufferSize(int size)
{
    bool change = mDepthBufferSize != size;
    mDepthBufferSize = size;
    if (change) {
        controlContext();
    }
}
Пример #6
0
void HsQMLContextControl::setContextProfile(ContextProfile profile)
{
    bool change = mContextProfile != profile;
    mContextProfile = profile;
    if (change) {
        controlContext();
    }
}
Пример #7
0
void HsQMLContextControl::setContextType(ContextType type)
{
    bool change = mContextType != type;
    mContextType = type;
    if (change) {
        controlContext();
    }
}
Пример #8
0
void HsQMLContextControl::setMinorVersion(int minor)
{
    bool change = mMinorVersion != minor;
    mMinorVersion = minor;
    if (change) {
        controlContext();
    }
}
Пример #9
0
void HsQMLContextControl::setDeprecatedFunctions(bool df, bool set)
{
    bool change = (mDeprecatedFunctionsSet != set) ||
        (mDeprecatedFunctionsSet && (mDeprecatedFunctions != df));
    mDeprecatedFunctions = df;
    mDeprecatedFunctionsSet = set;
    if (change) {
        controlContext();
    }
}
Пример #10
0
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;
}