这个标题可能不是怎么好,实在是想不出什么好的标题了,知道大家知道是怎么回事就可以了。
讲解:
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, SDL_Renderer *ren){
SDL_Texture *texture =

这是一篇关于SDL2教程的文章,主要聚焦在RenderClear函数的使用上,详细解释了该函数在绘制PNG图片和一般图片过程中的作用和效果。
最低0.47元/天 解锁文章
2124

被折叠的 条评论
为什么被折叠?



