Simple SDL2 + OpenGl Resize Event

It seems like there aren’t many tutorials for SDL 2 out yet as it is going to be released in may but maybe someone could help me.

In SDL 1.3 it seems like an window resize and context resize was simply:

Code:
void CApp::OnEvent(SDL_Event* Event) {
switch(Event->type){
case SDL_WINDOWEVENT_RESIZED:resizeWindow(Event.resize.w,Event.resize.h); break;
}
}
void resizeWindow(int w, int h){
glViewport(0,0,w,h);
}

But in SDL2 it seems like the event does not have the variable resize anymore. How has this changed and what is the new way of obtaining the new window size to resize events.

Thank you all in advance,
Best Wishes
Kevin

Here ya go: http://wiki.libsdl.org/moin.fcg/SDL_WindowEvent

You can also look at the headers for the definitive details of the new data
structures until a release is made.

Jonny DOn Wed, Apr 17, 2013 at 6:14 AM, NoxMortem wrote:

**
It seems like there aren’t many tutorials for SDL 2 out yet as it is going
to be released in may but maybe someone could help me.

In SDL 1.3 it seems like an window resize and context resize was simply:

Code:

void CApp::OnEvent(SDL_Event* Event) {
switch(Event->type){
case
SDL_WINDOWEVENT_RESIZED:resizeWindow(Event.resize.w,Event.resize.h);
break;
}
}
void resizeWindow(int w, int h){
glViewport(0,0,w,h);
}

But in SDL2 it seems like the event does not have the variable resize
anymore. How has this changed and what is the new way of obtaining the new
window size to resize events.

Thank you all in advance,
Best Wishes
Kevin


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Thank you! Exactly what i needed!