In SDL::Event I found this:

Window resize events resize_w, resize_h When SDL_RESIZABLE is passed as a flag to SDL_SetVideoMode the user is + allowed to resize the applications window. When the window is resized an SDL_VIDEORESIZE is reported, with the new window width and height values stored in the resize structure's resize_w and resize_h. When an + SDL_VIDEORESIZE is received the window should be resized to the new dimensions using SDL_SetVideoMode.

In your program it looks like you have everything except the last part where it says to use SDL_SetVideoMode.

I couldn't find any examples that use that but I did find an example included in SDL called examples/cookbook/1.pl that uses SDL::Video::set_video_mode(320, 320, 32, SDL_SWSURFACE );

The documentation for SDL::Video::set_video_mode() shows that function seems to be what you need:

SDL_RESIZABLE Create a resizable window. When the window is resized by the user a SDL_VIDEORESIZE event is generated and SDL::Video::set_video_mode can be called again with the new size.

There are more details there on how to call SDL::Video::set_video_mode().

Your application looks interesting. Let us know how it works out. Good luck!

Update:

After looking at your application again and looking at the contents of App.pm I notice the resize() function you use calls SDL::Video::set_video_mode() so it seems like you've done it correctly. My comments above were not very helpful it seems.


In reply to Re^3: SDL/SDLx issue with application resizing by Lotus1
in thread SDL/SDLx issue with application resizing by Garden Dwarf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.