Exemplo n.º 1
0
void QgsGrassWin::hideWindow( int pid )
{
  Q_UNUSED( pid )
  QgsDebugMsg( QString( "pid = %1" ).arg( pid ) );
#ifdef Q_OS_WIN
  HWND hWnd = FindWindowFromProcessId(( DWORD )pid );
  if ( hWnd )
  {
    QgsDebugMsg( "driver window found -> minimize" );
  }
  else
  {
    QgsDebugMsg( "cannot find driver window" );
  }
  // Unfortunately the window opens first for a moment
  ShowWindow( hWnd, SW_HIDE );
#endif
}
Exemplo n.º 2
0
// The last Step before actually swapping the buffers
static void EndFrames(void)
{
	// Copy the right eye
	if (g_windowResizeCheck == false)
	{
		std::string injectionPoint = g_reader->GetInjectionPoint();
		if (injectionPoint != "glSwapBuffers" && injectionPoint != "SCREEN_BUFFER")
		{
			if (fboDrawingEnabled)
				NV3DVisionBuffers_copy_right(gl_d3d_buffers);
			else
				NV3DVisionBuffers_flip_right(gl_d3d_buffers);
		}
		else if (injectionPoint == "SCREEN_BUFFER")
		{
			NV3DVisionBuffers_copy_right(gl_d3d_buffers);
		}
	}

	// Deactivate 
	NV3DVisionBuffers_deactivate_right(gl_d3d_buffers);
	NV3DVisionBuffers_deactivate(gl_d3d_buffers);

	// We rendered everything so first we need to flush.
	NV3DVisionBuffers_flush(gl_d3d_buffers);

	//check for resize
	if (g_windowResizeCheck == true)
	{
		// Create the new buffers
		g_MainWindowHandle = FindWindowFromProcessId();
		// create DirectX 3D Vision buffers
		NV3DVisionReInitBuffers();
		NV3DVisionBuffers_destroy(gl_d3d_buffers);

		//Resize complete
		g_windowResizeCheck = false;

		NV3DVisionBuffers_create(gl_d3d_buffers, g_MainWindowHandle, true);
	}
}
Exemplo n.º 3
0
//Initializes and renders
static void AutomaticGlSwapBuffers(void)
{
	//initializes
	if (NV3DVisionIsNotInit())
	{
		// Print just once:)
		add_log("Automatic Hooking Enabled !!!");

		// Load our extensions
		if (!m_areExtensionsLoade)
		{
			if (ogl_LoadFunctions() == ogl_LOAD_FAILED)
			{
				add_log("Failed to get OpenGL extensions (ogl_LOAD_FAILED)");
			}
			else
			{
				add_log("OpenGL extensions Retrieved !!!");
			}
			m_areExtensionsLoade = true;
		}

		//Create our buffers
		gl_d3d_buffers = new GLD3DBuffers;

		g_MainWindowHandle = FindWindowFromProcessId();
		NV3DVisionBuffers_create(gl_d3d_buffers, g_MainWindowHandle, true);

		// Start our Threads
		StartResizeThread();
		StartNVAPIThread();

		//start the rendering
		NV3DVisionSetCurrentFrame(1);

		// FPS Inject
		if (isFPSInjectHandleValid())
		{
			m_FPSInjector->synchronizeRendering();
		}
	}
	// If we are initialised
	if (!NV3DVisionIsNotInit())
	{
		if (NV3DVisionGetCurrentFrame() == 2)
		{
			EndFrames();
			NV3DVisionBuffers_activate_depth(gl_d3d_buffers);
			NV3DVisionBuffers_activate_left(gl_d3d_buffers);
			NV3DVisionSetCurrentFrame(1);

			// Sync Left eye
			if (isFPSInjectHandleValid())
			{
				m_FPSInjector->syncLeft();
			}
		}
		else if (NV3DVisionGetCurrentFrame() == 1)
		{
			// Sync Right eye
			if (isFPSInjectHandleValid())
			{
				m_FPSInjector->syncRight();
			}

			if (g_windowResizeCheck == false)
			{
				std::string injectionPoint = g_reader->GetInjectionPoint();
				if (injectionPoint != "glSwapBuffers" && injectionPoint != "SCREEN_BUFFER")
				{
					if (fboDrawingEnabled)
						NV3DVisionBuffers_copy_left(gl_d3d_buffers);
					else
						NV3DVisionBuffers_flip_left(gl_d3d_buffers);
					
				}
				else if (injectionPoint == "SCREEN_BUFFER")
				{
					NV3DVisionBuffers_copy_left(gl_d3d_buffers);
				}
			}
			NV3DVisionBuffers_deactivate_left(gl_d3d_buffers);
			NV3DVisionBuffers_activate_right(gl_d3d_buffers);

			NV3DVisionSetCurrentFrame(2);
		}
	}
}