Josh Posted May 16, 2017 Share Posted May 16, 2017 I am looking to hire someone to create a series of C++ tutorials similar to our Lua tutorials. They do not have to cover every C++ topic, just the ones we care about when programming Leadwerks with C++. These are the topics: Introduction to C++ Code comments "if" statements Operators Loops Containers (lists, vectors, and maps) Functions Classes (inheritance, static functions / members) Actors (new Leadwerks C++ Actor class, similar to Lua script) Visual Studio debugger Threads (Basic concepts, Mutexes, shared memory read/write access) This is mostly just a theoretical example for learning, I don't expect users to use multithreading much. The documentation will be in an XML file like what we are using now: https://www.leadwerks.com/documentation/Tutorials_Lua-Scripting_Introduction-to-Lua.xml Any image files used will be in a subfolder like this: img/name-of-the-lesson/imagefile.jpg This is by no means meant to be exhaustive documentation of the C++ programming language (no one can do that), it is just meant to take people from zero knowledge to understanding how to use Leadwerks in C++. The lessons can refer to ideas in Lua "this is like how we did X in Lua" but should be self-contained and assume no background knowledge on the part of the reader. Please post here if you are interested. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
aiaf Posted May 17, 2017 Share Posted May 17, 2017 Im interested to do this. Quote I made this with Leadwerks/UAK: Structura | Stacky Desktop Edition Website: Binary Station Link to comment Share on other sites More sharing options...
Josh Posted May 17, 2017 Author Share Posted May 17, 2017 Im interested to do this. I'm sure you'd do a great job of this, but since English isn't your first language it would require a lot of proof-reading on my part. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
thehankinator Posted May 18, 2017 Share Posted May 18, 2017 Link to the XML file is dead for me Quote Link to comment Share on other sites More sharing options...
Josh Posted May 18, 2017 Author Share Posted May 18, 2017 Fixed. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Roland Posted May 18, 2017 Share Posted May 18, 2017 aiaf, on 17 May 2017 - 08:35 PM, said: Im interested to do this. I'm sure you'd do a great job of this, but since English isn't your first language it would require a lot of proof-reading on my part. Was interested but I guess there will be the same problem for me Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Thirsty Panther Posted May 18, 2017 Share Posted May 18, 2017 Hey Roland didn't you do a youtube series on C++ in Leadwerks? I can't find it. Did you remove it? Quote Link to comment Share on other sites More sharing options...
Roland Posted May 18, 2017 Share Posted May 18, 2017 Hey Roland didn't you do a youtube series on C++ in Leadwerks? I can't find it. Did you remove it? Yes I did. But then I switch to a new account, deleted the old one. Of course I forgot to backup them. Yes! Totally idiotic but that's what happened. About 20 videos about C++ lost Sorry about that 1 Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Thirsty Panther Posted May 18, 2017 Share Posted May 18, 2017 Shame. From memory you covered most of the topics Josh is after. Quote Link to comment Share on other sites More sharing options...
Roland Posted May 18, 2017 Share Posted May 18, 2017 Shame. From memory you covered most of the topics Josh is after. Yep. Started with "No knowledge of C++" then covered most things. Classes, Inheritance, Polymorfism, Standard Templates and so on ending up in some Leadwerks scene samples. To bad they are lost and I have no own backup either as I bough a new pc since then and AGAIN!!! was to lazy to make a DVD backup as I had it on YouTube... Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Josh Posted May 19, 2017 Author Share Posted May 19, 2017 I'm nearly through the lessons. It's actually pretty hard to separate out what the user needs to know and give it to them in a digestable format. The containers tutorial really makes the problems of C++ iterators glaringly obvious. That's the only way to do fast removal of objects from a list and they are so incredibly error-prone. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Roland Posted May 19, 2017 Share Posted May 19, 2017 I'm nearly through the lessons. It's actually pretty hard to separate out what the user needs to know and give it to them in a digestable format. The containers tutorial really makes the problems of C++ iterators glaringly obvious. That's the only way to do fast removal of objects from a list and they are so incredibly error-prone. Hi there Josh. First of all the interator sample has an error std::vector myvector = {"Bob", "Jane", "Fred"}; for (auto it = myvector.begin(); it != myvector.end(); it++) { std::string element = (*it); Print(element); } should be std::vector<std::string> myvector = {"Bob", "Jane", "Fred"}; for (auto it = myvector.begin(); it != myvector.end(); it++) { std::string element = (*it); Print(element); } secondly you can create the vector and iterate in a less mysterious way if you don't care what myvector actually is. auto myvector = { "Bob", "Jane", "Fred" }; for each( auto element in myvector ) { Print(element); } if you do care its std::vector<std::string> myvector = { "Bob", "Jane", "Fred" }; for each( auto element in myvector ) { Print(element); } 1 Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Josh Posted May 19, 2017 Author Share Posted May 19, 2017 Ohhhh, I have never seen "for each" in C++. IS that compatible with GCC? 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
thehankinator Posted May 19, 2017 Share Posted May 19, 2017 When using ranged based for loop like, you usually want to make the variable a reference. std::vector<std::string> myvector = { "Bob", "Jane", "Fred" };for( auto&& element : myvector ){ Print(element);}[/Code] Otherwise it's going to copy your string. The double && basically ensures it's a reference not a copy. Quote Link to comment Share on other sites More sharing options...
Roland Posted May 19, 2017 Share Posted May 19, 2017 Ohhhh, I have never seen "for each" in C++. IS that compatible with GCC? Unfortunately I think it's a Microsoft thing, maybe some Linux user can correct me if I'm wrong on that one. Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Rick Posted May 20, 2017 Share Posted May 20, 2017 I think the standard way across compilers is: for(auto i : list) { } Quote Link to comment Share on other sites More sharing options...
thehankinator Posted May 20, 2017 Share Posted May 20, 2017 std::for_each() is part of STL so part of the language. Range based for loops are the syntax as Rick said(but seriously, use auto&&, otherwise it's a copy every iteration). Both achieve the same thing but the STL version is a little more awkward to use but you can specify a begin and end if you wanted to. EDIT: i forgot to mention that ranged base for loops are also part of the language as of c++11 iirc Quote Link to comment Share on other sites More sharing options...
Roland Posted May 20, 2017 Share Posted May 20, 2017 Yes using a reference is of course more efficient Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.