• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ createContext函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: main

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

  set_valid_time();

  cp = createContext(argc, argv);

  ver_WriteVersionInfo("Proview Runtime Environment");

  if (cp->flags.b.restart) {
    sts = interactive(argc, argv, cp);
  } else 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:jordibrus,项目名称:proview,代码行数:23,代码来源:rt_ini.c


示例17: _window

GlContext::GlContext(ContextSettings& settings, GlContext* share) :
	_window(0),
	_ownWindow(true),
	_context(0),
	_active(false) {

	_display = XOpenDisplay(0);

	// create a dummy window to associate this context with
	int screen = DefaultScreen(_display);
	_window = XCreateWindow(
			_display,
			RootWindow(_display, screen),
			0, 0, 1, 1,
			0,
			DefaultDepth(_display, screen),
			InputOutput,
			DefaultVisual(_display, screen),
			0, NULL);

	// initialize the context
	createContext(settings, share);
}
开发者ID:ongbe,项目名称:gui-1,代码行数:23,代码来源:GlxContext.cpp


示例18: createContext

void HeadlessView::activate() {
    active = true;

    if (!glContext) {
        if (!display) {
            throw std::runtime_error("Display is not set");
        }
        createContext();
    }

    activateContext();

    if (!extensionsLoaded) {
        gl::InitializeExtensions(initializeExtension);
        extensionsLoaded = true;
    }

    if (needsResize) {
        clearBuffers();
        resizeFramebuffer();
        needsResize = false;
    }
}
开发者ID:OrdnanceSurvey,项目名称:mapbox-gl-native,代码行数:23,代码来源:headless_view.cpp


示例19: r_context

//------------------------------------------------------------------------------
GLContextImpl::GLContextImpl(GLContext & context, GLContextSettings & settings, GLContextImpl * sharedContext) :
	r_context(context),
    m_hrc(nullptr),
    m_dc(nullptr),
    m_ownHwnd(nullptr)
{
    // Get the HWND from either the passed window or an internal one
    HWND hwnd = nullptr;
	const Window * win = r_context.getWindow();
    if (win)
    {
        // A window was given, go with it
    	hwnd = (HWND)win->getHandle();
    }
    else
    {
        // No window was given...
        // On Windows, we still have to create a dummy window to get a valid DC
        m_ownHwnd = ::CreateWindow("STATIC", "", WS_POPUP | WS_DISABLED, 0, 0, 1, 1, NULL, NULL, GetModuleHandle(NULL), NULL);
        ShowWindow(m_ownHwnd, SW_HIDE);
        hwnd = m_ownHwnd;
    }

	m_dc = GetDC(hwnd);

	if (m_dc)
	{
        GLContextSettings initialSettings = settings;
		createContext(sharedContext ? sharedContext->m_hrc : nullptr, settings, hwnd);
		if (settings != initialSettings)
		{
			SN_WARNING("ContextSettings have been changed for compatibility.");
			SN_LOG("Requested: " << r_context.getSettings().toString());
			SN_LOG("Changed to: " << settings.toString());
		}
	}
}
开发者ID:Zylann,项目名称:SnowfeetEngine,代码行数:38,代码来源:GLContext_win32.cpp


示例20: buffer

/**
 * \brief Sends a notification to Growl.
 *
 * \param name the registered name of the notification.
 * \param title the title for the notification.
 * \param description the description of the notification.
 * \param icon the icon of the notification.
 * \param sticky whether the notification should be sticky (i.e. require a 
 *	click to discard.
 * \param receiver the receiving object which will be signaled when the
 *	notification is clicked. May be NULL.
 * \param slot the slot to be signaled when the notification is clicked.
 * \param context the context which will be passed back to the slot
 *	May be NULL.
 */
void GrowlNotifier::notify(const QString& name, const QString& title, 
	const QString& description, const QPixmap& p, bool sticky, 
	const QObject* receiver, 
	const char* clicked_slot, const char* timeout_slot, 
	void* qcontext)
{
	// Convert the image if necessary
	CFDataRef icon = 0;
	if (!p.isNull()) {
		QByteArray img_data;
		QBuffer buffer(&img_data);
		buffer.open(QIODevice::WriteOnly);
		p.save(&buffer, "PNG");
		icon = CFDataCreate( NULL, (UInt8*) img_data.data(), img_data.size());
	}

	// Convert strings
	CFStringRef cf_title = qString2CFString(title);
	CFStringRef cf_description = qString2CFString(description);
	CFStringRef cf_name = qString2CFString(name);

	// Do notification
	CFPropertyListRef context = createContext(signaler_, receiver, clicked_slot, timeout_slot, qcontext/*, getpid()*/);
	Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext(
		cf_title, cf_description, cf_name, icon, 0, sticky, context);
	
	// Release intermediary datastructures
	CFRelease(context);
	if (icon) 
		CFRelease(icon);
	if (cf_title) 
		CFRelease(cf_title);
	if (cf_description) 
		CFRelease(cf_description);
	if (cf_name) 
		CFRelease(cf_name);
}
开发者ID:ZloeSabo,项目名称:qutim-0.2-growlnotifications,代码行数:52,代码来源:growlnotification.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ createContextMenu函数代码示例发布时间:2022-05-30
下一篇:
C++ createConnections函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap