COMP4300 - C++ Game Programming - Lecture 02 - Intro to C++ (1/2)

  Рет қаралды 122,790

Dave Churchill

Dave Churchill

Күн бұрын

00:00 - Intro
03:12 - What is C++?
09:06 - Advantages / Disadvantages
14:37 - C/C++ History / Versions
22:46 - C++ Properties
24:03 - Hello World Explained
33:16 - Whitespace / Indentation / Braces
37:55 - C++ STL / Standard Library
41:10 - C++ Source Code / Compiling
1:04:24 - Files: .cpp and .h
1:12:34 - Primitives and Operators
1:13:41 - Functions and Classes
1:20:03 - Live Coding Start (terminal)
1:21:50 - Hello World Explained Again
1:23:55 - Compiling First Program
1:26:47 - Using Variables
1:30:29 - std::vector
1:37:47 - Creating Classes / Adding Functions
Memorial University - Computer Science 4300 - Fall 2022
Intro to Game Programming
Professor: David Churchill - www.cs.mun.ca/~dchurchill/
This is a course for students interested in learning the fundamentals of game programming and game engine architecture. Topics include an introduction to: vector math for games, rendering, animation, and artificial intelligence, collision detection, game physics, and user-interfaces. Students will be writing fully functional games using an ECS (Entities, Components, Systems) architecture, using the C++ programming language and the SFML graphics library.
Course Assignments / Files will not be released publicly

Пікірлер: 115
@Latsu15
@Latsu15 Жыл бұрын
As someone who has come across a post on reddit sharing this course, thank you for making these lectures public.
@tomodiero7524
@tomodiero7524 4 ай бұрын
Absolute King move, stopping the recording to tend to the Ferret appropriately named King George. no edits just real life. I love the video and the teaching.
@Blazemore6
@Blazemore6 Жыл бұрын
I really, really appreciate these lectures being available online. This is a great primer, and refresher on c++ and I cannot wait to get into the more meaty parts of the course.
@mother_of_crows
@mother_of_crows 11 ай бұрын
Give this man an award! I wish I had this style and presentation in my courses.
@Bopek
@Bopek 4 ай бұрын
I’ve been brute forcing making a game without looking at C++ tutorials but realised I was missing some small details, these quick crash courses were fantastic - I’ve learned to much, thank you!
@Koba_78
@Koba_78 11 ай бұрын
As a recent MSc Pharmacology graduate looking to learn about game development, design patterns, and engine architecture using C++ (I do 3D modelling and digital sculpting as a hobby), such online content is a godsend. Thanks a lot for this amazing content!
@williambigger1545
@williambigger1545 Жыл бұрын
I go to a different university but there isn't a game development course here so this is very interesting. thanks for making it available to the public. I promise I won't post my solutions!
@smacdonald2012
@smacdonald2012 5 ай бұрын
As a SDE for over 2 decades and mostly in Java, this is an excellent course about C++. I have worked in C++ back in the day when MFC was popular, but this is a great refresher.
@bravenick
@bravenick Жыл бұрын
Dave, thank you so much to post this course, I'm currently going through and so far it was just amazing!
@omnimathic
@omnimathic 11 ай бұрын
I am really amazed, thank you Dave.
@seanflynn1149
@seanflynn1149 7 ай бұрын
Thanks very much for uploading this playlist! Such a great resource.
@ShankingDisaster
@ShankingDisaster 7 ай бұрын
brother you're helping people go for their dreams here! thank you!
@lecturecapture
@lecturecapture 6 ай бұрын
One of the best-taught courses I've ever watched. Thanks for making them available to the public.
@yurialbu
@yurialbu 5 ай бұрын
This is the best C++ class that I've ever watched! Thank you so much, sir!
@treyrubino4597
@treyrubino4597 Жыл бұрын
Currently a Computer Science major at a different university. Outstanding lectures thus far, really looking forward to seeing more courses available from you. I've had issues with many of my current professors whom tend to not care, you make the lecture interesting. Thank you so much, can't wait to see more from you Professor Churchill!
@Mannershark
@Mannershark Жыл бұрын
Thanks for sharing! It's nice to have someone experienced go into the c++ specifics that you might not realize when coming from other languages, like using `const std::string&` instead of unknowingly passing by value and creating copies.
@Beygir
@Beygir 3 ай бұрын
There is a bunch of tips and tricks in the lectures, it is kinda treasure hunt for me.. Thank you Dave, appreciate it!
@jimbo3947
@jimbo3947 3 ай бұрын
You're a legend, thank you for posting these online. Greetings from the UK.
@manavroy7293
@manavroy7293 Жыл бұрын
This channel is hell underrated..You diserve million of subs and views for creating such a wonderfull content.I came accros this channel from reddit...I actually started learning game dev 3 months ago ..But i litreally messed up my time by following complicated books(I'm talking about sfml..),Tutorials etc...If only i could able to go back 3 months ago,I'd advise myself to learn game dev from here..Can't wait to proceed with further lectures of the playlist :)
@witchinghourtv6651
@witchinghourtv6651 Жыл бұрын
hey just want to let you know im on the same boat lol. started over complicating myself with high level books that i know i wasnt ready for but what i wanted to learn. These video also helped me tone down the complex ideas into more digestible information which has made alot of little things of cpp click in my head in a good way. for me i couldnt find a good cpp course to learn it with an interesting style and this course has it the perfect way to learn for those who want hands on.
@techservice7033
@techservice7033 Жыл бұрын
Fantastic tutorial, keep up the great videos!
@orynicolas
@orynicolas 4 ай бұрын
Wonderful class! I really love your teaching style, Dave. Thank you so much for providing us with such a valuable learning material. Can't wait to watch the other classes - never long enough if you ask me :-)).
@troubledtom5250
@troubledtom5250 5 ай бұрын
honestly from this 2 hr vid i learned alot of concepts that i generally didnt know also had doubts about tnx for helping me also figure out how to do encapsulation and stuff i only did that stuff in java while learing oop but c++ was generally easy to grasp so far tnx alot i'll be atching the rest of your 20 vids now keep at it :)
@MillennialKingdomReigned
@MillennialKingdomReigned 6 ай бұрын
This guy is awesome. Way better than any paid course on Udemy. Dave = the GOAT
@ivankevamo
@ivankevamo 7 ай бұрын
Thank you very much, your videos are amazing! Greetings from Brazil.
@MengistAbyssinia
@MengistAbyssinia Жыл бұрын
I found this from KZfaq. Thank you very very much.
@JJ-dz2ne
@JJ-dz2ne 5 ай бұрын
Wow! thank you for uploading!
@mahmoudabdel-raouf1354
@mahmoudabdel-raouf1354 3 ай бұрын
You are truly a very wonderful professor. Thank you for sharing these lectures
@joey_g2378
@joey_g2378 Ай бұрын
Awesome! Thank you very much for sharing!
@chishikiendeavourer8663
@chishikiendeavourer8663 8 ай бұрын
I considered myself to be a late to comment here, I am not going to miss this opportunity to show appreciation on how good you have done on c++ introduction. I am a professional developer and I am struck by how you have explained these concepts beautifully. Hats off. 🎉❤
@JesseDanielSmith
@JesseDanielSmith 5 ай бұрын
Thank you for this video!
@ricorobert2848
@ricorobert2848 5 ай бұрын
8 years ago , i've learned c++ , i discover c++ , to be the most my favourite programming languange , beside php and many others . Thx for the lectures . I was looking for game programming.
@iDorito
@iDorito 3 ай бұрын
Such a bad thing for me that i missed this classes in live. Im loving how you teach, i can't help but fell asleep while watching other lectures, but with yours i can't do anything more that hear and learn. Thanks, i hope i can code huge games once i finish this course. ♥
@Jason-eo7xo
@Jason-eo7xo 3 ай бұрын
same here. i was watching this horribly boring C++ tutorial on udemy and was falling asleep...and thats what eventually lead me here.
@grishe143
@grishe143 Жыл бұрын
vim keymapping to run compile and run cpp file in the current buffer when ctrl-b is pressed: map :w :!g++ % && ./a.out
@124k3_
@124k3_ 6 ай бұрын
i am in my second year and i have only coded in java and python (i haven't done any projects) but i am learning cpp so fast i cant explain (its tricky, since i don't have that much previous experience or knowledge) but its easy to digest 😅 ... thanks again ... appreciate the effort
@adnanchaudhary5905
@adnanchaudhary5905 6 ай бұрын
lovely lecture
@y0g_s0th0th
@y0g_s0th0th 10 ай бұрын
You're a godsend.
@reipalacio
@reipalacio 8 ай бұрын
Dave. Happy with this course. I go slow but I just like it. I put attention to every word in this Master. I like the nice energy you put on this. Excuse my english
@pawansutar2724
@pawansutar2724 10 ай бұрын
I am an experienced C++ developer and I’ve never seen such a fluid and to-the-point intro to C++. I was wondering if it would be possible to leave only the 2nd and 3rd lectures on this channel after taking down the course. Thank you so much for posting this course! I’m heading to Memorial University’s academic calendar to finish it before the fall sem starts! Also, I would be keen to see if the university approves it sooner to take this course without enrolling into the degree program.
@DaveChurchill
@DaveChurchill 10 ай бұрын
These lectures will remain online indefinitely as I have returned to in-person teaching for the fall
@pawansutar2724
@pawansutar2724 10 ай бұрын
@@DaveChurchill That’s great to hear! Excited to explore this course! 🫡
@vijaynyaya
@vijaynyaya Жыл бұрын
I have tried learning cpp multiple times this year to no avail. This course, gives me the confidence that I can do it. Previously, I was trying to setup cpp on windows which, as you said, was a "nightmare". So, this time I'm using linux(WSL). Previously, I was learning cpp from people who take the approach of teaching "everything" about cpp before building stuff with it. Your mixed approach is perfect for me. BTW, I'm full stack javascript developer in a blockchain firm. I've been exposed to Rust, Golang, Elixir, Javascript and Python during my career. I must say, after watching this lecture, cpp seems to be the most elegant of them all. Thanks Dave Churchill! You 🤘
@awesomemix7777
@awesomemix7777 6 ай бұрын
it's weird that you exposed to many similar language, with a good experiences in the field, yet you still feels challenging learning a new language.
@ngrader
@ngrader 3 ай бұрын
51:06 Gospel 1:15:31 Hungarian Notation: Finally prompted me to look it up, kept wondering what the prefixes meant when I saw them. Modern tools reduce it's relative utility, imo. My biggest gripe being auto-complete collisions.
6 ай бұрын
getAvg returns an int, m_avg is float.
@nuiben7579
@nuiben7579 6 ай бұрын
51:22 ... *really* wish I had kept watching the video before spending 3 hours last night trying to set up a compiler for VS Code.
@ghevisartor6005
@ghevisartor6005 3 ай бұрын
just starting this course and i want to thank you for the amazing lectures. I wonder if the memory management you mention at the start is similar to c# dispose/using pattern. I don't know the lifetime of the objects in c++, but if they are local to a method something like the using keyword would be great, or IDisposable if they last as the whole parent object. Maybe it will be even better and will give me ideas at work where i use C#.
@ScaredHelmet
@ScaredHelmet 2 ай бұрын
I love George!
@IntheFishtank
@IntheFishtank 5 ай бұрын
Thanks to reinstate c++ in the place it deserves. Best language ever.
@denisecastellanos4866
@denisecastellanos4866 3 ай бұрын
I am only on the second lecture of this course, which I fully intend on completing, and I gotta say I love your teaching style/attitude. Too many people out there make C++ out to be this daunting mountain or sea that can only be surmounted/crossed if you have the favor of God, like Moses or something. Your casual attitude actually sets up your students to believe that they can indeed learn and make something cool out of the subject matter that you are teaching. I already have a few years in the games industry, mostly working with the Unity engine as a creative programmer/engineer. Always had a fascination with learning about the deeper intricacies of game engines. I have no doubt that by the end of this course I will be returning to my work with even greater understanding and confidence in my abilities. Thank you very much for posting these. I guess I must have the favor of God/the Goddess for having stumbled upon these lectures. 😇
@DaveChurchill
@DaveChurchill 3 ай бұрын
Thanks for the kind words! Please don't expect our game engine to go into the same level of detail as in the games industry, this is intended for undergraduate students :)
@denisecastellanos4866
@denisecastellanos4866 3 ай бұрын
@@DaveChurchill Understood, I will treat this as a good starting point in the practical application of building an engine. From which to build off of. 🙂
@notanomba4598
@notanomba4598 6 ай бұрын
the file reading could be even shorter by putting everything in the while loop: while(fin >> first >> last >> id >> avg) ...
@ScaredHelmet
@ScaredHelmet Ай бұрын
that's pretty nifty
@aakarshanraj1176
@aakarshanraj1176 5 ай бұрын
Great Lecture, which vim colorscheme are you using? edit: i realized its just default one
@awaismushtaq5719
@awaismushtaq5719 4 ай бұрын
Among C and C++, I find C far more adorable!
@GreyReBl
@GreyReBl 4 ай бұрын
I find the little challenge about iterating through a text file in less lines than C++ funny because ifstream is a library, which makes the challenge moot. In order to read by each string separated by whitespace instead by line, each line must be delimited by whitespace first. The ifstream library is used for this exact behaviour which simplifies it into a single method. After that, it's basically an iterator. So with an equivalent method, almost EVERY language could do the same thing in 2-3 lines of code.
@DaveChurchill
@DaveChurchill 4 ай бұрын
The whole point is that people think C++ is this big scary language and so they never try it. These are just simple examples to show that it's quite approachable for easy tasks. It's not meant to cover ever possibly use case.
@GreyReBl
@GreyReBl 4 ай бұрын
@@DaveChurchill And I agree with your point. I'm just making fun of the approach. What I like about the example, when comparing other languages, is that it shows C++ is really not that special. People tend on both sides tend to put C++ on a pedestal, when it's really down-to-earth and approachable. It's simply more to learn and more responsibility, because at the end of the day, a programming language is still a programming language.
@montecristo31
@montecristo31 6 ай бұрын
I LOVE YOU!
@Kerolos_Essam
@Kerolos_Essam Ай бұрын
Hey Doc Dave I'm so happy that I've stumbled upon your course but when you started talking about the vectors I didn't understand anything and I can't get it what do you think I need to learn before continuing this course?
@DaveChurchill
@DaveChurchill Ай бұрын
This is meant to be a 4th year computer science course, so linear algebra is an assumed bit of knowledge
@KamiSamaPIANIST
@KamiSamaPIANIST 7 ай бұрын
Hello, Profesor. I was wondering what books I should read for this course. I understand the notion of C++, but I've been looking for a book that can teach me how to develop games. Do you have any recommendations for decent books on 2D gaming in C++ and for SFML?
@kubolor1234
@kubolor1234 9 ай бұрын
a.out - assembler output
@eyzake
@eyzake 2 ай бұрын
tried to watch this about 3 month6ago .. didn't knwo how to use vim didn't know java didn't know anything to be honest...i guess finally i can do it (and btw i am switching to linux full-time)
@Ptr-NG
@Ptr-NG 6 ай бұрын
Imperative, generic, object-oriented; this cpp thing should be powerful of a kind !! Is it functional too?
@faanross
@faanross 4 ай бұрын
or Windows: get WSL2 up and running, then g++ or clang.
@faanross
@faanross 4 ай бұрын
also sorry if i'm starting to come across as a smart-ass here, just a fun fact: a.out stands for ""assembler output".
@ayoolafelix
@ayoolafelix 4 ай бұрын
is it advisable to use xcode? setting up c++ on mac for visual studio code seems to be a challenge.
@DaveChurchill
@DaveChurchill 4 ай бұрын
It is literally 2 or 3 commands to set up C++ without xcode. Done in lecture 4
@fableoftheunspokenword3357
@fableoftheunspokenword3357 8 ай бұрын
Dev c is simple enough though?
@BryanChance
@BryanChance 5 ай бұрын
These lectures are priceless! Thank you sir! And anyone complaining about this, fine. go learn your Python. LOL lmao
@faanross
@faanross 4 ай бұрын
meme game on point, good sir.
@franzheger2871
@franzheger2871 5 ай бұрын
I prefer the Allman Version ...
@fatgolem69
@fatgolem69 Жыл бұрын
what's your vim theme? I really like it!
@DaveChurchill
@DaveChurchill Жыл бұрын
I think it's just the default :D
@fatgolem69
@fatgolem69 Жыл бұрын
@@DaveChurchill oh, on my computer its different
@DaveChurchill
@DaveChurchill Жыл бұрын
@@fatgolem69 I really don't know. Just try different themes until you find one you like :)
@fatgolem69
@fatgolem69 Жыл бұрын
@@DaveChurchill okay, thanks :)
@kkh0101
@kkh0101 Жыл бұрын
@@fatgolem69 many people use tokyonight. you might like it.
@Am-pe4iy
@Am-pe4iy 6 ай бұрын
I am now scared that the internet collapses these lectures wont be available anymore
@DaveChurchill
@DaveChurchill 6 ай бұрын
I'm pretty sure you'll be fine, but you can use a tool like yt-dlp to download youtube videos just in case it does all blow up
@arjanvandenheuvel4522
@arjanvandenheuvel4522 Жыл бұрын
Damn, the names "Visual Studio" and "Visual Studio Code" really are confusing. It doesn't help that judging on just the names I'd be more likely to pick the latter one, because having "Code" in it makes it seem as if that's the correct or best one for programming. 😅
@lucascook7981
@lucascook7981 7 ай бұрын
I use vs code for c++ with mingw compiler and plugins to run my code and a quick .json setting change to be able to interact with IO functions. Is there a problem with coding in c++ in this way?
@Rhino2400
@Rhino2400 7 ай бұрын
i love the donkey kong music
@Darkfault
@Darkfault Жыл бұрын
Piss on it, I'm going to use VSCode with this! :D
@ngrader
@ngrader 3 ай бұрын
Legend has it, he's still trying to setup MinGW to this day...
@Darkfault
@Darkfault 3 ай бұрын
@@ngrader I'm a grown up C++ developer now - switched to VS anyway, less getting things to work, more coding. And better Unreal Engine 5 support!
@eredeath
@eredeath Жыл бұрын
Python only needs 4 lines and doesn't need to import anything first: def loadfromfile(filename,students): with open(filename) as file: for line in file: students.append(line.split(" "))
@piotrgruszecki2400
@piotrgruszecki2400 10 ай бұрын
You need to convert id and avg to int and float, but it's still easy to write that code in less lines than in the video
@humbledb4jesus
@humbledb4jesus 4 ай бұрын
i hate c and c++ i was 14 when the commodore pet came out...i self taught basic off of it... in university, i took fortran...kicked ass... wrote a program on a com64 for 2nd year astrophysics class that predicted the structure of the sun at any point in it's life... took 1/2 hr to run (even found a programming error with a specific variable was involved...it would crash the program until i simply added a '1' on the end of it)...the guy next to me ran it in a split second with c++... i think: ok, i'm gonna learn c++ coudn't get past assigning variables...there goes my programming career... so i just made galaga games...with peek and poke statements...
@francoiswessels8062
@francoiswessels8062 8 ай бұрын
fckn superhero
@lifeProgramer5023
@lifeProgramer5023 Жыл бұрын
#include using namespace std; int main(){ cout
@Simple_OG
@Simple_OG 2 ай бұрын
segmentation fault core dumped
@briankoehl6083
@briankoehl6083 5 ай бұрын
Lol why the donkey Kong music
@Nirvexis811
@Nirvexis811 10 ай бұрын
setuping mingw is not that hard btw
@sweetday0-0
@sweetday0-0 7 күн бұрын
I wouldn't fire George, he can sleep all he wants
@DaveChurchill
@DaveChurchill 7 күн бұрын
Unfortunately George passed away last year
@PharmacyBrain
@PharmacyBrain 9 ай бұрын
Stroustrup uses the Allman style. Saying otherwise is blasphemy. Source: I have all the books in front of me. Fix the slides! 😂
@ngrader
@ngrader 3 ай бұрын
Since the books are in front of you. I suggest opening them. ;) But Bjarne does seem to be more style-fluid than most.
@PharmacyBrain
@PharmacyBrain 3 ай бұрын
​@@ngraderherp durp
@kuijaye
@kuijaye 6 ай бұрын
Nitpicky comment: C++ standard library != stl
@DaveChurchill
@DaveChurchill 6 ай бұрын
STL = Standard Template Library en.wikipedia.org/wiki/Standard_Template_Library
@kuijaye
@kuijaye 6 ай бұрын
@@DaveChurchill most people usually use thses two term interchangeably while STL is a part of standard library not all of it.
@egfs
@egfs 5 ай бұрын
sorry, but i prefer C# foreach(string line in File.ReadLines(filename)) { string[] splitted = line.Split(' '); string first = splitted[0]; string last = splitted[1]; int id = int.Parse(splitted[2]); float avg = float.Parse(splitted[3]); addStudent(new Student(first, last, id, avg)); } jokes aside, great video
@lidroxd6869
@lidroxd6869 4 ай бұрын
Thank you Jesse Pinkman
@user-vd6wb5ef8v
@user-vd6wb5ef8v 4 ай бұрын
Great lecture! Just one observation: why all these references to Java? For those who knows Java these are redundant. For those who do not know Java (the majority, I presume) they are white noise. For both these are annoying procrastinations
@DaveChurchill
@DaveChurchill 4 ай бұрын
Our university uses Java for some of its earlier courses, so I make the comparison for the students
@BrianRiendeau
@BrianRiendeau Жыл бұрын
where can I find the macro?
@aakarshanraj1176
@aakarshanraj1176 6 ай бұрын
Its a simple macros, start recording by pressing q+b then 1. : 2. w 3. enter 4. : 5. !g++ basic.cpp 6. enter 7. :!./a.out
@aakarshanraj1176
@aakarshanraj1176 6 ай бұрын
also add clear if you like your terminal clean
COMP4300 - C++ Game Programming - Lecture 03 - Intro to C++ (2/2)
1:58:31
Game Development Caution
13:48
Timothy Cain
Рет қаралды 289 М.
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 27 МЛН
Please be kind🙏
00:34
ISSEI / いっせい
Рет қаралды 186 МЛН
World’s Deadliest Obstacle Course!
28:25
MrBeast
Рет қаралды 146 МЛН
Luck Decides My Future Again 🍀🍀🍀 #katebrush #shorts
00:19
Kate Brush
Рет қаралды 8 МЛН
how Google writes gorgeous C++
7:40
Low Level Learning
Рет қаралды 800 М.
One year of my C++ SFML journey
5:39
Snapi
Рет қаралды 398 М.
COMP4300 - Game Programming - Lecture 02 - Intro to C++ (1/2)
2:07:08
Dave Churchill
Рет қаралды 19 М.
Making a Game With C++ and SDL2
8:14
PolyMars
Рет қаралды 1,7 МЛН
Compilers, How They Work, And Writing Them From Scratch
23:53
Adam McDaniel
Рет қаралды 79 М.
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 735 М.
COMP4300 - Game Programming - Lecture 04 - Assignment 1 + SFML
2:00:41
Dave Churchill
Рет қаралды 40 М.
How to ACTUALLY get into Gamedev
14:01
DaFluffyPotato
Рет қаралды 692 М.
Sigma Girl Past #funny #sigma #viral
00:20
CRAZY GREAPA
Рет қаралды 27 МЛН