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


C++ Pane::getViewport方法代码示例

本文整理汇总了C++中Pane::getViewport方法的典型用法代码示例。如果您正苦于以下问题:C++ Pane::getViewport方法的具体用法?C++ Pane::getViewport怎么用?C++ Pane::getViewport使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pane的用法示例。


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

示例1: main


//.........这里部分代码省略.........
												
							case SDLK_6:
								selectedPlayer = 5;
								break;
							case SDLK_x:
								tmpR.w++;
								break;
							case SDLK_z:
								if(tmpR.w - 1 > 0)
									tmpR.w--;
								break;
							case SDLK_y:
								tmpR.h++;
								break;
							case SDLK_t:
								if(tmpR.h - 1 > 0)
									tmpR.h--;
								break;

						}
					}
				}

				// Update all the various data structures with the information from the "input".
				tDelta = SDL_GetTicks() - tPrev;
				tPrev = SDL_GetTicks();
				update(tDelta);

				//Clear screen
				SDL_SetRenderDrawColor( gRenderer, 0xBB, 0xBB, 0xBB, 0xFF );
				SDL_RenderClear( gRenderer );

				// Probably should change 0 and 8 to something more human readable, but they just refer to texture id's, so might be more trouble than worth it.
				gTM->RenderTextureToViewport(0, *aPane.getViewport());
				gTM->RenderTextureToViewport(8, *bPane.getViewport());

				// Draw all the locations.
				// Need to make sure in the enum that the locations like the player stars that appear on the markets
				//  come after the markets so aren't drawn underneath where they can't be seen.
				for(int i = 0; i < NUMLOCALS; i++)
				{
					boardLocation[i]->draw(gTM);
				}

// testing stuff
if(true)
{
				if(gRMouseState == 1 && RtargetDestinationID == -1)
				{
					RtargetDestinationID = 1;
					fprintf(stderr, "Right Mouse Down happened at x=%d, y=%d\n", gMousex,gMousey);
					int sourceID = ((Mto1gLocation*)boardLocation[GENERATOR])->SourceClickedOn(gMousex,gMousey);

					if(sourceID != -1 )
					{

						((Mto1gLocation*)boardLocation[GENERATOR])->removeValue(sourceID);
					}


				}
				if(gRMouseState == 0 && RtargetDestinationID > -1)
				{
					RtargetDestinationID = -1;
				}
开发者ID:AshenShugar,项目名称:Euphoria,代码行数:66,代码来源:main.cpp


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