Results 1 to 4 of 4

Thread: Resize sdl surface

  1. #1
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45

    Resize sdl surface

    I've looked around and I cant seem to find anything that can resize an image in sdl with a new aspect ratio. Does anyone out there know of such a procedure/function? Thanks, it would be a great help for me in the prometheus project (units for simplifying game design for newbies)...

    cheers,
    code_glitch
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  2. #2
    PGDCE Developer Carver413's Avatar
    Join Date
    Jun 2010
    Location
    Spokane,WA,Usa
    Posts
    206
    you might try

    sdl_gfx

    zoomSurface()

    Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
    'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is 1
    then the destination 32bit surface is anti-aliased. If the surface is not 8bit
    or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.

  3. #3
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    cheers. I always thought it was just to scale it. Just looked into the docs, seems I was wrong. Sorry for asking such an elementary question...
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  4. #4
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Problem with this is that any scaling, rotation or fading effects you throw into the library/engine will slow down performance significantly, unless you throw in some OpenGL, but then you're probably tossing away the simplicity factor. Sore truth is that these 3 effects are the product of 3D hardware acceleration for 2D games.

    There is, I believe, a 2 times zoom function in the JEDI-SDL units. Written for fast drawing double the size of any image you need.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •