莫是人吧 关注:4贴子:129
  • 3回复贴,共1


来自Android客户端1楼2016-05-28 17:10回复
    第一个有结构的黑窗口为了记忆函数。
    #include <SDL2/SDL.h>
    #include <SDL2/SDL_image.h>
    int main(int,char**){
    SDL_Renderer*renderer;
    SDL_Window*win=NULL;
    SDL_Surface*hello=NULL;
    SDL_Surface*world=NULL;
    SDL_Init(SDL_INIT_EVERYTHING);
    win=SDL_CreateWindow("myhw",0,0,400,500,0);
    hello=IMG_Load("/sdcard/DCIM/ 6.jpg");
    SDL_FreeSurface(hello);
    SDL_Delay(2000);
    SDL_Quit();
    return 0;
    }


    来自Android客户端2楼2016-05-28 17:12
    回复
      第二个成功输出图片

      #include <SDL2/SDL.h>
      #include<SDL2/SDL_image.h>
      int main(int,char**){
      SDL_Window*win=NULL;
      SDL_Surface*Surface=NULL;
      SDL_Texture*Texture=NULL;
      SDL_Renderer*r=NULL;
      SDL_Init(SDL_INIT_EVERYTHING);
      win=SDL_CreateWindow("六",0,0,400,600,0);
      Surface=IMG_Load("/sdcard/hello.jpg");
      r=SDL_CreateRenderer(win,-1,SDL_RENDERER_ACCELERATED);
      Texture=
      SDL_CreateTextureFromSurface(r,
      Surface);
      SDL_FreeSurface(Surface);
      SDL_RenderClear(r);
      SDL_RenderCopy(r,Texture,NULL,
      NULL);
      SDL_RenderPresent(r);
      SDL_Delay(3000);
      SDL_DestroyTexture(Texture);
      SDL_DestroyRenderer(r);
      SDL_DestroyWindow(win);
      return 0;
      }


      来自Android客户端3楼2016-05-28 22:24
      回复
        算了api还是存手机上


        来自Android客户端13楼2016-09-10 15:05
        回复