I Made an Image Loader in 15 Lines for My Game Engine

Поділитися
Вставка
  • Опубліковано 22 вер 2022
  • Engine series: • How to make a GAME ENG...
    ➤ Website: dylanfalconer.com
    ➤ GitHub: github.com/Falconerd
    ➤ Discord: / discord

КОМЕНТАРІ • 18

  • @michaellundgren6949
    @michaellundgren6949 Рік тому +19

    Nice. I wrote a BMP loader that is about 100 lines in C++. I added some error checking and a way to flip the image vertically on load. If the bmp file is missing or wrong format, it throws an exception and generates a procedural default checkerboard pattern of pink and black. So it is very easy to see an error has occured.

  • @mgord9518
    @mgord9518 9 місяців тому

    I like ABGR, essentially everything in existence now is little-endian, so it allows the data to be directly loaded into tons of low-level libraries natively.
    For anyone wondering, you can also directly load the pixel data in xlib, I just tried this yesterday

  • @bluesillybeard
    @bluesillybeard Рік тому +4

    QOI (an open-source image format made by some random guy) is pretty cool, although it was made super recently and very few programs support it.
    It's compressed to about the same level as PNG, while being a crap ton simpler and faster.
    EDIT: LOL should read comments before commenting, someone already suggested this lol

    • @DylanFalconer
      @DylanFalconer  Рік тому +1

      Yeah, it looks really cool. I was already familiar with Dominic as the first Game Engine I used was ImpactJS about a decade ago now.

  • @jasonlei4498
    @jasonlei4498 Рік тому +4

    It's been a while! This was awesome!

  • @EmiTheLoomistar
    @EmiTheLoomistar Рік тому +1

    I didn't know about tga and luckily Clip studio supports it. Thanks man, you saved me from coding a 100000 lines png loader

  • @undeadpresident
    @undeadpresident Рік тому +1

    QOI is another compressed image format I heard of that's supposed to be faster and easier to load than png too.

    • @DylanFalconer
      @DylanFalconer  Рік тому +1

      QOI was actually an inspiration for my own image format PIE that I made little while ago - it's very specifically good for images that use a restricted palette

    • @mgord9518
      @mgord9518 9 місяців тому

      ​@@DylanFalconerDo you have the source published? I'm currently making a pixel-art game in Zig and using PNG for assets but want to go with something simpler. I looked into QOI but I don't like how you can't use restricted pallets so all of my files would be unnecessarily large

  • @ar2000
    @ar2000 Рік тому +1

    did a similar things in Lua. I support ppm and pam (only pam support alpha). Unfortunately gimp an most imgs viewer doesn't support pam even if they support ppm even if they are all defined by Netpbm

  • @metallyricsarchive9947
    @metallyricsarchive9947 Рік тому

    Cool video

  • @arf20
    @arf20 Рік тому

    SDL has a extra for this, SDL_img, which loads to an SDL_Texture in VRAM

  • @richardericlope3341
    @richardericlope3341 Рік тому

    I remember making an OpenGL 1.x based 2D library which only supported TGA files. Didn't have the compression of a PNG but it worked. Hahahaha!

  • @irishbruse
    @irishbruse Рік тому +2

    you should use qoi image format its super simple

    • @DylanFalconer
      @DylanFalconer  Рік тому +1

      Dominic is back at it again aye. If Aseprite is updated to support it then I'll consider it - looks cool!

  • @cyrusrecycling
    @cyrusrecycling Рік тому

    Do I have an email I can contact you directly with?