Too few arguments to function

I'm trying to display a picture based on a random generated number.
1
2
3
4
5
6
7
8
9
10
11
12
void apply_surface(int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL)
{
    //Holds offsets
    SDL_Rect offset;

    //Get offsets
    offset.x = x;
    offset.y = y;

    //Blit
    SDL_BlitSurface( source, clip, destination, &offset );
}






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

void Button1::handle_events()
{
    //the mouse offsets
    int x = 0, y = 0;

    if (event.type == SDL_MOUSEBUTTONDOWN)
    {
        //if the mouse button was pressed
        if (event.button.button == SDL_BUTTON_LEFT)
        {
            generate();

            if ( slot1 == 1 )
            {
                apply_surface(100, 250, image_choice, screen, slot);
            }
What is the line with the error?
first section of code, first line apply_surface function
Is image_choice and screen of type SDL_Surface*? Is slot of type SDL_Rect*?
slot is a an array i meant to put &slot[luckySeven] but even when i do put that it doesn't work
More importantly, what is the full error message?
C:\Users\owner\Desktop\SlotMachine\SlotMachine.cpp|87|error: too few arguments to function 'void apply_surface(int, int, SDL_Surface*, SDL_Surface*, SDL_Rect*)'|
The important line is the one after that ("at this point in file").
And what does the declaration of apply_surface look like (if there is one)?
Oh man, Thanks !, I had a random applysurface in it
Topic archived. No new replies allowed.