当前位置: 首页>>代码示例>>C++>>正文


C++ createContext函数代码示例

本文整理汇总了C++中createContext函数的典型用法代码示例。如果您正苦于以下问题:C++ createContext函数的具体用法?C++ createContext怎么用?C++ createContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了createContext函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createContext

FontConverter::FontConverter(const Arguments& arguments): Platform::WindowlessApplication(arguments, nullptr) {
    args.addArgument("input").setHelp("input", "input font")
        .addArgument("output").setHelp("output", "output filename prefix")
        .addNamedArgument("font").setHelp("font", "font plugin")
        .addNamedArgument("converter").setHelp("converter", "font converter plugin")
        .addOption("plugin-dir", MAGNUM_PLUGINS_DIR).setHelpKey("plugin-dir", "DIR").setHelp("plugin-dir", "base plugin dir")
        .addOption("characters", "abcdefghijklmnopqrstuvwxyz"
                                 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                                 "0123456789?!:;,. ").setHelp("characters", "characters to include in the output")
        .addOption("font-size", "128").setHelpKey("font-size", "N").setHelp("font-size", "input font size")
        .addOption("atlas-size", "2048 2048").setHelpKey("atlas-size", "\"X Y\"").setHelp("atlas-size", "glyph atlas size")
        .addOption("output-size", "256 256").setHelpKey("output-size", "\"X Y\"").setHelp("output-size", "output atlas size. If set to zero size, distance field computation will not be used.")
        .addOption("radius", "24").setHelpKey("radius", "N").setHelp("radius", "distance field computation radius")
        .setHelp("Converts font to raster one of given atlas size.")
        .parse(arguments.argc, arguments.argv);

    createContext();
}
开发者ID:TUZIHULI,项目名称:magnum,代码行数:18,代码来源:fontconverter.cpp

示例2: createRuntime

bool JSAPITest::init()
{
    rt = createRuntime();
    if (!rt)
        return false;
    cx = createContext();
    if (!cx)
        return false;
#ifdef JS_GC_ZEAL
    JS_SetGCZeal(cx, 0, 0);
#endif
    JS_BeginRequest(cx);
    js::RootedObject global(cx, createGlobal());
    if (!global)
        return false;
    oldCompartment = JS_EnterCompartment(cx, global);
    return oldCompartment != NULL;
}
开发者ID:LyeSS,项目名称:mozilla-central,代码行数:18,代码来源:tests.cpp

示例3: createContext

GLC_Context* GLC_ContextManager::currentContext()
{
    QOpenGLContext* pFromContext= QOpenGLContext::currentContext();
    GLC_Context* pSubject= NULL;
    if (NULL != pFromContext)
    {
        if (m_OpenGLContextToGLCContext.contains(pFromContext))
        {
            pSubject= m_OpenGLContextToGLCContext.value(pFromContext);
        }
        else
        {
            pSubject= createContext(pFromContext, pFromContext->surface());
        }
        pSubject->setCurrent();
    }

    return pSubject;
}
开发者ID:cweiland,项目名称:GLC_lib,代码行数:19,代码来源:glc_contextmanager.cpp

示例4: m_window

GlContext::GlContext(const ContextSettings& settings, const priv::WindowImplWin32* owner, unsigned int bitsPerPixel)
:
m_window(NULL),
m_deviceContext(NULL),
m_context(NULL),
m_ownsWindow(false)
{
	// Get the owner window and its device context
	m_window = owner->getSystemHandle();
	m_deviceContext = GetDC(m_window);

	// Create the context
	if (m_deviceContext)
	{
		createContext(bitsPerPixel, settings);
	}

	makeCurrent();
}
开发者ID:MrShedman,项目名称:GL-Dev-2D,代码行数:19,代码来源:GlContext.cpp

示例5: Q_D

void QQuickCanvasItem::setContextType(const QString &contextType)
{
    Q_D(QQuickCanvasItem);

    if (contextType.compare(d->contextType, Qt::CaseInsensitive) == 0)
        return;

    if (d->context) {
        qmlInfo(this) << "Canvas already initialized with a different context type";
        return;
    }

    d->contextType = contextType;

    if (d->available)
        createContext(contextType);

    emit contextTypeChanged();
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:19,代码来源:qquickcanvasitem.cpp

示例6: main

int main (int argc, char **argv)
{
  ini_sContext *cp;
  pwr_tStatus sts;

  cp = createContext(argc, argv);

  ver_WriteVersionInfo("Proview/R Storage Environment");

  if (cp->flags.b.stop) {
    sts = stop(argc, argv, cp);
  } else {
    sts = start(cp);
    sts = events(cp);
    errh_LogInfo(&cp->log, "Ich sterbe!!");
  }

  exit(sts);
}
开发者ID:hfuhuang,项目名称:proview,代码行数:19,代码来源:sev_ini.c

示例7: m_deviceContext

WglContext::WglContext(WglContext* shared) :
m_window       (NULL),
m_deviceContext(NULL),
m_context      (NULL),
m_ownsWindow   (true)
{
    // Creating a dummy window is mandatory: we could create a memory DC but then
    // its pixel format wouldn't match the regular contexts' format, and thus
    // wglShareLists would always fail. Too bad...

    // Create a dummy window (disabled and hidden)
    m_window = CreateWindowA("STATIC", "", WS_POPUP | WS_DISABLED, 0, 0, 1, 1, NULL, NULL, GetModuleHandle(NULL), NULL);
    ShowWindow(m_window, SW_HIDE);
    m_deviceContext = GetDC(m_window);

    // Create the context
    if (m_deviceContext)
        createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, ContextSettings());
}
开发者ID:AnatoliiPotapov,项目名称:SFML,代码行数:19,代码来源:WglContext.cpp

示例8: createContext

void QgsLocatorWidget::updateResults( const QString &text )
{
  if ( mLocator->isRunning() )
  {
    // can't do anything while a query is running, and can't block
    // here waiting for the current query to cancel
    // so we queue up this string until cancel has happened
    mLocator->cancelWithoutBlocking();
    mNextRequestedString = text;
    mHasQueuedRequest = true;
    return;
  }
  else
  {
    mHasSelectedResult = false;
    mLocatorModel->deferredClear();
    mLocator->fetchResults( text, createContext() );
  }
}
开发者ID:exlimit,项目名称:QGIS,代码行数:19,代码来源:qgslocatorwidget.cpp

示例9: processFunction

static void processFunction (tokenInfo *const token)
{
	int c;
	tokenInfo *classType;

	/* Search for function name
	 * Last identifier found before a '(' or a ';' is the function name */
	c = skipWhite (vGetc ());
	do
	{
		readIdentifier (token, c);
		c = skipWhite (vGetc ());
		/* Identify class type prefixes and create respective context*/
		if (isLanguage (Lang_systemverilog) && c == ':')
		{
			c = vGetc ();
			if (c == ':')
			{
				verbose ("Found function declaration with class type %s\n", vStringValue (token->name));
				classType = newToken ();
				vStringCopy (classType->name, token->name);
				classType->kind = K_CLASS;
				createContext (classType);
				currentContext->classScope = TRUE;
			}
			else
			{
				vUngetc (c);
			}
		}
	} while (c != '(' && c != ';' && c != EOF);

	if ( vStringLength (token->name) > 0 )
	{
		verbose ("Found function: %s\n", vStringValue (token->name));

		/* Create tag */
		createTag (token);

		/* Get port list from function */
		processPortList (c);
	}
}
开发者ID:Luoben,项目名称:ctags,代码行数:43,代码来源:verilog.c

示例10: initRenderingContext

bool EglHwcomposerBackend::initRenderingContext()
{
    if (!initBufferConfigs()) {
        return false;
    }

    if (!createContext()) {
        return false;
    }

    m_nativeSurface = m_backend->createSurface();
    EGLSurface surface = eglCreateWindowSurface(eglDisplay(), config(), (EGLNativeWindowType)static_cast<ANativeWindow*>(m_nativeSurface), nullptr);
    if (surface == EGL_NO_SURFACE) {
        qCCritical(KWIN_HWCOMPOSER) << "Create surface failed";
        return false;
    }
    setSurface(surface);

    return makeContextCurrent();
}
开发者ID:KDE,项目名称:kwin,代码行数:20,代码来源:egl_hwcomposer_backend.cpp

示例11: main

int main(int argc, char** argv)
{
  ini_sContext* cp;
  pwr_tStatus sts;

  set_valid_time();

  cp = createContext(argc, argv);

  ver_WriteVersionInfo("ProviewR Runtime Environment");

  if (cp->flags.b.restart)
  {
    sts = interactive(argc, argv, cp);
  }
  else if (cp->flags.b.stop)
  {
    sts = stop(cp);
  }
  else
  {
    // Now lets daemonize if asked to
    if (cp->flags.b.daemonize)
    {
      daemonize();
    }

    sts = start(cp);

    // Now lets create the pid file before starting our endless event loop
    if (cp->flags.b.daemonize)
    {
      create_pidfile();
    }

    sts = events(cp);
    errh_LogInfo(&cp->log, "Ich sterbe!!");
  }

  exit(sts);
}
开发者ID:siamect,项目名称:proview,代码行数:41,代码来源:rt_ini.c

示例12: m_display

GlxContext::GlxContext(GlxContext* shared) :
m_display   (NULL),
m_window    (0),
m_context   (NULL),
m_pbuffer   (0),
m_ownsWindow(false)
{
    // Save the creation settings
    m_settings = ContextSettings();

    // Make sure that extensions are initialized if this is not the shared context
    // The shared context is the context used to initialize the extensions
    if (shared && shared->m_display)
        ensureExtensionsInit(shared->m_display, DefaultScreen(shared->m_display));

    // Create the rendering surface (window or pbuffer if supported)
    createSurface(shared, 1, 1, VideoMode::getDesktopMode().bitsPerPixel);

    // Create the context
    createContext(shared);
}
开发者ID:criptych,项目名称:SFML,代码行数:21,代码来源:GlxContext.cpp

示例13: _glfwCreateContext

int _glfwCreateContext(_GLFWwindow* window,
                       const _GLFWwndconfig* wndconfig,
                       const _GLFWfbconfig* fbconfig)
{
    _GLFWfbconfig closest;

    window->WGL.DC = GetDC(window->Win32.handle);
    if (!window->WGL.DC)
    {
        _glfwSetError(GLFW_PLATFORM_ERROR,
                      "Win32: Failed to retrieve DC for window");
        return GL_FALSE;
    }

    // Choose the best available fbconfig
    {
        unsigned int fbcount;
        _GLFWfbconfig* fbconfigs;
        const _GLFWfbconfig* result;

        fbconfigs = getFBConfigs(window, &fbcount);
        if (!fbconfigs)
            return GL_FALSE;

        result = _glfwChooseFBConfig(fbconfig, fbconfigs, fbcount);
        if (!result)
        {
            _glfwSetError(GLFW_FORMAT_UNAVAILABLE,
                          "Win32/WGL: No pixel format matched the criteria");

            free(fbconfigs);
            return GL_FALSE;
        }

        closest = *result;
        free(fbconfigs);
    }

    return createContext(window, wndconfig, (int) closest.platformID);
}
开发者ID:Bloodknight,项目名称:glfw,代码行数:40,代码来源:wgl_context.c

示例14: m_window

GlxContext::GlxContext(GlxContext* shared, const ContextSettings& settings, unsigned int width, unsigned int height) :
m_window    (0),
m_context   (NULL),
m_ownsWindow(true)
{
    // Open a connection with the X server
    m_display = OpenDisplay();

    // Create the hidden window
    int screen = DefaultScreen(m_display);
    m_window = XCreateWindow(m_display,
                             RootWindow(m_display, screen),
                             0, 0,
                             width, height,
                             0,
                             DefaultDepth(m_display, screen),
                             InputOutput,
                             DefaultVisual(m_display, screen),
                             0, NULL);

    // Create the context
    createContext(shared, VideoMode::getDesktopMode().bitsPerPixel, settings);
}
开发者ID:HOOPLAH,项目名称:Fission,代码行数:23,代码来源:GlxContext.cpp

示例15: finalizeEventHandler

void Window::windowed()
{
    if (FullScreenMode != m_mode)
        return;

    int w = m_windowedModeSize.x;
    int h = m_windowedModeSize.y;

    ContextFormat format = m_context->format();

    finalizeEventHandler();
    WindowEventDispatcher::deregisterWindow(this);
    destroyContext();


    if (createContext(format, w, h, nullptr))
    {
        WindowEventDispatcher::registerWindow(this);
        initializeEventHandler();

        m_mode = WindowMode;
    }
}
开发者ID:SebSchmech,项目名称:gloperate,代码行数:23,代码来源:Window.cpp


注:本文中的createContext函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。