Embedding Lua in C++ Part 3: Meh... Just use Sol...

preview_player
Показать описание
In this video, I show how to use the excelent Sol library/wrapper to integrate Lua in your C++ program. This is shown in direct contrast to how i did it in Part #1 which was bare bones, from scratch.

Рекомендации по теме
Комментарии
Автор

Yeah, Javid's channel is a core part of a C++ programmer's toolbelt at this point. Not only are you videos calming and laid back (something that's hard to find these days), but you also have A LOT of interesting ideas in terms of projects. I can't tell you how many project ideas of yours I... uhhh... "borrowed" and implemented my own way. So, as a young programmer and a C++ connoisseur, thank you. And rock on!

FrodoAlaska
Автор

Sol is one of the first libraries where I realized modern C++ can be used to create great APIs; I was almost skeptical when I assigned C++ functions or objects to tables and it just worked on the other side without me needing to explicitly tell it much. A lot of other host languages can't eliminate huge chunks of the boilerplate in the same way because they don't have the same template machinery and type information that C++ does.

optimizt
Автор

Woooow. Happy to see OLC here. I hope family and you are doing well!

motbus
Автор

Ugh, I love this series and your YouTube videos. I don’t know how to show any more appreciation other than just my words

delusionalaar
Автор

This video and Sol libraries are just so clear and easy to comprehend that I want to go back to my old c++ project and implement Lua scripting just for the fun of it ;-)

jcugnoni
Автор

Oh, I've been waiting for this! So thrilled to see more new videos on the channel, they're so informative and fun to watch. Hope that you are doing great.

solstice_enigma
Автор

Great video! Sol library sure is greatly simplifying and unconfusinating the embedding of LUA to C++ for the programmer. Thank you Javid for sharing.

jsflood
Автор

It's nice to see a software video today that isn't talking about the ssh backdoor that just came to light. Thank you Javid, I greatly appreciate your upload and hope that you're doing well!

Phroggster
Автор

This is great. I implemented Lua into a C++ game a while back without a wrapper library and it wasn't so pretty. It's great to find a solid library with a good API so you can focus on the important things.

ryanb
Автор

Always nice to see a OLC video and learn something. I hope you're well and thanks for making these when you have time

KerboOnYT
Автор

All the best Javid, thank you very much for your great work you did.

SYNAPSEdwl
Автор

This video came at the perfect time as I've just started making my own game engine. I was about the use the raw Lua C libraries but my word Sol is so intuitive!

ethanomical
Автор

Man, I love your videos and moderate paced teaching method. I'm not even c++ programmer.

gauravparvat
Автор

Sol is a great name for a Lua wrapper. It means "sun" in portuguese, and Lua means "moon"

LucasAlmeida-efio
Автор

Being able to just index into the table instead of having to play with the stack looks so useful

oblivion_
Автор

Not sure how I missed SOL when I was implementing my own Lua integration a couple years ago, but it looks pretty neat. Stack manipulation for deeply nested tables and user types is extra painful, and it looks like it makes that much easier.

Although my biggest annoyance is writing the C++ interface classes for Lua to use (eg. MyGameObject -> LuaMyGameObject), which I did in combination with a modified version of luna.hpp. This allowed me to instantiate and manipulate native C++ objects from within Lua, and allow Lua functions to return C++ objects (which would get transformed into the "real" object by its wrapper class). Edit: looks like you did cover that at the end. That is awesome.

As a side note: my particular use-case for having Lua access C++ classes (but NOT create new objects itself) is for procedural generation functions that reference existing state information. So allowing Lua to perform lookups on other entities greatly simplifies the process, and allows defining "logic" snippets for various things or specifying some kind of level generation algorithm that can look up adjacent tiles, properties, etc.

yellowcrescent
Автор

Sol is such a great wrapper for Lua, I can't imagine using Lua without it.

kyoai
Автор

Excuse me, i have a question for your previous video about cross platform c++ GUI framework which is called wxwidgets, i do not quite understand the whole rendering principle behind, i mean how can i control my rendering fps?using wxTimer or idleEvent?could you please tell me in detail about it, it really means a lot to me, because i have devoted so much time in investigating this framework including watching your video over and over agagin

charlesAcmen
Автор

I have been using sol for years now and it's always a pleasure to use.

minirop
Автор

Very nice, i was not aware of the Sol library. This will come in handy :)

CybAtSteam