• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetEngine函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: switch

/**
Draw the player object.
Could be a simple shape but this makes a fake ball shape and labels it.
*/
void BouncingBall::Draw()
{
	// Do not draw if it should not be visible
	if ( !IsVisible() )
		return;

	unsigned int uiColourMult = 0x010001;
	unsigned int uiColourText = 0xffffff;

	// Choose one of 8 colours:
	switch( m_iColour % 8 )
	{ 
	case 1: uiColourMult = 0x010000; uiColourText = 0xffffff; break;
	case 2: uiColourMult = 0x000100; uiColourText = 0xffffff; break;
	case 3: uiColourMult = 0x000001; uiColourText = 0xffffff; break;
	case 4: uiColourMult = 0x010001; uiColourText = 0; break;
	case 5: uiColourMult = 0x010100; uiColourText = 0; break;
	case 6: uiColourMult = 0x000101; uiColourText = 0; break;
	case 7: uiColourMult = 0x010101; uiColourText = 0; break;
	default: uiColourMult = 0x000000; break;
	}

	// Concentric circles for pseudo-sphere
	int iRadiusSquared = (m_iDrawWidth/2) * (m_iDrawWidth/2);
	int iCentreX = m_iCurrentScreenX + m_iStartDrawPosX + m_iDrawWidth/2;
	int iCentreY = m_iCurrentScreenY + m_iStartDrawPosY + m_iDrawHeight/2;
	for ( int iX = m_iCurrentScreenX + m_iStartDrawPosX ; iX < (m_iCurrentScreenX + m_iStartDrawPosX + m_iDrawWidth) ; iX++ )
		for ( int iY = m_iCurrentScreenY + m_iStartDrawPosY ; iY < (m_iCurrentScreenY + m_iStartDrawPosY + m_iDrawHeight) ; iY++ )
			if ( ( (iX-iCentreX)*(iX-iCentreX) + (iY-iCentreY)*(iY-iCentreY) ) <= iRadiusSquared )
			{
				// 0xB0 is the range of values, 0xff is the brightest value.
				unsigned int uiColour = (0xB0 * ((iX-iCentreX)*(iX-iCentreX) + (iY-iCentreY)*(iY-iCentreY))) / iRadiusSquared;
				uiColour = 0xff - uiColour;
				GetEngine()->SafeSetScreenPixel( iX, iY, uiColourMult * uiColour );
			}

	// If there is a label then draw the text
	if ( (m_szLabel!=NULL) && (strlen(m_szLabel)>0) )
	{
		//GetEngine()->DrawString( iCentreX+m_iXLabelOffset+1, iCentreY+m_iYLabelOffset+1, m_szLabel, 0xffffff );
		GetEngine()->DrawScreenString( iCentreX+m_iXLabelOffset, iCentreY+m_iYLabelOffset, m_szLabel, uiColourText );
	}

	// Store the position at which the object was last drawn
	// You MUST do this to ensure that the screen is updated when only drawing movable objects
	// This tells the system where to 'undraw' the object from
	StoreLastScreenPositionAndUpdateRect();
}
开发者ID:jimlaimun,项目名称:C---stuff,代码行数:52,代码来源:BouncingBall.cpp


示例2: GetEngine

void EngineRunningBase::DrawLensflare()
{
  // Lensflare: draw if the sparkling sun is on screen.
  if (!m_pLevel->IsCurrentRoomIndoors() && 
      GetEngine()->GetDayNightSky()->IsSparkleVisible())
  {
    // Make a bounding sphere around the sun coords.
    Vec3f sunPos = GetEngine()->GetDayNightSky()->GetSunPosition();
    BoundingSphere sunBs(sunPos, 50.0f); // sun's "radius"
    // Find out if the sun intersects the view frustum
    if (Frustum::Instance()->Contains(sunBs))
    {
      PCamera pCam = GetCamera();
      Assert(pCam.GetPtr());
      Vec3f eyePos(pCam->GetOrientation()->GetX(), 
                        pCam->GetOrientation()->GetY(), 
                        pCam->GetOrientation()->GetZ());

      // We have to draw the lens flare, unless the sun is obscured by part of 
      // the scene.
      // Test the line from camera to sun for obstructions.
      //Mgc::Segment3 seg;
      //seg.Origin() = Mgc::Vector3(eyePos.x, eyePos.y, eyePos.z);
      //seg.Direction() = Mgc::Vector3(
      //  sunPos.x - eyePos.x, 
      //  sunPos.y - eyePos.y, 
      //  sunPos.z - eyePos.z);

      // Do intersection test on the scenery for the current room.
      if (m_pLevel->GetScene()->LineIntersects(eyePos, sunPos, 1.0f /* some radius */ ))
      {
        return; // Sun is obscured.
      }

      // We should draw the lens flare. Get the Camera eye position and 
      // "look at" position (some point along the line we are pointing at).

      GetEngine()->PushColour(1.0f, 1.0f, 1.0f, 1.0f);

      //GetEngine()->GetLensflare()->Draw(
      //  GetEngine()->GetDayNightSky()->GetSunPosition(),
      //  eyePos,
      //  pCam->GetLookAtPos() );

      GetEngine()->PopColour();
    }
  }
}
开发者ID:jason-amju,项目名称:amju-scp,代码行数:48,代码来源:EngineRunningBase.cpp


示例3: DoUpdate

	// Called frequently, this should move the item
	// In this case we also accept cursor key presses to change the speed
	// Space will set the speed to zero
	void DoUpdate( int iCurrentTime )
	{
		// Change speed if player presses a key
		if ( GetEngine()->IsKeyPressed( SDLK_UP ) )
			m_dSY -= 0.001;
		if ( GetEngine()->IsKeyPressed( SDLK_DOWN ) )
			m_dSY += 0.001;
		if ( GetEngine()->IsKeyPressed( SDLK_LEFT ) )
			m_dSX -= 0.001;
		if ( GetEngine()->IsKeyPressed( SDLK_RIGHT ) )
			m_dSX += 0.001;
		if ( GetEngine()->IsKeyPressed( SDLK_SPACE ) )
			m_dSX = m_dSY = 0;

		// Alter position for speed
		m_dX += m_dSX;
		m_dY += m_dSY;

		// Check for bounce off the edge
		if ( (m_dX+m_iStartDrawPosX) < 0 )
		{
			m_dX = - m_iStartDrawPosX;
			if ( m_dSX < 0 )
				m_dSX = -m_dSX;
		}
		if ( (m_dX+m_iStartDrawPosX+m_iDrawWidth) > (GetEngine()->GetScreenWidth()-1) )
		{
			m_dX = GetEngine()->GetScreenWidth() -1 - m_iStartDrawPosX - m_iDrawWidth;
			if ( m_dSX > 0 )
				m_dSX = -m_dSX;
		}
		if ( (m_dY+m_iStartDrawPosY) < 0 )
		{
			m_dY = -m_iStartDrawPosY;
			if ( m_dSY < 0 )
				m_dSY = -m_dSY;
		}
		if ( (m_dY+m_iStartDrawPosY+m_iDrawHeight) > (GetEngine()->GetScreenHeight()-1) )
		{
			m_dY = GetEngine()->GetScreenHeight() -1 - m_iStartDrawPosY - m_iDrawHeight;
			if ( m_dSY > 0 )
				m_dSY = -m_dSY;
		}

		// Set current position - you NEED to set the current positions
		m_iCurrentScreenX = (int)(m_dX+0.5);
		m_iCurrentScreenY = (int)(m_dY+0.5);

		printf("Position %f, %f\n", m_dX, m_dY );

		// Ensure that the object gets redrawn on the display, if something changed
		RedrawObjects();
	}
开发者ID:NataliaSharon,项目名称:Coursework,代码行数:56,代码来源:MyProjectMain.cpp


示例4: Enter

void CMessageBoxScene::Enter()
{
	mpJoy=GetEngine()->FindComponent<CJoystickComponent>();
	mPopup=true;
	mTransOnTime=mTransOffTime=0.2f;
	mpTexture=LoadSpriteTex(GetDevice(),mBgName.c_str());
}
开发者ID:MarcusKhoo,项目名称:SavingClara,代码行数:7,代码来源:MessageBoxScene.cpp


示例5: start

	int Ardb::FlushScripts()
	{
		KeyObject start(Slice(), SCRIPT, ARDB_GLOBAL_DB);
		Iterator* iter = FindValue(start, false);
		BatchWriteGuard guard(GetEngine());
		while (NULL != iter && iter->Valid())
		{
			Slice tmpkey = iter->Key();
			KeyObject* kk = decode_key(tmpkey, NULL);
			if (NULL != kk)
			{
				if (kk->type == SCRIPT)
				{
					DelValue(*kk);
				} else
				{
					break;
				}
			}
			DELETE(kk);
			iter->Next();
		}
		DELETE(iter);
		return 0;
	}
开发者ID:kouhate,项目名称:ardb,代码行数:25,代码来源:ardb.cpp


示例6: GetEngine

void LocationDlg::OnReset( wxCommandEvent &event )
{
	vtAnimPathEngine *engine = GetEngine(m_iAnim);
	engine->Reset();
	if (m_bActive)
		engine->UpdateTargets();
}
开发者ID:kamalsirsa,项目名称:vtp,代码行数:7,代码来源:LocationDlg.cpp


示例7: GetAnim

void LocationDlg::RefreshAnimsText()
{
	wxTreeItemIdValue cookie;
	wxTreeItemId id;

	uint i, num = m_pAnimPaths->size();
	for (i = 0; i < num; i++)
	{
		vtAnimEntry &entry = m_pAnimPaths->at(i);
		vtAnimPath *anim = GetAnim(i);
		vtAnimPathEngine *eng = GetEngine(i);

		if (id.IsOk())
			id = GetAnimTree()->GetNextChild(m_root, cookie);
		else
			id = GetAnimTree()->GetFirstChild(m_root, cookie);

		wxString str(entry.m_Name, wxConvUTF8);
		wxString str2;
		str2.Printf(_T(" (%.1f/%.1f, %d)"), eng->GetTime(),
			(float) anim->GetLastTime(), anim->NumPoints());
		str += str2;
		GetAnimTree()->SetItemText(id, str);
	}
}
开发者ID:kamalsirsa,项目名称:vtp,代码行数:25,代码来源:LocationDlg.cpp


示例8: InitializeIIDs

CLREnvelopeEditorCtrl::CLREnvelopeEditorCtrl()
{
	InitializeIIDs(&IID_DLREnvelopeEditor, &IID_DLREnvelopeEditorEvents);
	//control data
	m_lFirstKeyPosition=0;
	m_lLastKeyPosition=60;
	m_lMouseMode=0;
	m_fLowValue=0.0f;
	m_fHighValue=1.0f;
	m_lEnvelopeType=LR::SHAPE_TCB;
	m_bDirtyValues=m_bDirtyPositions=FALSE;
	m_lDragMode=0;
	m_bHasSelection=FALSE;
	m_lFirstSelectedPosition=0;
	m_lLastSelectedPosition=0;
	//does not really matter since OnDraw will update it before any mouse
	//events get to the control but ...
	m_RCCtrlArea.left=0;
	m_RCCtrlArea.right=1;
	m_RCCtrlArea.top=0;
	m_RCCtrlArea.bottom=1;
	m_bMouseOverKeyRange=FALSE;
	m_lKeyUnderMouse=-1;
	m_lDraggedKey=-1;
	m_lSelectedKey=-1;
	m_bIsDragging=FALSE;
	m_CurveColor=RGB(255,0,0);
	LR::Engine	*pEngine=NULL;
	GetEngine(&pEngine);
	pEngine->createEnvelope(m_pEnvelope);
	pEngine->Release();
}
开发者ID:devinthedev,项目名称:LiquidReality,代码行数:32,代码来源:LREnvelopeEditorCtl.cpp


示例9: GetEngine

void ScriptController::onKeyRelease( const KeyEvent& event )
{
	if( !enabled || !state )
		return;

	Engine* engine = GetEngine();
}
开发者ID:FloodProject,项目名称:flood,代码行数:7,代码来源:ScriptController.cpp


示例10: if

LONG CSkinItemEdit::GetBorderHelper(LONG clrNormal, LONG clrHover, LONG clrFocus, LONG clrReadOnly, LONG clrDisabled)
{
    LONG color = 0;

    if (IsReadOnly() && m_bReadOnlyBorder) {
        color = clrReadOnly;
    } else if (IsFocused() && m_bFocusBorder) {
        color = clrFocus;
    } else if (IsHot()) {
        color = clrHover;
    } else {
        color = clrNormal;
    }

    if (GetDisabled())
        color = clrDisabled;

    if (color == -1)
        color = clrNormal;

    if (color == -1)
        return -1;

    if (GetColorTransform()) {
        GetEngine()->TransformColor(color, color);
    }

    return color;
}
开发者ID:mengskysama,项目名称:V8,代码行数:29,代码来源:SkinItemEdit.cpp


示例11: Assert

void EngineRunningBase::DrawGameObjectShadows()
{
  Assert(m_pLevel.GetPtr());

  // Iterate over the game objects which are in the current level/room.
  int levelId = m_pLevel->GetId();
  int roomId = m_pLevel->GetRoomId();

  // Get the game objects which are in the same room as the player.
  GameObjectMap& objs = GetEngine()->GetGameObjects(levelId, roomId);

  // Iterate through map of Game Objects. Check each one in the Game State
  // to see if it has been collected/killed/whatever.
  for (GameObjectMap::iterator it = objs.begin(); it != objs.end(); ++it)
  {
    PPoolGameObject pGo = it->second;
    if (pGo->IsVisible())
    {
      VisibleGameObject* pVgo = dynamic_cast<VisibleGameObject*>(pGo.GetPtr());

      // Check state of object.
      State s = pVgo->GetState();
      //Engine::Instance()->GetEngineState()->GetState(gameObjId, &s);
      // POOL: some pool-specific states here
      if (s != OUT_OF_PLAY &&
          s != BALL_IN_POCKET &&
          s != BALL_OUT_OF_BOUNDS)
      {
        pVgo->DrawShadow();
      }
    }
  }
}
开发者ID:jason-amju,项目名称:amju-scp,代码行数:33,代码来源:EngineRunningBase.cpp


示例12: CreateD3DFont

void CreditScene::Enter()
{
	std::cout << "HelpScene::enter\n";
	mTransOnTime = 2;	// slow fade in
	mTransOffTime = 0;	// slow fade out
	// load the media
	mpFont = CreateD3DFont(GetDevice(), "Arial", 24, true);
	mpButtonTex[0] = LoadSpriteTex(GetDevice(), "../media/scene/Back1.png");
	mpButtonTex[1] = LoadSpriteTex(GetDevice(), "../media/scene/Back2.png");
	mpBG = LoadSpriteTex(GetDevice(), "../media/scene/Credits.png");
	mpButtonB = LoadSpriteTex(GetDevice(), "../media/scene/ButtonB.png");

	mpCreditSFX = GetEngine()->FindComponent<CSoundComponent>();

	mpGamepad = GetEngine()->FindComponent<CGamepadComponent>();
}
开发者ID:crystalised,项目名称:GDEV,代码行数:16,代码来源:CreditScene.cpp


示例13: PowerupProperties

Super::Super(BaseEngine* pEngine ) 
	: PowerupProperties( pEngine ) 
{
	// Current and previous coordinates for the object - set them the same 
	//initially
	m_iCurrentScreenX = m_iPreviousScreenX = (rand() % GetEngine()->GetScreenWidth()); 
	m_iCurrentScreenY = m_iPreviousScreenY = (rand() % GetEngine()->GetScreenHeight()); 
	// The object coordinate will be the top left of the object 
	m_iStartDrawPosX = 0; 
	m_iStartDrawPosY = 0;

	setPowerupType(SUPER);

	// And make it visible 
	SetVisible(true); 
}
开发者ID:tun57,项目名称:StephenSowoleG52CPP,代码行数:16,代码来源:Super.cpp


示例14: WinMain

DGLE_DYNAMIC_FUNC

#define APP_CAPTION "Asteroids Game"

#ifdef _DEBUG
#	define DLL_PATH "..\\..\\..\\..\\bin\\windows\\DGLE.dll"
#else
#	define DLL_PATH "..\\..\\DGLE.dll"
#endif

#define SCREEN_WIDTH	1024u
#define SCREEN_HEIGHT	768u

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	IEngineCore *pEngineCore = NULL;
	
	if (GetEngine(DLL_PATH, pEngineCore))
	{
		CGame game(pEngineCore);
		
		if (SUCCEEDED(pEngineCore->InitializeEngine(NULL, APP_CAPTION, TEngineWindow(SCREEN_WIDTH, SCREEN_HEIGHT, false, false, MM_4X))))
			pEngineCore->StartEngine();

		FreeEngine();
	}
	else
		MessageBox(NULL,"Couldn't load \""DLL_PATH"\"!", APP_CAPTION, MB_OK | MB_ICONERROR | MB_SETFOREGROUND);

	return 0;
}
开发者ID:Zariostr,项目名称:DGLE,代码行数:31,代码来源:main.cpp


示例15: SetSearchDirection

 void SetSearchDirection(V3 direction) {
   searchDirection = direction;
   if (Equals(searchDirection, V3(0.0f))) {
     LogError("GJK Set searchDirection to [0, 0, 0]");
     GetEngine()->isPaused = true;
   }
 }
开发者ID:Twiebs,项目名称:venom,代码行数:7,代码来源:collision.cpp


示例16: SetSimplex

 void SetSimplex(V3 p0, V3 p1) {
   simplex[0] = p0;
   simplex[1] = p1;
   simplexCount = 2;
   auto& vis = GetEngine()->physicsSimulation.collisionVisualization;
   vis.AddGJKStep(simplex, simplexCount);
 }
开发者ID:Twiebs,项目名称:venom,代码行数:7,代码来源:collision.cpp


示例17: GetEngine

void Player::CheckKeys(int iCurrentTime)
{
	// Get the amount of time since the last update
	int delta = iCurrentTime - _previousTime;

	// Detects if the space bar has been lifted
	bool spaceWasDown = _spaceIsDown;
	_spaceIsDown = GetEngine()->IsKeyPressed(SDLK_SPACE);
	if (spaceWasDown && _spaceIsDown == false)
	{
		// On space bar up, cylce colour of the player
		switch (_colour)
		{
		case 0xff0000:
			_colour = 0x00ff00;
			break;
		case 0x00ff00:
			_colour = 0x0000ff;
			break;
		case 0x0000ff:
			_colour = 0xff0000;
			break;
		}
	}
}
开发者ID:marcuswhybrow,项目名称:g52cfj-cw1-windows,代码行数:25,代码来源:Player.cpp


示例18: keyguard

	int Ardb::ZClear(const DBID& db, const Slice& key)
	{
		KeyLockerGuard keyguard(m_key_locker, db, key);
		ZSetMetaValue meta;
		if (0 != GetZSetMetaValue(db, key, meta))
		{
			return 0;
		}
		Slice empty;
		ZSetKeyObject sk(key, empty, meta.min_score, db);

		BatchWriteGuard guard(GetEngine());
		struct ZClearWalk: public WalkHandler
		{
				Ardb* z_db;
				int OnKeyValue(KeyObject* k, ValueObject* value, uint32 cursor)
				{
					ZSetKeyObject* sek = (ZSetKeyObject*) k;
					ZSetScoreKeyObject tmp(sek->key, sek->value, sek->db);
					z_db->DelValue(*sek);
					z_db->DelValue(tmp);
					return 0;
				}
				ZClearWalk(Ardb* db) :
						z_db(db)
				{
				}
		} walk(this);
		Walk(sk, false, &walk);
		KeyObject k(key, ZSET_META, db);
		DelValue(k);
		return 0;
	}
开发者ID:ericcapricorn,项目名称:ardb,代码行数:33,代码来源:zsets.cpp


示例19: ossl_engine_get_name

static VALUE
ossl_engine_get_name(VALUE self)
{
    ENGINE *e;
    GetEngine(self, e);
    return rb_str_new2(ENGINE_get_name(e));
}
开发者ID:Emily,项目名称:rubinius,代码行数:7,代码来源:ossl_engine.c


示例20: GetEngine

/**
Handle the update action, moving the object and/or handling any game logic
*/
void BouncingBall1::DoUpdate( int iCurrentTime )
{
	// Work out current position
	m_oMovement.Calculate(iCurrentTime);
	m_iCurrentScreenX = m_oMovement.GetX();
	m_iCurrentScreenY = m_oMovement.GetY();
	
	// If movement has finished then request instructions
	if ( m_oMovement.HasMovementFinished( iCurrentTime ) )
	{
		m_oMovement.Reverse();
		m_oMovement.Calculate(iCurrentTime);
		m_iCurrentScreenX = m_oMovement.GetX();
		m_iCurrentScreenY = m_oMovement.GetY();
	}

	if ( m_pTileManager->IsValidTilePosition( m_iCurrentScreenX, m_iCurrentScreenY ) )
	{
		int iTileX = m_pTileManager->GetTileXForPositionOnScreen(m_iCurrentScreenX);
		int iTileY = m_pTileManager->GetTileYForPositionOnScreen(m_iCurrentScreenY);
		int iCurrentTile = m_pTileManager->GetValue( iTileX, iTileY );
		m_pTileManager->UpdateTile( GetEngine(), iTileX, iTileY, iCurrentTile+1 );
	}

	// Ensure that the object gets redrawn on the display, if something changed
	RedrawObjects();
}
开发者ID:sydafq,项目名称:CPP_CW2015,代码行数:30,代码来源:BouncingBall.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetEntity函数代码示例发布时间:2022-05-30
下一篇:
C++ GetEnemy函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap