Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ruby2d/ruby2d
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.10.0
Choose a base ref
...
head repository: ruby2d/ruby2d
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.11.0
Choose a head ref
  • 17 commits
  • 49 files changed
  • 7 contributors

Commits on Jul 27, 2021

  1. Configuration menu
    Copy the full SHA
    5ea76fa View commit details
    Browse the repository at this point in the history

Commits on Aug 7, 2021

  1. Configuration menu
    Copy the full SHA
    08c83fa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e0bb808 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8d9a876 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e255b4c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5fd6cd0 View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2021

  1. Configuration menu
    Copy the full SHA
    9787d22 View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2021

  1. Configuration menu
    Copy the full SHA
    7131894 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ae55385 View commit details
    Browse the repository at this point in the history

Commits on Aug 12, 2021

  1. Tileset rendering refactor (#211)

    * Update tileset to use `Image` and `Texture` for rendering
    
    Also add the ability to flip and rotate tiles
    
    Lastly extract the logic to check if an image exists to the `Image`
    class for re-use.
    
    * Remove C tileset code
    
    We don't need this any more as we're using `Image` and `Texture` to
    render out tiles now :)
    
    * Update tileset flipping and rotation
    
    Use keyword arguments so the user can easily specify either flip or rotation.
    Add these to the tileset rendering test to ensure it doesn't break :)
    
    * Test setting the window icon in the render test
    
    I'd like to factor the code which sets the window icon, so let's test it
    first :)
    
    * Update window icon to use new rendering, remove R2D_Image
    
    The window icon was the last place we were using the R2D_Image C struct. I've
    updated this code to use the new image functions to directly get a surface and
    removed the remaining unused image code.
    
    * Remove now unused rendering methods
    
    These methods were used by Sprite/Tileset/Text and Image, but now they
    use the new function and directly provide vertices information. So these
    can be removed.
    
    * Rename new draw texture to be just 'texture' now
    
    This texture rendering function now replaces the old one, so we can
    remove the 'new' word.
    mariovisic authored Aug 12, 2021
    Configuration menu
    Copy the full SHA
    c02baa8 View commit details
    Browse the repository at this point in the history

Commits on Aug 16, 2021

  1. Improve texture rendering by 75% using openGL VBO (#213)

    * Improve texture rendering by 75% using openGL VBO
    
    To improve rendering performance of textures we now store the texture vertices
    in the same VBO buffer that we use for regular shape drawing.
    
    We do have an added loop through all of the `verticesTextureIds`, values,
    though the benchmark for pixel rendering is still showing the same 52fps as
    before. So it seems like there's not a big impact there.
    
    One thing to note is that we're now duplicating our vertices for textures as
    we're not defining our own indices (textured objects have 6 vertices now,
    rather than 4), rather using the default for GL_TRIANGLES. This is convenient
    as we can use the same `GLDrawArrays` call for both triangles and textures.
    
    I did experiement with using `glDrawElementsInstancedBaseVertex` for rendering
    our textured objects to see if it would increase performance, but I couldn't
    get it to render properly and performance seemed unchanged, so there doesn't
    seem to big a big performance penalty of allocating the extra vertices.
    
    I've added a benchmark for rendering tilesets, on the main branch I'm getting
    16fps, with this patch the performance is now at 28fps, so 75% more frames per
    second compared to before.
    
    Lastly fix a bug where tilesets would throw an exception when rendering due to
    a missing z value.
    
    * Fix int type warning
    
    Co-authored-by: Tom Black <[email protected]>
    mariovisic and blacktm authored Aug 16, 2021
    Configuration menu
    Copy the full SHA
    e0e1c73 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2021

  1. Add font styling (#214)

    When creating a text object you can now set the style attribute to be
    either: 'bold', 'italic', 'underline' or 'strikethrough', any other
    value results in regular font styling.
    mariovisic authored Aug 22, 2021
    Configuration menu
    Copy the full SHA
    65f5712 View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2021

  1. Free textures when updating text (#216)

    After refactoring our text class to use the new texture rendering method,
    changing the text means a new texture but we don't free up the old one in C
    land.
    
    When updating text we re-assign the `@texture` instance. Currently we
    handle freeing SDL surfaces by setting the `@pixel_data` value to `nil`.
    As this is a C object, the ruby garbage collector will call the correct
    free function in C.
    
    For textures though we don't hold a wrapped pointer to the C open GL
    texture object, we could do, but we don't actually use it for anything
    in ruby, so it would be easy to accidentally alter or remove that code
    causing a memory leak.  So to free up our texture we can now explicitly
    call delete and pass our texture_id, this way it's obvious what that
    code does and why we need it :)
    mariovisic authored Aug 27, 2021
    Configuration menu
    Copy the full SHA
    003ef52 View commit details
    Browse the repository at this point in the history
  2. Add error handling around open windows (#215)

    * Add error handling around open windows
    
    Add two errors:
    1) prevent users from calling 'show' multiple times as it currently
       doesn't function
    2) prevent users directly drawing objects outside of the render block
       (this does not work as the window is not yet ready)
    
    * Add @blacktm's suggestions for detecting multiple open windows
    
    * Ensure all renderable classes do a window check
    
    For some reason I had missed these classes earlier. Also remove one call
    in Triangle to the window check, as we only need to perform it on direct
    draw calls, not when the private render method is called (as the window
    is always ready in that case).
    mariovisic authored Aug 27, 2021
    Configuration menu
    Copy the full SHA
    54ec3db View commit details
    Browse the repository at this point in the history
  3. Add scaling to tileset and fix spacing bug (#217)

    Previously: to scale the size of tiles displayed in a tileset, you would need
    to multiply the tile width/height, the image width/height as well as the
    spacing and padding values by the scale. This works but means that you need to
    know the dimensions of the tileset image, rather than having it be detected and
    you have to multiply each value which can be confusing.
    
    This patch still allows you to manually set those values if you wish but
    introduces a 'scale' attribute which will do the work for you, meaning now you
    can set a scale without having to specify the width/height of the tileset image
    manually and multiply all attributes.
    
    This patch also fixes a bug where the spacing was not being calculated
    correctly, it was using `(tile_x + spacing) * tile_width` which is incorrect,
    it is now: `tile_x * (spacing + tile_width)`
    mariovisic authored Aug 27, 2021
    Configuration menu
    Copy the full SHA
    117f250 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2021

  1. docs: fix typo (#218)

    There is a small typo in ext/ruby2d/sound.c.
    
    Should read `details` rather than `deails`.
    timgates42 authored Sep 4, 2021
    Configuration menu
    Copy the full SHA
    173347d View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2021

  1. Bump version to 0.11.0

    blacktm committed Sep 7, 2021
    Configuration menu
    Copy the full SHA
    8df954e View commit details
    Browse the repository at this point in the history
Loading