当前位置: 首页>>代码示例>>C++>>正文


C++ ResetState函数代码示例

本文整理汇总了C++中ResetState函数的典型用法代码示例。如果您正苦于以下问题:C++ ResetState函数的具体用法?C++ ResetState怎么用?C++ ResetState使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ResetState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetState

void VikeWin::GeneralHandler(int keyCode, bool skip)
{
    int state = GetState();

    if(state == VIKE_INVALID){
        ResetState();
        return;
    }

    /* Clear status on VIKE_END */
    if(state == VIKE_END){
        ClearKeyStatus();
        ResetState();
    }

    /* Not skip, update key status and status bar */
    if(!skip){
        if(state == VIKE_SEARCH || state == VIKE_COMMAND){
            ClearKeyStatus();
        }else if(state != VIKE_END){
            AppendKeyStatus(keyCode);
        }
        UpdateStatusBar();
    }
}
开发者ID:KurumiSerori,项目名称:cbvike,代码行数:25,代码来源:cbvike.cpp

示例2: ApplyBuoyancy

void ApplyBuoyancy(Surface velocity, Surface temperature, Surface density, Surface dest)
{
    GLuint p = Programs.ApplyBuoyancy;
    glUseProgram(p);

    GLint tempSampler = glGetUniformLocation(p, "Temperature");
    GLint inkSampler = glGetUniformLocation(p, "Density");
    GLint ambTemp = glGetUniformLocation(p, "AmbientTemperature");
    GLint timeStep = glGetUniformLocation(p, "TimeStep");
    GLint sigma = glGetUniformLocation(p, "Sigma");
    GLint kappa = glGetUniformLocation(p, "Kappa");

    glUniform1i(tempSampler, 1);
    glUniform1i(inkSampler, 2);
    glUniform1f(ambTemp, AmbientTemperature);
    glUniform1f(timeStep, TimeStep);
    glUniform1f(sigma, SmokeBuoyancy);
    glUniform1f(kappa, SmokeWeight);

    glBindFramebuffer(GL_FRAMEBUFFER, dest.FboHandle);
    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE_2D, velocity.TextureHandle);
    glActiveTexture(GL_TEXTURE1);
    glBindTexture(GL_TEXTURE_2D, temperature.TextureHandle);
    glActiveTexture(GL_TEXTURE2);
    glBindTexture(GL_TEXTURE_2D, density.TextureHandle);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
    ResetState();
}
开发者ID:raghava-sudana,项目名称:FluidSimulation,代码行数:29,代码来源:Operations.cpp

示例3: SubtractGradient

void SubtractGradient(Surface velocity, Surface pressure, Surface obstacles, Surface dest)
{
    GLuint p = Programs.SubtractGradient;
    glUseProgram(p);

    GLint inverseSize = glGetUniformLocation(p, "InverseSize");
    glUniform2f(inverseSize, 1.0f / GridWidth, 1.0f / GridHeight);
    GLint gradientScale = glGetUniformLocation(p, "GradientScale");
    glUniform1f(gradientScale, GradientScale);
    GLint halfCell = glGetUniformLocation(p, "HalfInverseCellSize");
    glUniform1f(halfCell, 0.5f / CellSize);
    GLint sampler = glGetUniformLocation(p, "Pressure");
    glUniform1i(sampler, 1);
    sampler = glGetUniformLocation(p, "Obstacles");
    glUniform1i(sampler, 2);

    glBindFramebuffer(GL_FRAMEBUFFER, dest.FboHandle);
    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE_2D, velocity.TextureHandle);
    glActiveTexture(GL_TEXTURE1);
    glBindTexture(GL_TEXTURE_2D, pressure.TextureHandle);
    glActiveTexture(GL_TEXTURE2);
    glBindTexture(GL_TEXTURE_2D, obstacles.TextureHandle);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
    ResetState();
}
开发者ID:yariza,项目名称:borg,代码行数:26,代码来源:SlabOps.cpp

示例4: Advect

void Advect(Surface velocity, Surface source, Surface boundaries, Surface dest, float dissipation)
{
	
	GLuint p = Programs.Advect;
    glUseProgram(p);

	GLint inverseSize = glGetUniformLocation(p, "InverseSize");
    GLint timeStep = glGetUniformLocation(p, "TimeStep");
    GLint dissLoc = glGetUniformLocation(p, "Dissipation");
    GLint sourceTexture = glGetUniformLocation(p, "SourceTexture");
    GLint boundariesTexture = glGetUniformLocation(p, "Boundaries");

	glUniform2f(inverseSize, 1.0f / g_iWidth, 1.0f / g_iHeight);
    glUniform1f(timeStep, TimeStep);
    glUniform1f(dissLoc, dissipation);
    glUniform1i(sourceTexture, 1);
    glUniform1i(boundariesTexture, 2);

	glBindFramebuffer(GL_FRAMEBUFFER, dest.FboHandle);
    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE_2D, velocity.TextureHandle);
    glActiveTexture(GL_TEXTURE1);
    glBindTexture(GL_TEXTURE_2D, source.TextureHandle);
    glActiveTexture(GL_TEXTURE2);
    glBindTexture(GL_TEXTURE_2D, boundaries.TextureHandle);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
    ResetState();
}
开发者ID:raghava-sudana,项目名称:FluidSimulation,代码行数:28,代码来源:Operations.cpp

示例5: SendMessage

void DXAPI::ChangeWindowed(){
	HRESULT hr;
	Logger::Debug("[GraphicAPI] Change Window Type ");
	Logger::Debugln(gamemode?"Fullsc -> Window":"Window->Fullsc");
	if (gamemode){
		hr = lpd3ddev->Reset(&d3dpw);
	}else{
		hr = lpd3ddev->Reset(&d3dpf);
	}

	if (FAILED(hr)){
		Logger::Println("[GraphicAPI]	Device Reset Fail");
		SendMessage(hWnd,WM_DESTROY,0,0L);
		return;
	}

	if (gamemode){
		//make window
		SetWindowLong(hWnd,GWL_STYLE,WS_OVERLAPPEDWINDOW&(~WS_MAXIMIZEBOX)&(~WS_MINIMIZEBOX)&(~WS_THICKFRAME));
		SetWindowPos(hWnd, NULL,winx,winy,width + GetSystemMetrics(SM_CXDLGFRAME) * 2, height + GetSystemMetrics(SM_CYDLGFRAME) * 2 +GetSystemMetrics(SM_CYCAPTION),SWP_SHOWWINDOW);
	}else{
		//make fullsc
		SetWindowLong(hWnd,GWL_STYLE,WS_POPUP|WS_VISIBLE);
		SetWindowPos(hWnd, NULL,0,0,width,height,SWP_SHOWWINDOW);
	}
	gamemode=!gamemode;

	ResetState();

	return;
}
开发者ID:kodack64,项目名称:koma2011,代码行数:31,代码来源:DXAPI.cpp

示例6: Jacobi

void Jacobi(Surface pressure, Surface divergence, Surface boundaries, Surface dest)
{
    GLuint p = Programs.Jacobi;
    glUseProgram(p);

    GLint alpha = glGetUniformLocation(p, "Alpha");
    GLint inverseBeta = glGetUniformLocation(p, "InverseBeta");
    GLint dSampler = glGetUniformLocation(p, "Divergence");
    GLint bSampler = glGetUniformLocation(p, "Boundaries");

    glUniform1f(alpha, -CellSize * CellSize);
    glUniform1f(inverseBeta, 0.25f);
    glUniform1i(dSampler, 1);
    glUniform1i(bSampler, 2);

    glBindFramebuffer(GL_FRAMEBUFFER, dest.FboHandle);
    glActiveTexture(GL_TEXTURE0);
    glBindTexture(GL_TEXTURE_2D, pressure.TextureHandle);
    glActiveTexture(GL_TEXTURE1);
    glBindTexture(GL_TEXTURE_2D, divergence.TextureHandle);
    glActiveTexture(GL_TEXTURE2);
    glBindTexture(GL_TEXTURE_2D, boundaries.TextureHandle);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
    ResetState();
}
开发者ID:raghava-sudana,项目名称:FluidSimulation,代码行数:25,代码来源:Operations.cpp

示例7: ResetState

void CDialogActorContext::BeginSession()
{
	DiaLOG::Log(DiaLOG::eAlways, "[DIALOG] CDialogActorContext::BeginSession: %s Now=%f 0x%p actorID=%d ",
		m_pSession->GetDebugName(), m_pSession->GetCurTime(), this, m_actorID);	

	ResetState();

	IEntitySystem* pES = gEnv->pEntitySystem;
	pES->AddEntityEventListener( m_entityID, ENTITY_EVENT_AI_DONE, this );
	pES->AddEntityEventListener( m_entityID, ENTITY_EVENT_DONE, this );
	pES->AddEntityEventListener( m_entityID, ENTITY_EVENT_RESET, this );

	switch (GetAIBehaviourMode())
	{
	case CDialogSession::eDIB_InterruptAlways:
		ExecuteAI( m_goalPipeID, "ACT_ANIM" );
		break;
	case CDialogSession::eDIB_InterruptMedium:
		ExecuteAI( m_goalPipeID, "ACT_DIALOG" );
		break;
	case CDialogSession::eDIB_InterruptNever:
		break;
	}
	m_bNeedsCancel = true;
}
开发者ID:aronarts,项目名称:FireNET,代码行数:25,代码来源:DialogActorContext.cpp

示例8: up

void Controls::DoRotation(std::vector<GameObject*> &levelAssets, Vector2 mousePos, float dt)
{
	m_GUI->DisablePanel(true);
	if (mR_state)
	{
		if (dynamic_cast<Cannon*>(SelectedGO))
		{
			Vector2 toolToMouse = mousePos - SelectedGO->getPos();
			Vector2 up(0, 1);

			float angleBetween = (toolToMouse).AngleBetween(up);

			dynamic_cast<Cannon*>(SelectedGO)->getAngleByReference() = (-angleBetween);
			oldPos = mousePos;

			if ((fabs)((fabs)(anglePrev) - (fabs)(angleBetween)) >= 0.05f)
			{

				float cannonPower = ((Cannon*)(SelectedGO))->GetPower();
				Vector2 cannonForce = Vector2(0, 1) * cannonPower;
				cannonForce.rotateVector(-angleBetween);
				trajectoryFeedback = ((Balls*)(ball))->GetPath(levelAssets, SelectedGO->getPos(), cannonForce, dt, 0.2, 1.4f);
			}
			anglePrev = angleBetween;
		}
	}
	else
		ResetState();
}
开发者ID:DreamNex,项目名称:SP4_Moyase,代码行数:29,代码来源:Controls.cpp

示例9: ODSItemState

     ODSItemState :: ODSItemState ( )
{
  ResetState();
is_total++;
if ( is_max < ++is_count ) is_max = is_count;

}
开发者ID:BackupTheBerlios,项目名称:openaqua-svn,代码行数:7,代码来源:ODSItemState.cpp

示例10: assert

CGlobalUnsynced::CGlobalUnsynced()
{
	rng.Seed(time(NULL) % ((spring_gettime().toNanoSecsi() + 1) * 9007));

	assert(playerHandler == NULL);
	ResetState();
}
开发者ID:DoctorEmmettBrown,项目名称:spring,代码行数:7,代码来源:GlobalUnsynced.cpp

示例11: TIMER

void CNetTurnManager::QuickLoad()
{
	TIMER(L"QuickLoad");

	if (m_QuickSaveState.empty())
	{
		LOGERROR("Cannot quickload game - no game was quicksaved");
		return;
	}

	std::stringstream stream(m_QuickSaveState);
	if (!m_Simulation2.DeserializeState(stream))
	{
		LOGERROR("Failed to quickload game");
		return;
	}

	if (g_GUI && !m_QuickSaveMetadata.empty())
		g_GUI->RestoreSavedGameData(m_QuickSaveMetadata);

	LOGMESSAGERENDER("Quickloaded game");

	// See RewindTimeWarp
	ResetState(0, 1);
}
开发者ID:Epidilius,项目名称:0ad,代码行数:25,代码来源:NetTurnManager.cpp

示例12: EnterState_SendI

 void EnterState_SendI(bool dropMode = false)
 {
     m_random.setSeed( CUseTrueRandom ? time(0) : 35654);
     m_state = SEND_I;
     GenerateParam(dropMode);
     ResetState();                      
 }
开发者ID:ixc-software,项目名称:lucksi,代码行数:7,代码来源:DataExchangeTestState.cpp

示例13: Advect

void Advect(Shader& advect, Surface velocity, Surface source, Surface obstacles, Surface dest, float dissipation)
{
	GLuint p = advect.Program;
	glUseProgram(p);
	float TimeStep = 0.1f;

	GLint inverseSize = glGetUniformLocation(p, "InverseSize");
	GLint timeStep = glGetUniformLocation(p, "TimeStep");
	GLint dissLoc = glGetUniformLocation(p, "Dissipation");
	GLint sourceTexture = glGetUniformLocation(p, "SourceTexture");
	GLint obstaclesTexture = glGetUniformLocation(p, "Obstacles");

	glUniform2f(inverseSize, 1.0f / GridWidth * 0.5, 1.0f / GridHeight * 0.5);
	glUniform1f(timeStep, TimeStep);
	glUniform1f(dissLoc, dissipation);
	glUniform1i(sourceTexture, 1);
	glUniform1i(obstaclesTexture, 2);

	glBindFramebuffer(GL_FRAMEBUFFER, dest.FboHandle);
	glActiveTexture(GL_TEXTURE0);
	glBindTexture(GL_TEXTURE_2D, velocity.TextureHandle);
	glActiveTexture(GL_TEXTURE1);
	glBindTexture(GL_TEXTURE_2D, source.TextureHandle);
	glActiveTexture(GL_TEXTURE2);
	glBindTexture(GL_TEXTURE_2D, obstacles.TextureHandle);
	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

	ResetState();
}
开发者ID:lalagi2,项目名称:PostProcessing,代码行数:29,代码来源:FluidSimulation.cpp

示例14: strcpy

FSMReader::FSMReader()
{
	strcpy(Type, CFSMP_ParserTags[FSM_MSG_FSM]);	//Type of parser
	ResetState();
	cStateList = NULL;
	FSMReset();
}
开发者ID:chverma,项目名称:IPV_SpaceInvaders,代码行数:7,代码来源:FSMParser.cpp

示例15: ResetState

//GAME INITIALIZATION
void FSMReader::Init(char *FileName)
{
	LogFile.open(FileName);

	if (LogFile)	//NAME the file
		 ResetState();
	else exit(0);
};
开发者ID:chverma,项目名称:IPV_SpaceInvaders,代码行数:9,代码来源:FSMParser.cpp


注:本文中的ResetState函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。