本文整理汇总了C++中SimpleGUI::GetButton方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleGUI::GetButton方法的具体用法?C++ SimpleGUI::GetButton怎么用?C++ SimpleGUI::GetButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleGUI
的用法示例。
在下文中一共展示了SimpleGUI::GetButton方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void CALLBACK
OnGUIEvent(int ID)
{
switch(ID)
{
case PLACE_TOWER:
gui.GetButton(PLACE_TOWER)->SetPressed(true);
return;
}
}
示例2: DefWindowProc
LRESULT CALLBACK
WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
POINT mousePos;
int dx = 0;
int dy = 0;
switch( msg )
{
case WM_LBUTTONDOWN:
if( wParam & MK_LBUTTON )
{
SetCapture(hwnd);
mOldMousePos.x = ( short )LOWORD(lParam);
mOldMousePos.y = ( short )HIWORD(lParam);
gui.UpdateMouse(mOldMousePos.x,mOldMousePos.y,true);
}
return 0;
case WM_LBUTTONUP:
ReleaseCapture();
return 0;
case WM_RBUTTONDOWN:
if( wParam & MK_RBUTTON )
{
SetCapture(hwnd);
mOldMousePos.x = ( short )LOWORD(lParam);
mOldMousePos.y = ( short )HIWORD(lParam);
POINT d;
d.x = ( short )LOWORD(lParam);
d.y = ( short )HIWORD(lParam);
//qtc.TEST(vp, d, qtc.getBLS(), 5, md3dDevice);
if(gui.GetButton(PLACE_TOWER)->GetPressed())
{
D3DXVECTOR3 res = qtc.PlaceATower(vp, d);
if (res != D3DXVECTOR3(-99,-99,-99))
{
mTowers.push_back(Tower());
mTowers.back().init(md3dDevice, D3DXVECTOR3(7.5f, 7.5f, 7.5f), res);
newCube = true;
nrOfTowers.resize(mTowers.size());
currentTower = (int)nrOfTowers.size()-1;
gui.GetButton(PLACE_TOWER)->SetPressed(false);
}
}
//cam.setLens(0.30f*(gameTime.getDeltaTime()*20), (float)SCREEN_WIDTH/SCREEN_HEIGHT, 1.0f, 1000.0f);
}
return 0;
case WM_RBUTTONUP:
GetCamera().setLens(0.30f*pi, (float)SCREEN_WIDTH/SCREEN_HEIGHT, 1.0f, 1000.0f);
ReleaseCapture();
return 0;
case WM_MOUSEMOVE:
if( wParam & MK_LBUTTON || wParam & MK_RBUTTON )
{
mousePos.x = ( short )LOWORD(lParam);
mousePos.y = ( short )HIWORD(lParam);
dx = mousePos.x - mOldMousePos.x;
dy = mousePos.y - mOldMousePos.y;
GetCamera().rotateY( dx * 0.0087266f );
GetCamera().pitch( dy * 0.0087266f );
mOldMousePos = mousePos;
}
return 0;
case WM_KEYDOWN:
if(wParam == VK_CONTROL) GetCamera().crouch();
if(wParam == VK_SPACE)
{
if (!jumping)
GetCamera().setJump(GetTime().getGameTime());
jumping = true;
}
if (GetAsyncKeyState('F') & 0x8000)
{
if (funRot)
funRot = false;
else
funRot = true;
}
if (GetAsyncKeyState('R') & 0x8000)
{
if (grid)
grid = false;
else
grid = true;
}
if (GetAsyncKeyState('O') & 0x8000)
{
if(!newCube)
{
Tower c;
//.........这里部分代码省略.........