I have an Image class with a draw function like this:
void Img::Draw(SDL_Surface* surface) {
SDL_Rect offset;
offset.x = X;
offset.y = Y;
SDL_BlitSurface(imgSurface, NULL, surface, &offset);
}
I would like to be able to do this in the script:
Image img;
img.x = 0;
img.y = 0;
img.Draw();
But I need to pass the screen Surface to the draw function I don't want my scripters to have to do img.Draw(GetSurface()); I would like this to be handled through the C++ backend code is there a way that everytime img.Draw() is called in script I can pass the SDL_Surface into the C++ method?
If you need this explained better ask away its 12 A.M. here might not have explained it the best.