2017-01-03 23:32:35 +08:00
|
|
|
#include "App.h"
|
|
|
|
|
2017-01-04 09:50:16 +08:00
|
|
|
using namespace Engine;
|
2017-01-08 09:41:47 +08:00
|
|
|
using namespace MiniEngine;
|
2017-01-04 09:50:16 +08:00
|
|
|
|
2017-01-03 23:32:35 +08:00
|
|
|
namespace App
|
|
|
|
{
|
|
|
|
/// Application Main Method
|
|
|
|
void Main()
|
|
|
|
{
|
2017-01-19 12:00:59 +08:00
|
|
|
Window wnd(1366,768);///16:9
|
2017-01-04 09:50:16 +08:00
|
|
|
Renderer rnd=wnd.getRenderer();
|
2017-01-19 12:00:59 +08:00
|
|
|
Font bigf;
|
|
|
|
if(bigf.use("msyh.ttf",72)<0)
|
|
|
|
{
|
|
|
|
mlog("Failed to open Font.");
|
|
|
|
return;
|
|
|
|
}
|
2017-02-02 14:23:22 +08:00
|
|
|
rnd.clear();
|
|
|
|
rnd.update();
|
|
|
|
|
|
|
|
MusicPlayer player;
|
2017-02-02 14:43:39 +08:00
|
|
|
Music m;
|
|
|
|
int ret=m.load("res/music.mp3");
|
|
|
|
printf("ret=%d\n",ret);
|
|
|
|
ret=player.add(m,-1);
|
|
|
|
printf("ret=%d\n",ret);
|
|
|
|
ret=player.play();
|
|
|
|
printf("ret=%d\n",ret);
|
|
|
|
printf("%s\n",Mix_GetError());
|
2017-02-02 14:23:22 +08:00
|
|
|
|
|
|
|
while(1) SDL_PollEvent(0);
|
2017-01-08 09:41:47 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
/// Sample Code of Brush
|
|
|
|
Brush b(wnd,Rect(wnd.getSize().w/2-50,wnd.getSize().h/2-50,100,100));
|
|
|
|
Texture t=rnd.loadImage("D:\\sample.png");
|
|
|
|
Rect dst(0,0,wnd.getSize().w,wnd.getSize().h);
|
|
|
|
b.copyTo(t,dst,false);
|
2017-01-07 17:51:09 +08:00
|
|
|
rnd.update();
|
2017-01-08 09:41:47 +08:00
|
|
|
SDL_Delay(2000);
|
|
|
|
*/
|
2017-01-03 23:32:35 +08:00
|
|
|
}
|
|
|
|
}
|