I want to start learning c++ after my current project.
I've only ever used high-level dynamic programming languages - And am entirely self-taught (save for a lot of awesome people on this forum helping me!) so please excuse how stupid some of my post might sound
I was wondering if it's possible/normal/even makes sense to use something like love while learning or to develop games with c++.
From what I understand, using c++ you have to be very aware of what platform you are developing for - And in my head, I'm picturing that I could use love as something that has already solved that problem, and already does all of the basics that I'd want (creating a window, drawing images, etc).
I would think there is some sort of interface that love provides that would basically take care of all the various ways of doing things for each platform behind a simple call. But my best guess is that I am just way off and have no idea what I'm talking about!
To begin my c++ journey I obviously would not be attempting to do this. But once I've understood some of the foundations I would like to be able to eventually create some simple interactive stuff, and thought maybe this was a way of doing so that is also familiar to me.
Using love while learning c++
- baconhawka7x
- Party member
- Posts: 494
- Joined: Mon Nov 21, 2011 7:05 am
- Location: Oregon, USA
- Contact:
Re: Using love while learning c++
I don’t know that love is packaged in a way to make that easy, but presumably you could download the source use the C++ directly instead of going through the Lia interface.
But you might be better off using a different cross platform library, like SDL2.
But you might be better off using a different cross platform library, like SDL2.
Re: Using love while learning c++
My advice is to pick a specific project that you would like to accomplish. It can be over-ambitious (game engine) or low-stakes (pong). It doesn't necessarily need to be achievable at first, it just needs to not be "learn c++". Your goal is "do <something> via c++".
It's through the act of trying (and failing often) to do that thing, that you will learn a great deal about c++.
On to answering your actual question. Love's interface is accessed through Lua, but the framework itself is written in mostly c++/c. Since it is open-source, you could always take a look under the hood: https://github.com/love2d/love
If you are interested in game-engine c++ I recommend Casey Muratori's Handmade Hero. He does a great job de-mystifying the win32 API, working with pointers, manually managing memory etc.
If you don't care for the low-level stuff, and just want to make games with c++, you could look into RayLib or SFML (or SDL2 but afaik that is more c than c++).
It's through the act of trying (and failing often) to do that thing, that you will learn a great deal about c++.
On to answering your actual question. Love's interface is accessed through Lua, but the framework itself is written in mostly c++/c. Since it is open-source, you could always take a look under the hood: https://github.com/love2d/love
If you are interested in game-engine c++ I recommend Casey Muratori's Handmade Hero. He does a great job de-mystifying the win32 API, working with pointers, manually managing memory etc.
If you don't care for the low-level stuff, and just want to make games with c++, you could look into RayLib or SFML (or SDL2 but afaik that is more c than c++).
Re: Using love while learning c++
Not saying that you shouldn't learn C++, only you can know what's important for you.
But for you to consider learning C# instead. This would let you use Godot, Unity etc.
And C# is much closer to C++ than Lua is, so you will be closing the distance in any case.
But for you to consider learning C# instead. This would let you use Godot, Unity etc.
And C# is much closer to C++ than Lua is, so you will be closing the distance in any case.
- baconhawka7x
- Party member
- Posts: 494
- Joined: Mon Nov 21, 2011 7:05 am
- Location: Oregon, USA
- Contact:
Re: Using love while learning c++
For sure - My main goal is to learn how to work with memory management and grasp some lower-level computing fundamentals - But I do also want to eventually work on some 3d stuff and it seems like knowing some c languages is crucial for that right now.RNavega wrote: ↑Tue Jan 30, 2024 6:48 am Not saying that you shouldn't learn C++, only you can know what's important for you.
But for you to consider learning C# instead. This would let you use Godot, Unity etc.
And C# is much closer to C++ than Lua is, so you will be closing the distance in any case.
I do have a little bit of experience making a couple small things with unity and c# - I also tried Unreal but didn't go as deep into it. I've never been super motivated to learn a GUI based engine, I haven't had any good experiences with them so far. But I'm sure if I gave them more of a shot I could get on board.
- baconhawka7x
- Party member
- Posts: 494
- Joined: Mon Nov 21, 2011 7:05 am
- Location: Oregon, USA
- Contact:
Re: Using love while learning c++
I appreciate the response, I'll take a look at those videos! Yeah my approach to learning new things is to just create things - I usually prefer to start with very small things that I know I can finish somewhat quickly, just because it helps with my short attention span.Azzla wrote: ↑Tue Jan 30, 2024 2:01 am My advice is to pick a specific project that you would like to accomplish. It can be over-ambitious (game engine) or low-stakes (pong). It doesn't necessarily need to be achievable at first, it just needs to not be "learn c++". Your goal is "do <something> via c++".
It's through the act of trying (and failing often) to do that thing, that you will learn a great deal about c++.
On to answering your actual question. Love's interface is accessed through Lua, but the framework itself is written in mostly c++/c. Since it is open-source, you could always take a look under the hood: https://github.com/love2d/love
If you are interested in game-engine c++ I recommend Casey Muratori's Handmade Hero. He does a great job de-mystifying the win32 API, working with pointers, manually managing memory etc.
If you don't care for the low-level stuff, and just want to make games with c++, you could look into RayLib or SFML (or SDL2 but afaik that is more c than c++).
Normally I have some sort of larger goal when learning something - I could say that I want to learn c++ to be a more well rounded programmer - But honestly the real reason is low-level stuff has just seemed really interesting and exciting to me lately
I don't currently have any specific ideas for my very first small project, though. I think I'd want to start much smaller than pong. Probably something cli based.
Re: Using love while learning c++
Oh, and using LuaJIT's FFI you can load library binaries like .DLL on Windows and .SO on Android / Linux, as seen here:
viewtopic.php?p=223319#p223319
You can build those binaries with C++ and a C extern interface, and use them in your Löve programs later. See this:
https://github.com/ImagicTheCat/love-we ... e-webp.lua
viewtopic.php?p=223319#p223319
You can build those binaries with C++ and a C extern interface, and use them in your Löve programs later. See this:
https://github.com/ImagicTheCat/love-we ... e-webp.lua
Who is online
Users browsing this forum: No registered users and 13 guests