level 12
#include <SDL_ttf.h>
#include <SDL2/SDL.h>
#include <SDL_image.h>
#include <string>
#define present SDL_RENDERER_PRESENTVSYNC
int main()
{
SDL_Init(SDL_INIT_EVERYTHING); TTF_Init();
SDL_Renderer *screen=NULL;
SDL_Window *W=NULL;
SDL_Texture*A= NULL;
W=SDL_CreateWindow("my",0,0,0,0,0);
screen=SDL_CreateRenderer(W,-1,present);
TTF_Font *font =TTF_OpenFont("/system/fonts/DroidSansFallback.ttf" ,20);
SDL_Color color={255,255,0,0};
SDL_Surface *C=TTF_RenderUTF8_Solid(font,"你",color);
A= SDL_CreateTextureFromSurface(screen,C);
SDL_RenderCopy(screen,A,NULL,NULL);
SDL_RenderPresent(screen);
SDL_DestroyWindow(W);
SDL_DestroyRenderer(screen);
SDL_DestroyTexture(A);
SDL_FreeSurface(C);
TTF_CloseFont(font);
SDL_Delay(3000);
}
2014年09月05日 04点09分