What does data1 and data2 mean/do within SDL_WindowEvent

Hello.
I just want to figure out what data1 and data2 mean/do?..
I use them when re-sizing my game window but I don’t really get what’s going on.
Here’s an example of my code:

case SDL_WINDOWEVENT:
switch( mEvent.window.event )
{
case SDL_WINDOWEVENT_SIZE_CHANGED:
MWINDOW_WIDTH = mEvent.window.data1;
MWINDOW_HEIGHT = mEvent.window.data2;
SDL_RenderPresent( mWindowRenderer );
break;
case SDL_WINDOWEVENT_EXPOSED:
SDL_RenderPresent( mWindowRenderer );
break;
}

Also, I noticed that if I comment out this part:


case SDL_WINDOWEVENT_EXPOSED:
SDL_RenderPresent( mWindowRenderer );
break;

Everything has the same effect still. So what is that part supposed to be doing?
Thank you :metal:

https://wiki.libsdl.org/SDL_WindowEvent#Code_Examples has self-explanatory examples for all kinds of window events (note that data1 and data2 isn’t even used/doesn’t have a meaning in some of them!)

1 Like

Oh I think I get it…
I commented out this part:
case SDL_WINDOWEVENT_SIZE_CHANGED:

/MWINDOW_WIDTH = mEvent.window.data1; <----- Commented this section out
MWINDOW_HEIGHT = mEvent.window.data2;
/ <------ Commented this section out

SDL_RenderPresent( mWindowRenderer );

And it still works fine. So can I just leave it like that?

Also, I still don’t understand what’s the deal with SDL_WINDOWEVENT_EXPOSED, sorry lol.