本文整理汇总了C++中LTexture::loadMedia方法的典型用法代码示例。如果您正苦于以下问题:C++ LTexture::loadMedia方法的具体用法?C++ LTexture::loadMedia怎么用?C++ LTexture::loadMedia使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LTexture
的用法示例。
在下文中一共展示了LTexture::loadMedia方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main( int argc, char* args[] )
{
bool Menu=true;
int Clickx=0;
int Clicky=0;
bool trackingGeneral = false;
int motionx = 0;
int motiony = 0;
bool tracking[5]= {false,false,false,false,false};
bool overlap =false;
enum coordinates {x=0,y};
int directions[5]= {Down,Down,Down,Down,Down};
bool LockShips=false;
bool StartGame=false;
char PlayerMap [10][10];
char AIMap [10][10];
BlankMap(PlayerMap);
BlankMap(AIMap);
//Start up SDL and create window
if( !init())
{
SDL_Log( "Failed to initialize!\n" );
}
else
{
//Main loop flag
bool quit = false;
//Event handler
SDL_Event e;
gSplashTexture.loadMedia();
//While application is running
while( !quit )
{
//Handle events on queue
while( SDL_PollEvent( &e ) != 0 )
{
//User requests quit
if( e.type == SDL_QUIT )
{
quit = true;
}
else if( e.type == SDL_WINDOWEVENT )
{
//Window resize/orientation change
if( e.window.event == SDL_WINDOWEVENT_SIZE_CHANGED )
{
//Get screen dimensions
gScreenRect.w = e.window.data1;
gScreenRect.h = e.window.data2;
gSplashTexture.loadMedia();
//Update screenRocketY-gScreenRect.h/5
SDL_RenderPresent( gRenderer );
}
}
}
//Clear screen
SDL_SetRenderDrawColor( gRenderer, 0, 0, 0, 0 );
SDL_RenderClear( gRenderer );
float ShipsPotions[5][2] = {{gScreenRect.w/20,gScreenRect.h/10},{gScreenRect.w/20,gScreenRect.h/5},{gScreenRect.w/20,gScreenRect.h/4},{gScreenRect.w/20,gScreenRect.h/3},{gScreenRect.w/20,gScreenRect.h/2.5}};
float ShipSize [5][2]= {{gScreenRect.w/5,gScreenRect.h/20},{gScreenRect.w/14,gScreenRect.h/20},{gScreenRect.w/5,gScreenRect.h/20},{gScreenRect.w/5,gScreenRect.h/20},{gScreenRect.w/14,gScreenRect.h/20}};
//Maps.collision();
//Maps.ScrollingMaps();
while (true)
{
Clickx=0;
Clicky=0;
//Handle events on queue
while( SDL_PollEvent( &e ) != 0 )
{
//.........这里部分代码省略.........