Ejemplo n.º 1
0
GlContext* GlContext::create()
{
    GlContext* context = new ContextType(sharedContext);
    context->initialize();

    return context;
}
Ejemplo n.º 2
0
GlContext* GlContext::New()
{
    GlContext* context = new ContextType(sharedContext);
    context->Initialize();

    return context;
}
Ejemplo n.º 3
0
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;
}
Ejemplo n.º 4
0
GlContext* GlContext::create()
{
    Lock lock(mutex);

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

    return context;
}
Ejemplo n.º 5
0
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;
}
Ejemplo n.º 6
0
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;
}
Ejemplo n.º 7
0
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;
}
Ejemplo n.º 8
0
Archivo: gl.cpp Proyecto: 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;
}