swappo1
March 24th, 2009, 03:29 AM
Hello,
I am trying to convert an SDL tutorial from lazy foo from C++ to C but I don't know C++. I have the following written in C++ and I am not sure how to convert the SDL_Rect* clip = NULL into something C will accept. Here is the function and output. Any ideas?
SDL_Rect clip[4];
..........................
void apply_surface(int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL)
{
SDL_Rect offset;
offset.x = x;
offset.y = y;
SDL_BlitSurface(source, clip, destination, &offset);
lazyfoo6.c:17: error: expected ‘;’, ‘,’ or ‘)’ before ‘=’ token
lazyfoo6.c:95: error: expected ‘;’, ‘,’ or ‘)’ before ‘=’ token
I am trying to convert an SDL tutorial from lazy foo from C++ to C but I don't know C++. I have the following written in C++ and I am not sure how to convert the SDL_Rect* clip = NULL into something C will accept. Here is the function and output. Any ideas?
SDL_Rect clip[4];
..........................
void apply_surface(int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL)
{
SDL_Rect offset;
offset.x = x;
offset.y = y;
SDL_BlitSurface(source, clip, destination, &offset);
lazyfoo6.c:17: error: expected ‘;’, ‘,’ or ‘)’ before ‘=’ token
lazyfoo6.c:95: error: expected ‘;’, ‘,’ or ‘)’ before ‘=’ token