本文整理汇总了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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}
示例9: ODSItemState
ODSItemState :: ODSItemState ( )
{
ResetState();
is_total++;
if ( is_max < ++is_count ) is_max = is_count;
}
示例10: assert
CGlobalUnsynced::CGlobalUnsynced()
{
rng.Seed(time(NULL) % ((spring_gettime().toNanoSecsi() + 1) * 9007));
assert(playerHandler == NULL);
ResetState();
}
示例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);
}
示例12: EnterState_SendI
void EnterState_SendI(bool dropMode = false)
{
m_random.setSeed( CUseTrueRandom ? time(0) : 35654);
m_state = SEND_I;
GenerateParam(dropMode);
ResetState();
}
示例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();
}
示例14: strcpy
FSMReader::FSMReader()
{
strcpy(Type, CFSMP_ParserTags[FSM_MSG_FSM]); //Type of parser
ResetState();
cStateList = NULL;
FSMReset();
}
示例15: ResetState
//GAME INITIALIZATION
void FSMReader::Init(char *FileName)
{
LogFile.open(FileName);
if (LogFile) //NAME the file
ResetState();
else exit(0);
};