aod6060 / dsge

This is a simple 2D engine for my projects.
MIT License
1 stars 0 forks source link

Adding reloadInit + reloadRelease #21

Closed aod6060 closed 2 days ago

aod6060 commented 4 days ago
          Reload function are functions that will be called when the game reloads. I'm still debating on how this will work because I might need two functions for this one were I'm releasing resources and another reinitializing them. I might split it up into 2 different functions
  1. reloadInit()
  2. reloadRelease()

This actually might be better.

Originally posted by @aod6060 in https://github.com/aod6060/dsge/issues/1#issuecomment-2481949961

aod6060 commented 2 days ago

I've also added in reloadInit() and reloadRelease() function to the Texture2D Manager interface. I think I got it correct, however, once I get to the Configuration system.

aod6060 commented 2 days ago

All interfaces for have reloadInit() + reloadRelease(). These interfaces are

  1. texture2D_manager
  2. texture2D_array_manager
  3. vertex_buffer_manager
  4. index_buffer_manager

I'll be needing add in for these other system.

  1. render its self
  2. font render
  3. app system
aod6060 commented 2 days ago

I got a bunch of stuff done with the render section.

  1. I've added reloadInit and reloadRelease to the render and I think it works (after testing)
  2. Added reloadInit and reloadRelease to the font render (that one should work.)

The app system is next that I need to complete. I also figured out something about the aspect ratio function which will help me making the render use either 640x480, 640x360, or whater ever resolution is need for given ratio. The aspect ratio is calculated like so.

a=w/h were a is the aspect ratio, w is the width of the screen, and h is the height of the screen. This is a pretty useful equation because if you play around with it we can get both the width and height of the screen.

Aspect Ratio a=w/h Get width from aspect ratio w=a x h Get height from aspect ratio h = w / a

The one I'll be using is "h = w / a" because the height is the unknown variable here. So now I'm going to move to the app section.

aod6060 commented 2 days ago

Alright, I've added in the reloadInit and reloadRelease for the application interface. So this issue is done for now. Time to get the configuration interface implemented and so I can change the resolution and other aspects of the engine when it is running. :) Man, this is going to be totally cool because this is a feature that only large game companies add to their engine an now I know how to do it. Much exite :100: