1. 01 Feb, 2006 1 commit
  2. 26 Jan, 2006 1 commit
  3. 12 Dec, 2005 1 commit
  4. 24 Jun, 2005 1 commit
    • Ryan C. Gordon's avatar
      Patch from Antonio SJ Musumeci: · 3a608a44
      Ryan C. Gordon authored
      "
      This code with SDL-1.2.8 and CVS:
      
      #include <stdio.h>
      #include <stdlib.h>
      #include <SDL.h>
      
      int
      main(int argc, char** argv)
      {
         char alphabet[26] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
         char buffer_file[27] = {0};
         char buffer_mem[27]  = {0};
         int rv_file;
         int rv_mem;
         FILE* file_ptr;
         SDL_RWops* rwop_file;
         SDL_RWops* rwop_mem;
      
         file_ptr = fopen("./blah", "w");
         fwrite(alphabet, 1, sizeof(alphabet), file_ptr);
         fclose(file_ptr);
      
         rwop_mem  = SDL_RWFromMem(alphabet, sizeof(alphabet));
         rwop_file = SDL_RWFromFile("./blah", "r");
         rv_mem  = SDL_RWread(rwop_mem , buffer_mem,  5, 6);
         rv_file = SDL_RWread(rwop_file, buffer_file, 5, 6);
         printf("From File: %d %s\n"
                "From Mem:  %d %s\n",
      	 rv_file,
      	 buffer_file,
      	 rv_mem,
      	 buffer_mem);
         printf("Seek end of File: %d\n"
      	 "Seek end of Mem:  %d\n",
      	 SDL_RWseek(rwop_file, 0, SEEK_END),
      	 SDL_RWseek(rwop_mem , 0, SEEK_END));
         SDL_RWclose(rwop_file);
         SDL_RWclose(rwop_mem);
      
         return 0;
      }
      
      
      Produces this output:
      
       From File: 5 ABCDEFGHIJKLMNOPQRSTUVWXYZ
       From Mem:  5 ABCDEFGHIJKLMNOPQRSTUVWXY
      Seek end of File: 26
      Seek end of Mem:  26
      "
      
      --ryan.
      
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401079
      3a608a44
  5. 04 Jan, 2004 2 commits
  6. 17 Nov, 2002 1 commit
  7. 06 Mar, 2002 1 commit
  8. 14 Dec, 2001 1 commit
  9. 23 May, 2001 1 commit
  10. 26 Apr, 2001 1 commit
    • Sam Lantinga's avatar
      Initial revision · 2f110628
      Sam Lantinga authored
      --HG--
      extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401
      2f110628