Exemplo n.º 1
0
void PipelineComposer::open()
{
    setShort(true);

    // create server cross connection
    _clusterWindow->getNetwork()->connectAllGroupToPoint(clusterId(),
            "StreamSock");
    // do not buffer any data
    for(UInt32 i=0 ; i <= serverCount() ; ++i)
        clusterWindow()->getNetwork()->getConnection(i)->forceDirectIO();
    if(!_isClient)
    {
        // create barrier
        _lock = Lock::get("PipelineComposer");
        // create barrier
        _barrier = Barrier::get("PipelineComposer");
        _frameEndBarrier = Barrier::get("PipelineComposerFrameEnd");
        // create writer thread
        _writer = BaseThread::get("PipelineComposer");
        // start writer thread
        _writer->runFunction( writeProc, this );
    }
    if(!_isClient && getPipelined())
    {
        _composeBarrier = Barrier::get("PipelineComposerCompose");
//        _composer = BaseThread::get("PipelineComposerCompose");
        _composer = dynamic_cast<Thread *>(ThreadManager::the()->getThread(NULL));
        _composer->runFunction( composeProc,0, this );
    }

#ifdef USE_NV_OCCLUSION
    glGenOcclusionQueriesNV(1, &_occlusionQuery);
#endif
}
/**
  * Default object constructor
  * 
  */
GLHardwareOcclusionQuery::GLHardwareOcclusionQuery() 
{ 
	// Check for hardware occlusion support
    if(GLEW_VERSION_1_5 || GLEW_ARB_occlusion_query)
	{
	    glGenQueriesARB(1, &mQueryID );	
	}
	else if (GLEW_NV_occlusion_query)
	{
		glGenOcclusionQueriesNV(1, &mQueryID);
	}
	else
    {
        OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, 
                    "Cannot allocate a Hardware query. This video card doesn't support it, sorry.", 
                    "GLHardwareOcclusionQuery::GLHardwareOcclusionQuery" );
    }
	
}
Exemplo n.º 3
0
PerfQueryGLESNV::PerfQueryGLESNV()
{
	for (ActiveQuery& query : m_query_buffer)
		glGenOcclusionQueriesNV(1, &query.query_id);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_NVOcclusionQuery_nglGenOcclusionQueriesNV(JNIEnv *env, jclass clazz, jint n, jobject piIDs, jint piIDs_position, jlong function_pointer) {
	GLuint *piIDs_address = ((GLuint *)(*env)->GetDirectBufferAddress(env, piIDs)) + piIDs_position;
	glGenOcclusionQueriesNVPROC glGenOcclusionQueriesNV = (glGenOcclusionQueriesNVPROC)((intptr_t)function_pointer);
	glGenOcclusionQueriesNV(n, piIDs_address);
}