Wiki Page Content

Revision 1 as of 2010-07-15 20:51:01

Clear message

DRAFT

SDL_RWclose

Use this function (macro) to *call the close function in an SDL_RWops structure.*

Syntax

SDL_RWclose(ctx)

green

  • (ctx)->close(ctx)

Function Parameters

ctx

*a pointer to an SDL_RWops structure*

Return Value

*Returns 0 on success, -1 on error*; call SDL_GetError() for more information.

Code Examples

*

#include <stdio.h>
#include "SDL_rwops.h"

int main()
{
  SDL_RWops *rw=SDL_RWFromFile("test.bin","r");
  if(rw==NULL)
  {
    fprintf(stderr,"Couldn't open test.bin\n");
    return(1);
  }
  fprintf(stderr,"Opened test.bin\n");
  SDL_RWclose(rw);
  fprintf(stderr,"Closed test.bin\n");
  return(0);
}

*

Remarks

*Note: This is not a built-in function. This is a macro that calls whatever close function happens to be pointed to by an SDL_RWops structure.*

green


CategoryAPI, CategoryIO

Feedback
Please include your contact information if you'd like to receive a reply.
Submit