You don't need libraries to write a game engine in C++ | OpenGL | Devlog

Sdílet
Vložit

Komentáře • 210

  • @MrAmix2
    @MrAmix2 Před 9 měsíci +255

    Playful remark about the title: "you don't need libraries, but use OpenGL, Open Graphics LIBRARY". It's in the name 😆

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

      Yeah the name is misleading OpenGL is not really a library

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

      ​@@tlgaming6725what is it and what is the difference to a library?

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

      ​@@somename5632opengl despite its name is in fact something called graphics api. Set of functions that are running on the gpu. We can use opengl drivers on our graphic cards to render things onto a window for example

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

      I really expected him to write to /dev/fb0 or something crazy like that

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

      ​@@somename5632OpenGL is and API standard, which graphics card vendors implement. This is, so your graphics code can work on graphics cards manufactured from a wide range of vendors, rather than having to write different code for every different kind of card. The OS usually helps you by providing some kind of standard OpenGL header with function pointers to the functions implementation of the graphics card in the PC, so in that sense it is a little bit like a library, but in essence it is not.

  • @phee3D
    @phee3D Před 5 měsíci +56

    Here's my current take on this subject: If you're building an engine specifically to build actual projects or to learn about a specific feature, then just use existing open source implementations for rest of the features you're not interested in or focused on and write a thin API around them for your application to use. These libraries can be replaced with your own implementation if required in the future, I've seen many companies do this like valve and roblox. As an example:
    I'm interested in learning about entity component systems and I want to write a simple C based engine that utilizes such a system. In this case, I would simply use SDL to handle sound, input and windowing to quickly get started and possibly even a rendering library for visualization. I would then build the ECS system myself since that's what my engine is focused on. Later I can swap out the rendering library with my own renderer, but only if required.
    The point of saying all this, not as a response to your video necessarily, is people shouldn't worry too much about using existing libraries. They can be swapped out whenever required, focus on what you want to focus on for now. Chances are existing libraries will fulfil your requirements.

  • @martinchya2546
    @martinchya2546 Před 6 měsíci +29

    I live all of these "you dont need xxx to create game" videos. Like literally, every single video tries to proof that you can roll your own engine and as proof they show empty scene with one colored cube at the end. No it is not "game engine". You don't have input system, multiple rendering pipelines, multiple platforms, audio mixer, netplay, entity managment, shaders, particle systems, physics, component systems, pbr materials, terrain system, level editing tools, animations, ui, scripting systems, lighting systems, ai, navigation, scene graph, (....) I can do it all the day.
    Of course, I encourage everyone to try making simple 3d stuff by themeselves, its great fun and you can learn a lot with that in terms of low level programming.
    But please stop with those "you dont need game engine" videos already..

    • @cheerwizard21
      @cheerwizard21 Před 6 měsíci +6

      Fun fact, author of video didn't actually mention any argument of "why you should not use any libraries for game engine". If you are making a clickbait title for video, you should at least try to argue why it is good/bad.

  • @RodrigoSpacecpp
    @RodrigoSpacecpp Před 6 měsíci +9

    You have courage. I also made a game library for myself using several small libraries and it still demanded a ton of work and study.

  • @GlorytoTheMany
    @GlorytoTheMany Před 8 měsíci +83

    I understand why it seems appealing, but now you depend on the Windows API which is even worse in the long run. It makes your game much less portable to other OS-es. Even if you don't want to depend on an existing game engine, you could use a cross-platform library like SDL which is low-level enough to give you great control, but still portable.

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

      You abstract the game logic from the Windows API so it's portable. This is the main problem I had using Unity and Unreal is that it entangles you unless you think very carefully about your code being abstract.

    • @trex511ft
      @trex511ft Před 6 měsíci +3

      SDL sounds reasonable.

    • @victorthevictor1976
      @victorthevictor1976 Před 5 měsíci +1

      SDL could do the job, but the WinAPI is pretty good. Not to mention Wine can be used on Unix systems

    • @GlorytoTheMany
      @GlorytoTheMany Před 5 měsíci +3

      @@rytif I was thinking about Linux specifically, but there are also a great number of Mac fans out there. @victorthevictor1976 Banking on "Unix-like users will just use Wine" is not the right way of thinking. Wine should be considered as a last resort when there are no alternatives available. Games always have alternatives: other games. Though I think you can still go cross-platform later, if needed, just make sure to separate your system calls to distinct modules.

    • @Zex-4729
      @Zex-4729 Před 5 měsíci +1

      @@rytif IOS Android MACOS WEB Steam Deck(Linux, still better to have native support than using Proton), and Windows is slowly losing popularity. It's also potentially future proof for new platforms, but it's a maybe.

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

    i think you predicted the future! good video!

  • @TheMacaroniGun
    @TheMacaroniGun Před 9 měsíci +28

    Now make it work for x11 and macos... kidding! You're awesome!

  • @ianbryant
    @ianbryant Před 9 měsíci +30

    Agreed. I feel like it was hidden from me for a long time that Windows already gives you everything you need to make a game. They have image loaders, they have 3d apis, they even have 3d audio.

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

      I mean that's fair enough, but what if you want to make your game cross-platform? Then you'd have to deal with every platform's different APIs.

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

      @@vesk4000You do anyway if you want to have a toolset that can port to consoles, but better thing to do is abstract the game logic from the renderer, so that you can just change the code in your functions according to the renderer. You can just start with using GDI if you wanted to, then later implement OpenGL, Vulkan or Direct3D.

    • @MisterZig0
      @MisterZig0 Před 6 měsíci +3

      or just use something simple that's cross platform and doesn't require windows... please,

    • @qqshutup7175
      @qqshutup7175 Před 6 měsíci +4

      @@MisterZig0 to provide a game for 2 people on linux, great advice for a beginner... dealing with problems on 3 different OS's

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

      ​@@qqshutup7175I mean I'd rather have the extra feedback and it's not like SDL or similar are bad.

  • @SleepingFumos
    @SleepingFumos Před 9 měsíci +9

    i made my own 2D game framework using OpenTK and i learned a lot about modern graphics rendering (textures, vertex specification, GLSL, matrices, etc).
    i have never learned so much from a single project, but it was also the most painful 6 months of my life.
    also wrote a 3D model loader for AutoDesk but i gave up on learning more about 3D after that (lighting, collision, camera).
    what did you use for audio when you made your engine using OpenTK?

  • @compilererror2836
    @compilererror2836 Před měsícem +11

    "you don't need libraries"
    my brother in christ, windows.h
    all jokes aside though this is very impressive

    • @Kawa-oneechan
      @Kawa-oneechan Před měsícem

      My brother in Christ, "opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;shell32.lib;"
      What does ".lib" stand for again?

    • @TU7OV
      @TU7OV Před 27 dny +2

      That's not a library.

    • @compilererror2836
      @compilererror2836 Před 12 dny

      @@TU7OV I mean yeah it’s *technically* not a library but it is a header file you include that provides functions, typedefs and structs (exactly what libraries do except it’s for interfacing with the OS). I think that’s close enough for you to not be *that guy* on a comment with 10 likes.

    • @LamantinoElettronico
      @LamantinoElettronico Před 8 dny

      The title is imprecise as what he meant is "libraries outside of OS functionality" which as you said is still awesomely impressive as the OS doesn't give you much at all in the way of writing a game. I wouldn't know how to do this myself without at least SDL2 and GLFW

    • @etodemerzel2627
      @etodemerzel2627 Před 5 dny +1

      Yeah, go all the way in and write your own OS.

  • @grevel1376
    @grevel1376 Před 9 měsíci +20

    Well, OpenGL is a library. It even has the word in its name.

    • @K3dev
      @K3dev Před 9 měsíci +4

      OpenGL is not a library, is an API, it just have "graphics library" in the name because is an open version of IRIS GL, and they did keep the GL in the name, when IRIS GL became open source they named it OpenGL.

    • @AlFredo-sx2yy
      @AlFredo-sx2yy Před 9 měsíci

      OpenGL is a crossplatform standard for graphics. Thats all it is. There is no "OpenGL library code" that is written by the OpenGL creators. They jus say "hey, this is how things should be", and then each vendor implements their part so that everyone can write graphics programs with a common interface. Thats why its an API. If you want, you could manually find a way to interface in different platforms with different graphics cards and use their specific machine languages for their architecture specific instructions. We could also make computers out of sand and stop buying them. The purpose of OpenGL is to prevent having to program a different program for both the main application and for the runtime compiled shaders for each and every single different GPU that exists in the world. If we lived in the simpler times when your OS did not take control over its resources like it does nowadays, and when graphics cards were not a thing, then we could all write our own software renderer and we would actually be doing all the legwork ourselves. But... since we have an operating system that takes control of our resources and doesnt allow us to directly write to memory wherever we want, we cant make our own software renderer that runs on the CPU, we'd have to rely on OS specific drawing commands at some point... and nowadays with all the graphics cards that exist, yeah, im sorry but we're FORCED to used APIs because we live in a world of standards where you cant even do things by hand anymore. Thats why all the people who write software renderers these days always make them export to image files rather than displaying them on the screen. But hey, if you want to write machine code for every single GPU out there, you're free to do it.

    • @michaelzomsuv3631
      @michaelzomsuv3631 Před 9 měsíci +8

      @@K3dev I'll give him OpenGL. But I better not see him use the "standard library" anywhere. 😛

    • @heliusuniverse7460
      @heliusuniverse7460 Před 9 měsíci +4

      @@K3dev he's using an implementation of OpenGL as a library

    • @K3dev
      @K3dev Před 9 měsíci +4

      @@heliusuniverse7460 he is not choosing the implementation, that's why he needs to use wglgetprocaddress, because he is just using the API and Windows is getting the implementation from the gpu drivers, if you want to blame someone, blame the OS or the Gpu manufacturer for using the OpenGL implementation as a library and not as executing the opengl functions directly. If he was in mac he would be calling OS internal functions instead (using the same API)

  • @joelincz8314
    @joelincz8314 Před 9 měsíci

    very cool!

  • @rodrigofernandes6449
    @rodrigofernandes6449 Před 9 měsíci +8

    You also dont need condoms to have sex but they are useful

  • @codedeus
    @codedeus Před 5 měsíci +2

    I agree using an existing close engine is fairly limiting.

  • @LateCodeParty
    @LateCodeParty Před 9 měsíci +4

    I don't know if it is my eyes or my monitor but when you move object in your game I believe I can see interlacing between frames. Was it intentional or a side effect of something ? This looks great btw.

    • @The_Simplest_Game
      @The_Simplest_Game  Před 9 měsíci +5

      Thanks :) The interlacing is a side effect of the video. I'm going to look into that for the next one.

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

      @@The_Simplest_Game Not sure which video editor you're using but usually there's a list of output resolutions when exporting and 1080i for instance is 1080 interlaced as opposed to 1080p which is not.

  • @ProdByTenshi
    @ProdByTenshi Před 9 měsíci +1

    Sehr Interessant

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

    The only reason I want to make a engine is to flex, and learn from it.

  • @rizalardiansyah4486
    @rizalardiansyah4486 Před 9 měsíci +3

    Are you going to make a tutorial series on doing that? I'm currently kinda stuck moving on from the basic tutorial (console program and stuff) to the more advanced stuff like making GUI and using libraries. I don't even know how to make an installer for my finished programs...

    • @The_Simplest_Game
      @The_Simplest_Game  Před 9 měsíci +3

      I’m probably not going to make a full on tutorial series about this, but I’m considering going into more detail in some of these aspects. I have written a small immediate mode gui system and want to show that in the future, but that still requires some more work.

    • @rizalardiansyah4486
      @rizalardiansyah4486 Před 9 měsíci

      @@The_Simplest_Game Interesting! Looking forward to that!

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

      I recommend watching the Cherno, victor gordon, or ogldev while waiting. They have good c++ and OpenGL videos. It might be slow at first but there’s a lot to understand before making more complicated graphics things from scratch if that’s what you want to learn.

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

      ​@@The_Simplest_Gamedefinitely interested in a tutorial series. I have been learning C++ Win32 API graphics programming only utilizing WinGDI so far, so I understood alotta the code, despite never having used openGL. what resources did you use to learn how to do all of this btw?

  • @mugiseyebrows
    @mugiseyebrows Před 2 měsíci

    Writing your own tool is educational, leveraging existing tool is productive.

  • @atomictraveller
    @atomictraveller Před 6 měsíci +2

    done the same, just finished rigging my puppet, entirely in c/c++ win32, no blender, took 12 weeks to design it myself.
    but faster next time. and all my rotations are euler angles. :) and my entire game app is like 700kb haha.

  • @jakub3840
    @jakub3840 Před 9 měsíci +1

    That's really cool! Check your video export settings though, that interlacing is really annoying.

  • @powdered_bread
    @powdered_bread Před 9 měsíci

    right now I'm trying to load jpgs/pngs. its too bad .bmp is the only file you can load by default.
    understanding libraries is a nightmare .

  • @beeverfeever4930
    @beeverfeever4930 Před 9 měsíci +5

    Just wondering if you were going to release it as open source? I'd love to have a look at what you've done as I'm trying to do the exact same thing right now.

    • @The_Simplest_Game
      @The_Simplest_Game  Před 9 měsíci +4

      I don't have plans for that at the moment, but almost all code should be visible in the video.

    • @372leonard
      @372leonard Před 9 měsíci

      ​@@The_Simplest_Game would have been a lot easier if we could just copy from github instead having to copy everything line by line. this is just mean.

    • @aknkrstozkn
      @aknkrstozkn Před 8 měsíci +1

      @@The_Simplest_Game If you are not gonna sell it, you should make it open source. Free software and open source developer mindset is a good thing not just for other but especially for you to grow and learn more.

  • @v8metal
    @v8metal Před 9 měsíci

    super cool

  • @ucru
    @ucru Před 9 měsíci +2

    I made a 2D Game Engine in DirectX 11/OpenGL and W32. When porting it to MacOS, I couldn't be bothered to learn objective c or metal so I just used SDL 😂😂😂

  • @guilhermerodrigues4853
    @guilhermerodrigues4853 Před 5 měsíci +1

    Is there a link to the source code? I would like to see how you initialize OpenGL context on windows

  • @-wokhead
    @-wokhead Před 8 měsíci +4

    Isnt opengl a library too? I thought you were even going to write that from scratch haha

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

      OpenGL is not a library, it's a specification. If you're using only OpenGL you need to write all the code that implements OpenGL yourself.
      The actual libraries that do that for you are stuff like glut or glfw3, those are libraries that meet the OpenGL specifications.

    • @Zex-4729
      @Zex-4729 Před 5 měsíci +2

      @@insentia8424 You are wrong! glut and glfw are on top of openGL and are just extra tools for creating windows and handling inputs. OpenGL itself is implemented with Mesa 3D library on Unix like OSes, not sure about how Windows implements it.

  • @GuilhermeTeres
    @GuilhermeTeres Před 9 měsíci +15

    Nice! Also, well done by not using something like SDL, but handling the OS stuff yourself. I started doing that after working in the industry and it's really cool. :)

    • @leeoiou7295
      @leeoiou7295 Před 9 měsíci

      what are the disadvantages of using SDL?

    • @AlFredo-sx2yy
      @AlFredo-sx2yy Před 9 měsíci +8

      @@leeoiou7295 well, there are no inherent disadvantages to SDL, its just that not using something like SDL means that if you want to port your program to a different platform, you'll need to do all of the platform specific implementation by hand, meaning you will have more control and understand better how a certain platform works, as well as having to actually do things for yourself. For example, if you want to create a window in Windows, you do it one way, but if you want to do it in a Linux distro you have to do it in another way, which means that you'll have to create your own abstractions or ways to select what piece of platform specific code to use when compiling for different targets. Which is what SDL does under the hood for you.

    • @superduper6090
      @superduper6090 Před 9 měsíci

      @@AlFredo-sx2yynah thats bs. SDL is a great library that abstracts logic that you as a programmer dont need to know.

    • @AlFredo-sx2yy
      @AlFredo-sx2yy Před 9 měsíci +7

      @@superduper6090 what? i never said that SLD is bad. I said that there is no disadvantage to SDL lmao. Read my comment carefully, cause what i explain is the reason why using SDL is GOOD.

    • @tiranobanderas5655
      @tiranobanderas5655 Před 9 měsíci +10

      @@superduper6090 I dont understand why people like you feel the need to pick a fight with people who are literally agreeing with you.

  • @fffernankortes9333
    @fffernankortes9333 Před 5 měsíci +1

    cool! also wanted to ask , how did you implement the field reset animation in pong? tried to recreate it, but got stuck

    • @The_Simplest_Game
      @The_Simplest_Game  Před 5 měsíci

      This is the main function in the fragment shader. Hope it helps :)
      float widthScale = u_resolution.x / TargetResolution.x;
      float heightScale = u_resolution.y / TargetResolution.y;
      float scale = max(widthScale, heightScale);
      vec2 resolution = u_resolution / scale;
      vec2 uv = UV * resolution;
      vec2 origin = u_origin * resolution;
      vec2 middle = vec2(0.5) * resolution;
      float distanceOrigin = distance(uv, origin);
      float distanceMiddle = distance(uv, middle);
      Color = u_time < 1.2
      ? distanceOrigin < u_time * 2500.0 ? OverlayColor : u_color
      : distanceMiddle < (u_time - 1.2) * 2500.0 ? u_color : OverlayColor;

  • @jamesscotti9210
    @jamesscotti9210 Před 8 měsíci +3

    Do it without openGl

  • @Raffa064
    @Raffa064 Před 6 měsíci +2

    open gl is a library

  • @bradocksolo
    @bradocksolo Před 4 měsíci

    This is cool! It would be nice to have access to a github with just the Win32 and OpenGL integration.

  • @bannanafruitsalad
    @bannanafruitsalad Před 8 měsíci +8

    You should try vulkan! It's not *that* much harder but the granularity you get is awesome when trying to build for low powered hardware

    • @PyXiion
      @PyXiion Před 6 měsíci +12

      "not much harder" 💀

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

      Yeah not that much harder but the enormous amount of lines and concepts to master to get more than a simple triangle can be very daunting

    • @GregoryTheGr8ster
      @GregoryTheGr8ster Před 5 měsíci

      I still have not delved into Vulkan. What is wrong with me?

  • @MrCloudage
    @MrCloudage Před 26 dny

    Excuse me, may I ask why you chose to stick with OpenGL instead of opting for Vulkan? Are there any particular reasons or special considerations?

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

    But C++ uses libraries by default...

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

      He's talking about graphic libraries no?

    • @pedroduran8927
      @pedroduran8927 Před 6 měsíci +1

      He's talking about stuff like SDL

    • @RoboGameOfficial
      @RoboGameOfficial Před 3 měsíci

      Libraries like GLFW implement Win32 in the backend and fill it up with extra glitter and sparkles to make it very easy to get going, whereas this guy is writing everything from scratch with no pre-made libraries.

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

    Youre always gonna be dependent on someone...Operating Systems, Hardware Manufacturers, User Demand. No matter what you do in life youre always gonna be dependent on someone, because thats how a society works. So avoiding all and any dependencies is not gonna work. But Id still agree that carefully selecting your dependencies is the best course of action.

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

      I agree to a point, but these engines really rope new game developers into becoming entangled and dependent, mainly on their animators. Animation though can be done with shaders, so you actually don't have to make use of Unity's tools, for example, you can just make a single Unity scene, single game object in that scene, single script as an entry point, then just have everything created procedurally, and create your own game object and scene format. Put all the code in a 'Src' folder, then, if it needs to be ported to Unreal engine later, what one could do is just use Chat GPT 3.5 turbo or something to convert it, touch it up, and then work on porting from there.

    • @screencancer4732
      @screencancer4732 Před 6 měsíci +1

      make your own os/computer. easy fix

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

      ​​@@screencancer4732😂😂u will rely on parts and if u dont you will rely on material, if you dont you will...

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

      yes, but every person i'm dependent on doesn't know qi jiguang. or julius orion smith III. all must be removed.
      people are stupid. people are stupid. i went to school for gifted kids decades ago, you know what? we are more intelligent. people suck. especially microsoft (rofl "microsoft")

  • @Dom-zy1qy
    @Dom-zy1qy Před 6 měsíci +6

    If you really wanted to make a game without using any "libraries", youd have to make your own hardware entirely. (Depending on your definition of what is considered a library)
    But yeah i dont really consider opengl to be a library, i consider low level abstractions not to be libraries in a sense, (how low level something must be to not be considered a library is my arbitrary opinion) relative to other libraries. Though it does the same thing most libraries do; load procedures that allow you to interface with hardware in an abstract way.
    Not that it really matters, its just cool how the tools we use are the culmination of sometimes hundreds of years of research.

  • @ShatabdaRoy115
    @ShatabdaRoy115 Před 9 měsíci

    do you have like a discord server?

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

    I once started coding a game engine but got really stuck on shaders.

  • @B_dev
    @B_dev Před 13 dny +1

    well sure you could be a carpenter starting with no tools but you gotta be sure you want to

    • @Luluskuy
      @Luluskuy Před 2 dny

      This is brilliant analogy, lol

  • @muggzzzzz
    @muggzzzzz Před 9 měsíci +3

    What's the point of this video?
    You don't give a link to a source code, and you're not gonna make a tutorial.

  • @threecolor3010
    @threecolor3010 Před 2 měsíci

    You have a nice voice!

  • @Zex-4729
    @Zex-4729 Před 5 měsíci +1

    If you really want to use no library, you have to write your own OS and build tool for that OS and your own driver for god knows how many devices you would like to support. Good luck with that.
    I actually encourage starters to use 3rd party libraries, since libraries themselves are required to be learned as well.
    But of course you should eventually learn how to code for specific OS too, though it's optional kinda.

    • @ADarnSmore
      @ADarnSmore Před 5 měsíci +4

      not manufacturing your own pc from scratch by mining ore is just using a physical library

    • @nullpointer1288
      @nullpointer1288 Před 4 měsíci

      this doesn't make sense

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

      Bro this directx kid wont quit yappin smh you don't need to make an os, just a driver for no library and you arent a "starter" for using things like opengl when coding an engine

  • @tweetyguy7347
    @tweetyguy7347 Před 4 měsíci

    Why do you include a cpp file?

  • @2Fast4Youtube
    @2Fast4Youtube Před 8 měsíci +6

    B-but Open GL is a library :(

    • @samarthtandale9121
      @samarthtandale9121 Před 3 měsíci +1

      No, is just an API technically

    • @overchargedguy
      @overchargedguy Před 2 měsíci +1

      @@samarthtandale9121 its called open graphics LIBRARY

    • @__gadonk__
      @__gadonk__ Před měsícem

      @@samarthtandale9121 "technically" all libraries have APIs

  • @GregoryTheGr8ster
    @GregoryTheGr8ster Před 5 měsíci

    DIY FTW!

  • @itseems7173
    @itseems7173 Před 9 měsíci +1

    How to open a window and draw something in it using only std library?

    • @cheerwizard21
      @cheerwizard21 Před 9 měsíci

      Use OS specific apis. In case of Windows - WinAPI.
      And don't use STL at all. Or at least make a custom memory pools and allocators for STL. Just an advice.

    • @itseems7173
      @itseems7173 Před 9 měsíci

      @@cheerwizard21 thank you.

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

      @@cheerwizard21 any advice on how to make a simple 2D RPG game engine for instance, without utilizing the STL? I can hack together a game with WinGDI pretty easily, and would like to eliminate any unneeded overhead -- not that my simple pixel projects are even that resource intensive, I just would like to learn.

    • @cheerwizard21
      @cheerwizard21 Před 5 měsíci

      @@MrValsung 1. As I mentioned, just make memory pools (you can learn about that, just google). And then google how to add a custom allocator structure to STL container. Inside this structure allocate/deallocate methods - just use allocation calls to your own memory pools.
      2. If you want to completely eliminate STL, then check Molly Rocket (Casey Muratori) on that, he is doing everything from scratch and is not using STL as well.
      3. You need to learn how to build string, vector, hash table, linked list or tree (optional just in case). Do also some research and learn memory managment really well, so you can utilize your preallocated heap memory, big/small chunks of memory, CPU caches (L1, L2, L3), branch prediction inside loops.
      I personally always choose to customize STL memory allocations with memory pools, since I know STL pretty well and the only thing I really need to is to completely eliminate heap allocations from STL and replace it with getting memory chunks from preallocated heap in the beginning of program - which is thousands times faster than default STL :)

  • @AryaMewadaMusic
    @AryaMewadaMusic Před 9 měsíci +3

    are you Sebastian Lague ?

    • @anon1963
      @anon1963 Před 9 měsíci

      Probably the same country, hence the accent

    • @Ravuy
      @Ravuy Před 9 měsíci

      @@anon1963 sebastian is from denmark - he's from germany i think

    • @nolram
      @nolram Před měsícem

      @@RavuyI thought Sebastian was from Cape Town?

  • @dev_insights101
    @dev_insights101 Před 3 měsíci +1

    Not even using glfw is a bit excessive. Although its better for personal projects, it will give you headache in long run.

  • @KoltPenny
    @KoltPenny Před měsícem

    Why you say you don't need libraries then use OpenGL?

  • @coolmanthecool603
    @coolmanthecool603 Před 2 dny

    Now use vulkan, or no opengl

  • @kinershah464
    @kinershah464 Před 2 měsíci +1

    Yes, you should be able to directly access the video memory and write to it.
    But if your goal is to create a game, better to use existing libraries, helps in quick prototyping.

  • @kishirisu1268
    @kishirisu1268 Před 2 měsíci

    Sure, to make a game with moving cubes we dont need any library. Actually you dont need coding also, you can make same game with something like scratch lol

  • @ramorix
    @ramorix Před 4 měsíci

    Ce mec est francais 10000000000000000%

  • @starklosch
    @starklosch Před 5 měsíci

    I couldn't avoid to notice you're #including cpp files. Why? We normally include .h files only with declarations and let the implementations in .cpp files. That way you don't get duplicated symbol errors.

    • @GregoryTheGr8ster
      @GregoryTheGr8ster Před 5 měsíci

      Amen. Including cpp files should be done only for inline functions.

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

    but why write everything yourself? learning to use well written libraries will save you time and hopefully free you from solving problems thats already been solved.

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

      learning what libraries are doing under the hood is extremely valuable

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

      @@flamingowrangler...but he does have a point, it's great to put something like this on a resume, but the problem that crops up for me, is that we developers need to attend streams and be where the players are more and serve them if we're making games, rather than just serve our own self interests. That's a huuuge lesson I've learned over a long period of time. There's a tendency to stay in the comfort zone where the other artists, developers, etc... are, and it removes us from connecting with the people we're trying to make stuff for. What the players seem to be looking for, is running around a semi-open world with good character driven stories and beautiful visually appealing worlds they can explore around, at least from the streams I've watched and the players I've connected with... So just going where the players are for the games that you loved when you were growing up, and making a prototype for them, and doing it minimum viable product, you would tend to want to use whatever tool you're well versed in and is fastest and easiest.

    • @tiranito2834
      @tiranito2834 Před 6 měsíci +2

      @@astrahcat1212 who do you think has a higher chance of being hired, a guy with a portfolio where they made a game engine and a game in it, or a guy that made an assetflip in unity?

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

      ​@@astrahcat1212Sure, but down the line you will want to write shaders to make your game more unique, improve performance, etc. and understanding how things work under the hood helps there. You may even reach a point where a game engine just doesn't support something that you want to do, at which point you can either try to add it to an open source engine, or make your own.
      Also, it's fun.

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

      @@widgitymaking your own engine just for one feature is completely deranged. You would just end up with slow, clunky garbage with weird api but at least it has that one fucking feature. Writing an engine is a commitment which takes years to turn it into something usable and at this point you aren’t a game dev, you are an engine dev. It is just as dumb as creating your own cpu when you can’t find one instruction that you need.

  • @lLenn2
    @lLenn2 Před měsícem

    Let's be real. You do if you want to actually make something good.

  • @dawidbujak
    @dawidbujak Před 2 měsíci

    Hello, I want to create MMO RPG. Will your engine be sufficient for this?

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

    oh boi he runs windows lmao
    wait until you need to port to embedded devices/android/linux. those lovely Macroshaft exclusive APIs are gonna be sweet to deal with.

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

      With a little forethought it's really not that bad, add a layer of indirection so you call your own function that calls the windows api, then when you're ready to make it crossplatform, you replace the windows api call with the new one. You should do this anyways even if you're using a window library in case you want to swap to a different one or add support for a platform that the library doesn't support (e.g. Android when you're using GLFW). Generally you want to avoid coupling your main engine code to the window library.

  • @wokeupinthefuture
    @wokeupinthefuture Před 9 měsíci

    why tho

  • @butjok
    @butjok Před 5 měsíci +2

    Dude, a cube renderer is not a game.

  • @eestela42
    @eestela42 Před 2 měsíci

    Open Graphic Lib...

  • @AetherSerenity
    @AetherSerenity Před 2 měsíci

    am i the only one or does he talk like sebastian league?

  • @arielgimenez_95
    @arielgimenez_95 Před 9 měsíci

    XD

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

    "you don't need libraries to write a game engine in c++"
    >proceeds to use opengl (open graphics library)
    🤦🤦🤦🤦🤦🤦🤦🤦🤦

    • @colleagueriley860
      @colleagueriley860 Před 2 měsíci

      You have to use a library at some point. It’s just not an external library

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

      @@colleagueriley860 define external

  • @ExodiumTM
    @ExodiumTM Před 13 dny

    Rendering a cube with a pure black shadow isn't even remotely close to a game engine, at all. Also, how is Open Graphics LIBRARY not a library? Just code in assembly

  • @cheer7731
    @cheer7731 Před 2 měsíci +1

    you are using a graphics lib. Your title does not really make sense

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

    .

  • @till8413
    @till8413 Před 24 dny

    ich sehe einen deutschen akzent, wenn ich ihn sehe!😂

  • @dongyoblee2668
    @dongyoblee2668 Před měsícem

    You are not transparent either. Skip

  • @cheerwizard21
    @cheerwizard21 Před 9 měsíci +2

    It depends on your deadline requirements.
    But overall, it's only useful for educational purpose.
    If you are not sure that some other libraries are stable and fast enough, it means that you have never used them and you have no clue how they work.
    If you want to support some unknown console hardware or very old hardware that may not suite library requitements - than YES, you are forced to write a hardware specific implementation.
    BUT, if your goal is to make an engine for Windows, than its just a huge waste of time. Because making a decent 3D engine by itself will require lots of architecture decisions and implementations.

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

      For simpler games it might be okay, and C++ is more portable and used across the consoles. A 3D engine that would make the next Fortnite or something, I see what you mean.

    • @cheerwizard21
      @cheerwizard21 Před 5 měsíci

      @@astrahcat1212 For simpler games some people are not even creating game engines. Or if they create one, they really try to make it quite fast and definetely don't waste time on rewriting GLFW or SDL or anything else that's stable and fast enough.
      What's the point of not using simple and fast GLFW? Why writing 500 lines of code to setup a window with input events? What if you will add a support in future for Linux and you will need to play with X11 or other Linux window API and write ~300 lines of code to make trivial things - window with input events?
      That's not even considerable, that's always huge waste of time. In real world games, I was using internal company game engine, where they were using around 20-30 libraries and for such trivial things like windowing, input events - they were simply using SDL and that's it.

  • @Jan-ichigatsu
    @Jan-ichigatsu Před 9 měsíci +3

    Don't use this if you solely wanna make games just use engines.
    This is cool and all but if you want to make actual games then you'll not be able to achieve everything you'd use along the way with game engines even if you did it'd just take tremendous amount of time.
    I also made 2d engines and they sucked so I just do premade engines now.

  • @ZAcharyIndy
    @ZAcharyIndy Před 9 měsíci +4

    Nope.
    Complex game requires solid game engine

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

      Complex games require optimized and specific engines.

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

      don't be lazy bum tho

  • @lucasmontec
    @lucasmontec Před 9 měsíci +1

    You don't need c++ at all

    • @IBelieveInCode
      @IBelieveInCode Před 9 měsíci +5

      Good old C is better. Is that what you mean ?

    • @evilwizardtherapist
      @evilwizardtherapist Před 9 měsíci +1

      Troll

    • @lucasmontec
      @lucasmontec Před 9 měsíci +1

      @@evilwizardtherapist actually, yeah. XD

    • @fders938
      @fders938 Před 9 měsíci +4

      Assemble CPU machine code by hand.

    • @Eliasdbr
      @Eliasdbr Před 8 měsíci +3

      Just open a hex editor and start typing the numbers😂