这个标题可能不是怎么好,实在是想不出什么好的标题了,知道大家知道是怎么回事就可以了。
讲解:
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
Clesson05::Clesson05()
{
}
Clesson05::~Clesson05()
{
}
/*
销毁资源
*/
void Clesson05::cleanup(SDL_Window* window)
{
SDL_DestroyWindow(window);
//SDL_QUIT();
}
/*
销毁资源
*/
void Clesson05::cleanup(SDL_Texture* image, SDL_Renderer* renderer, SDL_Window* window)
{
if(image)
{
SDL_DestroyTexture(image);
}
if(renderer)
{
SDL_DestroyRenderer(renderer);
}
if(window)
{
SDL_DestroyWindow(window);
}
}
/*
C++的标准输出
*/
void Clesson05::logSDLError(std::ostream &os, const std::string &msg){
os << msg << " error: " << SDL_GetError() << std::endl;
}
/*
创建一个SDL_Texture
*/
SDL_Texture* Clesson05::loadTexture(const std::string &file, SD