コード例 #1
0
ファイル: GlContext.cpp プロジェクト: SuitEmUp/SuitEmUp
GlContext* GlContext::create()
{
    GlContext* context = new ContextType(sharedContext);
    context->initialize();

    return context;
}
コード例 #2
0
ファイル: GlContext.cpp プロジェクト: coolhome/SFML
GlContext* GlContext::New()
{
    GlContext* context = new ContextType(sharedContext);
    context->Initialize();

    return context;
}
コード例 #3
0
ファイル: GlContext.cpp プロジェクト: bacsmar/SFML
GlContext* GlContext::create(const ContextSettings& settings, unsigned int width, unsigned int height)
{
    // Make sure that there's an active context (context creation may need extensions, and thus a valid context)
    assert(sharedContext != NULL);

    Lock lock(mutex);

    GlContext* context = NULL;

    // We don't use acquireTransientContext here since we have
    // to ensure we have exclusive access to the shared context
    // in order to make sure it is not active during context creation
    {
        sharedContext->setActive(true);

        // Create the context
        context = new ContextType(sharedContext, settings, width, height);

        sharedContext->setActive(false);
    }

    context->initialize(settings);
    context->checkSettings(settings);

    return context;
}
コード例 #4
0
ファイル: GlContext.cpp プロジェクト: JackLinMaker/SFML
GlContext* GlContext::create()
{
    Lock lock(mutex);

    // Create the context
    GlContext* context = new ContextType(sharedContext);
    context->initialize();

    return context;
}
コード例 #5
0
ファイル: GlContext.cpp プロジェクト: SuitEmUp/SuitEmUp
GlContext* GlContext::create(const ContextSettings& settings, unsigned int width, unsigned int height)
{
    // Make sure that there's an active context (context creation may need extensions, and thus a valid context)
    ensureContext();

    // Create the context
    GlContext* context = new ContextType(sharedContext, settings, width, height);
    context->initialize();

    return context;
}
コード例 #6
0
ファイル: GlContext.cpp プロジェクト: SuitEmUp/SuitEmUp
GlContext* GlContext::create(const ContextSettings& settings, const WindowImpl* owner, unsigned int bitsPerPixel)
{
    // Make sure that there's an active context (context creation may need extensions, and thus a valid context)
    ensureContext();

    // Create the context
    GlContext* context = new ContextType(sharedContext, settings, owner, bitsPerPixel);
    context->initialize();

    return context;
}
コード例 #7
0
ファイル: OpenGl.cpp プロジェクト: ongbe/gui-1
void
OpenGl::flush() {

	LOG_ALL(opengllog) << "attempting to flush current context" << std::endl;

	GlContext* context = getInstance()->_context.get();

	if (context != 0)
		context->flush();
	else
		LOG_ALL(opengllog) << "there is no current context in this thread" << std::endl;
}
コード例 #8
0
ファイル: gl.cpp プロジェクト: nyorain/ny
bool shared(GlContext& a, GlContext& b)
{
	std::lock_guard<std::mutex> lock(contextShareMutex());
	const auto& shared = a.shared();

	for(auto& c : shared) if(c == &b) return true;
	return false;
}