I made a 2D graphics library

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • In this video I will show you how to use my 2D graphics library made in C++ with OpenGL.
    #cpp #programming #gamedev #opengl
    Join my Discord:
    / discord
    Check out Midnight Arrow on Steam 🥵!
    store.steampow...
    Join this channel if you want to support me 😻:
    / @lowlevelgamedev9330
    Make a game in C++ full course 🤯
    • Make a C++ game FULL G...
    Library Repo:
    github.com/mee...
    Game Setup Repo (with this library already configured):
    • Best C++ projects setu...
    Music:
    Evan King - Everything is Okay
    Evan King - Atomic Fire
    Evan King - Spicy Boom
    / contextsensitive
    contextsensiti...

Komentáře • 24

  • @mhdta_dev
    @mhdta_dev Před 7 měsíci +7

    I want to see gl4d library, where you can easily move and rotate objects in 4th dimension. It would be interesting to see how to render 4d objects in GL (possible idea for new video, maybe…)

    • @mhdta_dev
      @mhdta_dev Před 7 měsíci

      @@forest-dweller Ye, I saw. I want to understand how it works, maybe some tessellation and geometr shaders will help me to do that. I know that I also can use raymarching, but I don’t want.

  • @requestfx5585
    @requestfx5585 Před 7 měsíci +1

    Nice, really great video. But it seems like you only showed 2d aspects of the engine. It's only rendering right? So all the logic like collision and other physic stuff would you require to implemented yourself?

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před 7 měsíci

      yess it is a library only for 2D and that os on purpose. For more complicated things like collisions let's say it is impossible to give a general solution that fits anyone. So this library does only 2D and if you need physics you can use any other library thar you want or make your own 💪

  • @axorusmt7042
    @axorusmt7042 Před 7 měsíci

    good video. i personally use xmake instead of cmake, but i still found it easy to integrate your library!

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před 7 měsíci +1

      haven't heared of xmake but that's why I like header + source libraries they can be integrwted anywhere with ease 💪

    • @axorusmt7042
      @axorusmt7042 Před 7 měsíci

      @@lowlevelgamedev9330i quite like it because it it easier to configure than cmake, and comes with its own cross platform package manager

  • @lolcat69
    @lolcat69 Před 7 měsíci

    There is also a single header+source simple 2d graphics library for C and C++called tigr.h, I didn't made it but it is really good and you just import it, add some compiler flags and you have everything ready to code :)

  • @bluesillybeard
    @bluesillybeard Před 7 měsíci

    Will you be supporting other APIs like Vulkan or Metal? It would be interesting to see how you approach such a challenge.
    There are so many options, here are some ideas:
    - Just pretend the problem doesn't exist (this is somewhat what Raylib does, although they have some internal abstractions that could make porting easier)
    - Create an internal backend API, and the user chooses the right c++ file to link with the project for the backend (ImGui does this)
    - make an entirely new custom meta build system and a custom IDE just for that single library, and make the build system do the complex stuff while users are left trying to figure out just how all of it works(which is what Kinc does, to my confounding amazement)
    - use polymorphism to have multiple implementations of the same API, and the correct one is chosen at runtime (I am not aware of a popular library that does this)
    - Ignore the concept of a rendering API and just give the user a big list of objects to draw (Nuklear's solution if I'm not mistaken)

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před 7 měsíci

      well rn I don't know vulkan but if I ever want to port the library to Vulkan that is very easy, only the flush clear screen load texture and create fbos commands had opengl calls so all I need to do is to remake only those and that's it. I know that some people like to use polimorphism and stuff but I just hate that idea. For one in this case it is just esier to wtire the implememtation twice since it is very small. And 2 why use polimorphism for something known at compile time, you won't change the rendering api mid program lol.

    • @bluesillybeard
      @bluesillybeard Před 7 měsíci

      @@lowlevelgamedev9330 The reason for doing it at runtime is so a single executable can support many APIs, but doing it at compile time is also good.

  • @Finding_Fortune
    @Finding_Fortune Před 7 měsíci +1

    Nice! My only question, is can the library handle mouse clicks on rectangles after they are drawn to make buttons or similar? Would also be helpful if you wanted to make a game like Terraria where you can edit blocks

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před 7 měsíci +2

      the library does only drawing so you can use it with any window library. There is a function to allow you to convert the mouse position into the camera's view, if you need help you can ask me on discord 💪

    • @smokinglife8980
      @smokinglife8980 Před 7 měsíci +1

      No but it's not that hard

  • @adonigarcia1651
    @adonigarcia1651 Před 7 měsíci +1

    Good Video, so if i create a game using sdl and opengl, can i upload that game file on steam or i have to make the game with the windows api?

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před 7 měsíci +1

      Yes Steam doesn't care, actually there are many games made with sdl. Also any window library that you use on windows lile sdl glfw or sfml will use windows api in the end to make the window, ther's no way around it

  • @cyanuranus6456
    @cyanuranus6456 Před 6 měsíci

    What 2D Graphics? Animation?

  • @user-wn4wk3gq3k
    @user-wn4wk3gq3k Před 4 měsíci

    But how? How to make c++ UI library?

    • @lowlevelgamedev9330
      @lowlevelgamedev9330  Před 4 měsíci +1

      you need to learn opengl to draw stuff and than think about what ui things you want to achieve

    • @user-wn4wk3gq3k
      @user-wn4wk3gq3k Před 4 měsíci

      @@lowlevelgamedev9330 i know opengl, Thanks!

  • @catalin8446
    @catalin8446 Před 7 měsíci

    primu

  • @AdamNoone
    @AdamNoone Před 7 měsíci

    First but from nz lmao