i swear, c++ is the only language where i've spent more time trying to understand how to get external libraries to work than actually learning the language this is just ridiculous
@@SKCCSA12UCS055 same broooo. seriously super annoying. I am thinking of quitting programming. Just hate linking stuff. Other languages may be easier but still it's annoying.
I am currently using your sdl2 with opengl template and what you said happened in my case. I went straight away to coding and learning opengl without having to worry about the setup. Thank you for the help.
It took some doing, but I eventually got linking to work with Code Blocks and saved my project as a custom template. When creating a new project, I copy the SFML DLLs into the new debug and release folders.
This is very interesting though I am hoping to learning vulken and C++, would like to learn that one as I have been told its quite hard and I am a always taking the hard route
One time I tried using raylib's template in VSCode It worked fine for one file in a specific directory, but add multiple files and subdirectories and it for some reason wasn't compiling, also I had to copy the entire thing for each project Ended up learning how the compiler works, how to link libraries, and creating my own Makefile
When I tried this out with raylib I wasn't able to load textuures with the resource path macro (texture = LoadTexture(RESOURCE_PATH "path/to/texture.png");
Game development generally requires some OOP being present. For example for entity system. You have a class entity, and when you want to make new entity types, you just extend the class and write inheritance style code. In C you would do something like struct { void update(entity_data_t *data); } and then for each entity type you would need a method like pig_update(), cow_update() which will get annoying really quickly, because you would need to manually specify the methods. Then you would either keep doing it with lots and lots of repetitive code thus making a room for errors and an absolute nightmare to refactor if you decide to change something, or you will end up writing the same exact abstractions which C++ offers out of the box, and then you would debug these abstractions. So just go with C++, and if you’re afraid that your code will look very scary, just write C-like code, C++ is the superset of C in the end of the day and this guy already has video on it.
yo so I will make a tutorial at some point, untill than, the setups there all are statically linked. There are some flags in the main cmake file at the begining, you can take a look there 💪
I do use cmd and write a batchfile, I even reverse engineer the build system of my dependencies and convert them to cmd. (E. g. Building raylib is easy, you just have to add 6 C to your compile line, define the desktop platfrom and you are good to go) In general, I prefer header only libraries so I have to do as little work as possible. (BTW, if I don't use raylib and want something like opengl, I use the header only Sokol libraries (they are a cross-platform abstraction across different graphics backends, like Metal, DirectX, OpenGL, WebGL, WebGPU) and get something more portable than opengl with less build system struggle (building GLFW requires cmake by default, I mean building it with cmake works, but I do not like building it).
OpenGL is good for the beginning, but for more ambitious projects that should run well on modern GPUs, Vulkan or DirectX would be preferred. Can you add setups, that include those as well? For DirectX, maybe both DirectX 11 and 12. I know DirectX 12 requires a lot more setup code, but it would be worth it.
ok, I will add opengl to sfml, but I recomand glfw instead of sdl, also I also did sfml with opengl and it is kinda wierd, you might have some problems, because opengl has global state sfml will interfere with your opengl. (I had some problems and the fix was to call glDisableVertexAttrib() for attributes 0 to 8 or something like that
@@lowlevelgamedev9330 it's okay, you don't need to change anything, just thought you should know, but if you do change then just add the caveat you just added here that it might not be 100% from your experience
I will consider that, untill than, you should be able to generate a codeblocks project with cmake, install cmake and to the steps that I showed, it should vreate a codeblocks project, or search online how to generate a codeblocks project using cmake, it should be easy
@@lowlevelgamedev9330 i was talking about no open gl sdl version. i see with sdl2, you used stb img and stb truetype instead of sdl_image and sdl_ttf which feels like the more obvious choices. i wondered why. i didnt word my comment properly
I get it but if your properly know how to use the compiler and link libs it shouldn’t be a big problem anymore. It’s part of C++ to know how to link libs properly other wise you should find an easier programming language or learn how to use the compiler in my opinion we already have it way too easy.
that is true, but for a biginner that is not really something fun to learn, I'm not against learning them, people have to learn them but I think they have to learn them later because they are more advanced and less interesting
The language and the api’s are indeed more important than learning how to use the compiler, but it shouldn’t be that hard to learn if you have a good learning source
That should work fine for me. In the future, I don’t think it will be possible to run unsigned applications on Mac anyway. Thanks for these cmake files :)
Can anybody point me to some free resources where they teach you game dev from scratch including programming, memory, methods, everything. Edit: Even a exhaustive list which contains all the subjects needed for game dev should help.
yo I have exactly this on my discord, (link in the description of my videos) I have some read only channels where I only post great free resources, check them out 💪
Did you know about meson? You just add dependency in config (one line) and then it will link it for you. If you don't have it installed on system it has source based package manager called wrapdb where you just type meson wrap install sdl2 and you have it builded by your compiler
Personally, I found it easier to "fight Rust's borrow-checker" than to build and link C/C++ with third-party libraries. I was almost happy with Make scripts while I was doing small C projects. But that was only on Linux, on Windows it's bad even with MSYS2. And CMake... For me it looks like trying Haskell for the first time without knowing that languages can be procedural or functional. My brain refuses to even try to understand CMake.
@@hoanglam649 1. The comment you answered to mentions CMake, not just Make. CMake(1) is a tool for building scripts (not only for Make), and Make is a rool for running the specific generated scripts. 2. Make(1) is widely used in Linux, most distros havs it in some "dev" / "devel" packages (the ones with common tools for building stuff) but just installing "make" (search the package name for your distro) is enough to have Make installed and be able to run Make scripts. To run Make script, often called Makefile (handwritten or generated one, doesn't matter), you need to execute "make" in the directory with Makefile.
i swear, c++ is the only language where i've spent more time trying to understand how to get external libraries to work than actually learning the language
this is just ridiculous
same here dude
@@SKCCSA12UCS055 same broooo. seriously super annoying. I am thinking of quitting programming. Just hate linking stuff. Other languages may be easier but still it's annoying.
Whoever does c++ with opengls and making their own game engine is a certified wizard
how about c...
Heh, I probably should switch to C++, I've been using OpenGL with Java.
wanna join? 🧙♂️
yes, I would recomand to 💪
how about vulkan...
I am currently using your sdl2 with opengl template and what you said happened in my case. I went straight away to coding and learning opengl without having to worry about the setup. Thank you for the help.
nice 💪 please let me know if you have any problems so I can make it better
Thanks for the great video. I'm a non-native English speaker and to me you sound like Khajiit from Skyrim. I love your videos!
you are a legend for doing this thank you
cmake's target_link_libraries goes brrr
It took some doing, but I eventually got linking to work with Code Blocks and saved my project as a custom template. When creating a new project, I copy the SFML DLLs into the new debug and release folders.
You're a hero
You should add the glut libraray! 👍👍😊😊, amazing video as always!!!
Too late, already spent my whole weekend trying to link libs and got it working 😱
my goat is cooking
This is very interesting though I am hoping to learning vulken and C++, would like to learn that one as I have been told its quite hard and I am a always taking the hard route
why dont any cpp compiler comes with cli tools to create and install pkg like modern languages
because C++ and C are good languages for giga chads and not noobs who don't even know what assembly is
@@UnrealCatDev so?
@@ulrich-tonmoy so why would it need an installer for libraries?
No one has ever needed it until now.
shit's hard to maintain while cross platforming I guess
Make a tutorial on Vulkan
One time I tried using raylib's template in VSCode
It worked fine for one file in a specific directory, but add multiple files and subdirectories and it for some reason wasn't compiling, also I had to copy the entire thing for each project
Ended up learning how the compiler works, how to link libraries, and creating my own Makefile
When I tried this out with raylib I wasn't able to load textuures with the resource path macro (texture = LoadTexture(RESOURCE_PATH "path/to/texture.png");
yoo, can you dm me on discord? I want to fix this problem for the setup.
Please make a video that helps people decide between C and C++ for game dev with open gl. Great content keep it up!
Game development generally requires some OOP being present. For example for entity system. You have a class entity, and when you want to make new entity types, you just extend the class and write inheritance style code. In C you would do something like struct { void update(entity_data_t *data); } and then for each entity type you would need a method like pig_update(), cow_update() which will get annoying really quickly, because you would need to manually specify the methods. Then you would either keep doing it with lots and lots of repetitive code thus making a room for errors and an absolute nightmare to refactor if you decide to change something, or you will end up writing the same exact abstractions which C++ offers out of the box, and then you would debug these abstractions. So just go with C++, and if you’re afraid that your code will look very scary, just write C-like code, C++ is the superset of C in the end of the day and this guy already has video on it.
I dont know if you hace heard of conan, which can download all the libraries in correct versions, generate cmake and provide all the headers correctly
BGFX template would be godsent tbh
its astonishingly simple when using gcc and make on arch
Why wasn't this video available at 2010... I could've avoided learning windows forms...
sorry bro :(( I also needed something like that so that's why I made it 💪💪 but better later than never,
I need a tutorial video on how to use Magnum c++ library, Please bro
Or you could just show us how to link libraries.
Or you could just google how to link a library
Precisely
Could you make a tutorial on how to create statically linked libraries on Windows? Like a static glew library you could link to with /MTd flag.
yo so I will make a tutorial at some point, untill than, the setups there all are statically linked. There are some flags in the main cmake file at the begining, you can take a look there 💪
Am I insane for using regular old Command shell instead of using Cmake? Yes, but I know it will work regardless
no, there are people that do, I also did, but cmake helps you link libraries and thats important
Yes, to not use Cmake, Make, and rawdogging it (cli only) i made my own build tool, it only kinda works tho
I do use cmd and write a batchfile, I even reverse engineer the build system of my dependencies and convert them to cmd. (E. g. Building raylib is easy, you just have to add 6 C to your compile line, define the desktop platfrom and you are good to go) In general, I prefer header only libraries so I have to do as little work as possible. (BTW, if I don't use raylib and want something like opengl, I use the header only Sokol libraries (they are a cross-platform abstraction across different graphics backends, like Metal, DirectX, OpenGL, WebGL, WebGPU) and get something more portable than opengl with less build system struggle (building GLFW requires cmake by default, I mean building it with cmake works, but I do not like building it).
Why Imgui is just for Debugging? It looks perfectly fine for release product too.
you can also do that, but you need to improve the visuals a bit, it's not really meant to make the in game ui, but you can
OpenGL is good for the beginning, but for more ambitious projects that should run well on modern GPUs, Vulkan or DirectX would be preferred. Can you add setups, that include those as well? For DirectX, maybe both DirectX 11 and 12. I know DirectX 12 requires a lot more setup code, but it would be worth it.
You can choose SLFM with opengl as well, it's more or less plug and play compared with SDL2
ok, I will add opengl to sfml, but I recomand glfw instead of sdl, also I also did sfml with opengl and it is kinda wierd, you might have some problems, because opengl has global state sfml will interfere with your opengl. (I had some problems and the fix was to call glDisableVertexAttrib() for attributes 0 to 8 or something like that
@@lowlevelgamedev9330 it's okay, you don't need to change anything, just thought you should know, but if you do change then just add the caveat you just added here that it might not be 100% from your experience
Can you make projects for CODEBLOCKS OR DEVC++ .as well ?
I will consider that, untill than, you should be able to generate a codeblocks project with cmake, install cmake and to the steps that I showed, it should vreate a codeblocks project, or search online how to generate a codeblocks project using cmake, it should be easy
unix systems make linking so easy
I am glad i am using Odin
I have done this so many times, I became an expert at it and still run into issues
ye me too 😭
Thanks sir. I'd really appreciate it if you could teach us how to add our own library into this later.
Nevermind, i got it
💪 glad you managed to do it, yes I will make tutorials like that, and I already have some small cmake tutorials 💪
Thnx
please Webgpu native library
You're really my sunshine
Just use Odin or Jai.
They have built-in Raylib, SDL, OpenGL, Vulkan, Metal, DirectX and so on.
Plus Jai compiles 100 faster than Cpp foor example.
or use bevy ecs with raylib
best simple setup
i like more sfml than those
Jai is a nonexistent language
why stb and not sdl for image and ttf
well because that is shown in lean opengl, and also idk if sdl imsge requiers sdl so that wouldn't make sense for glfw.
@@lowlevelgamedev9330 i was talking about no open gl sdl version. i see with sdl2, you used stb img and stb truetype instead of sdl_image and sdl_ttf which feels like the more obvious choices. i wondered why. i didnt word my comment properly
Lessgoo!
Vulkan + GLFW + GLM + OpenAL
It is better to use xmake than cmake nowadays
I get it but if your properly know how to use the compiler and link libs it shouldn’t be a big problem anymore. It’s part of C++ to know how to link libs properly other wise you should find an easier programming language or learn how to use the compiler in my opinion we already have it way too easy.
People probably won’t like this comment probably because it’s going against there convenience
that is true, but for a biginner that is not really something fun to learn, I'm not against learning them, people have to learn them but I think they have to learn them later because they are more advanced and less interesting
@@lowlevelgamedev9330 ye that is true
The language and the api’s are indeed more important than learning how to use the compiler, but it shouldn’t be that hard to learn if you have a good learning source
just one thing, don't ship dependencies lol, cmake will fetch em
I think theres a possibility that with changes it may break his setup. Raylib ships dependencies for this reason I think
usually I have to slightly modify dependences, so I preffer to ship the dependences, I don't think a few mb will be a problem for anyone :)))
yeah, until the URLs for fetching will become unaccessible and cmake will not fetch them for you. Vendoring exists for a reason.
what origin are you, midle eastern, good accent
yo, I'm from Romania 💪
@@lowlevelgamedev9330 nice, i thought so, me too
@@lowlevelgamedev9330 nice, me too
I was struggling
Bro 's simple example looks way too hard 😅 , meanwhile i use linux , sdl2. And vim editor . Fr it is easy to install sdl2 on linux though😊
Help me cure me.
Are these cross platform as well?
yess, tho I only tested with linux, and only one time with apple
That should work fine for me. In the future, I don’t think it will be possible to run unsigned applications on Mac anyway. Thanks for these cmake files :)
Best antiCPP propaganda video ever.
fr, most normal cpp fan 😂
Can anybody point me to some free resources where they teach you game dev from scratch including programming, memory, methods, everything.
Edit: Even a exhaustive list which contains all the subjects needed for game dev should help.
yo I have exactly this on my discord, (link in the description of my videos) I have some read only channels where I only post great free resources, check them out 💪
@@lowlevelgamedev9330 I will join the discord then.
Did you know about meson? You just add dependency in config (one line) and then it will link it for you. If you don't have it installed on system it has source based package manager called wrapdb where you just type meson wrap install sdl2 and you have it builded by your compiler
Personally, I found it easier to "fight Rust's borrow-checker" than to build and link C/C++ with third-party libraries.
I was almost happy with Make scripts while I was doing small C projects. But that was only on Linux, on Windows it's bad even with MSYS2.
And CMake... For me it looks like trying Haskell for the first time without knowing that languages can be procedural or functional. My brain refuses to even try to understand CMake.
wait, how can I run Make scripts on Linux?
@@hoanglam649 I mean GNU make which uses Makefiles
@@hoanglam649 I meant GNU make which uses Makefiles
@@hoanglam649 I meant Makefile
@@hoanglam649
1. The comment you answered to mentions CMake, not just Make.
CMake(1) is a tool for building scripts (not only for Make), and Make is a rool for running the specific generated scripts.
2. Make(1) is widely used in Linux, most distros havs it in some "dev" / "devel" packages (the ones with common tools for building stuff) but just installing "make" (search the package name for your distro) is enough to have Make installed and be able to run Make scripts.
To run Make script, often called Makefile (handwritten or generated one, doesn't matter), you need to execute "make" in the directory with Makefile.
Hello, I'm here early.
let's goooo 💪💪
Incredible.
i can enjoy coding, but the entire setup part is giving me actual cancer.
Se aude romanul din tine
😫😫 am fost prins
ekamC
cumk
@@lowlevelgamedev9330now remove the k
skibidi library when?
I might be first viewer
the first comment for sure 💪
There were 2 viewers when I clicked on it, now around 40.
The biggest question is to how deal with cheaters later. I don't see anything from this video...