⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boidsthread.cpp

📁 3D的Boids效果演示源程序
💻 CPP
字号:
/*	Filename:		BoidsThread.cpp
	Author:			Robert Platt
	Creation date:	14/09/1999
	Modified:		13/05/2000
	Version:		0.54
	Description:	Global function to perform the concurrency support.
*/


#include "BoidsWin.h"


// The display thread's main function.
UINT d3dThread( LPVOID pParam )
{
	// Create a pointer to the main window.
	BoidsWin *mainWin = static_cast< BoidsWin * >( pParam );

	// The thread's main rendering loop.
	// This while loop is only active while -
	// - the simulation running flag is set.
	while( mainWin -> threadEnabled )
	{
		// Continue the D3DRM rendering.
		mainWin -> d3drm -> Tick( D3DVALUE( 1.0 ) );
		mainWin -> frameCount++;  // Increment the frame count.


		// Update the static timer control.
		mainWin -> updateTimer( );


		// Call the function to maintain and update the main window.
		if ( mainWin -> appIdle == false )
		{
			// Perform some maintenance tasks every second.
			if ( (double)( clock( ) - mainWin -> frameStartTime ) / 
										(double)CLOCKS_PER_SEC >= 1.0 )
			{
				mainWin -> performEverySecond( );
			}
		}
	}


	// Set the flag to state that the thread has finished.
	mainWin -> threadFinished = true;


	return 0;  // End the thread's execution.
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -