Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved asset loading and simplified rendering #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SoggyRhino
Copy link

@SoggyRhino SoggyRhino commented Sep 7, 2024

Description

Renderer and Mesh changes

  • Separation of concerns since there is a Render class it makes more sense for it to handle binding buffers/textures and drawing
  • Render can better handle opengl state avoiding state checks inside a mesh render function
  • Trimmed unnecessary opengl calls

SpriteSheet

  • Potential NullPointerException if ImageIO.read() throws
  • Added all code into a single catch block since it is all being handled the same way
  • SpriteSheet(String filename) is never used but I wasn't sure if it is for future imporvemts

Layer

  • Cache Images to avoid reading the same file from disk multiple times
  • Resulted in a significant improvement on startup speed

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • [ ✓] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • [✓ ] I have performed a self-review of my own code
  • [ ✓] I have commented my code, particularly in hard-to-understand areas
  • [ X] I have added tests that prove my fix is effective or that my feature works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant