Advanced C++/Graphics Tutorial 3: Input Processing!

preview_player
Показать описание
Today we learn how to use SDL to process input! If you are using glfw instead, the functions are very similar, but you will have to use google to see how glfw works :)

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

It can be really hard to find tutorials that are above Beginner level but below Expert, so great job +MakingGamesWithBen, these are fantastic

LiamWhan
Автор

It's worth pointing out for people that SDL is a very mature library that "just works" for a lot of things, like deploying to another platform without having to change any code, recognizing tons of obscure input devices and make them behave properly, etc. I would be hesitant to replace it with GLFW or anything else without doing serious research. Just my 2 cents.

toddzelin
Автор

This is so awesome!

To be honest, you did great on your c++ series, but at around 25 looking at the console constantly just became a bit too dry for me. So now I just do these tuts, and when I hear you say a word I don't know much about (for example enum class in this video) I just go to your video about it.

I can really recommend this, it works great for me and keeps stuff interesting. Watching your enum class video is actually so much nicer when you need it to "do the cool stuff" haha

jantjent
Автор

Just want to say, so far your tutorials are amazing at explaining exactly what everything does. Very easy to follow AND understand compared to most others. Looking forwards to getting further!

BL-dmsz
Автор

When I first started digging into OpenGL+game development I carefully decided what API I would use. It couldn't be something that already had stuff all pre-made, but shouldn't be too low-level either, so I chose what felt most right in between - SDL. I'm very glad you're using it for this series. I've experimented a bit with Allegro, SMFL, etc but they felt a bit off, and I wouldn't be using Unity3D or Unreal because I'd like to understand the inner workings of a game engine. :D

paulocbbf
Автор

Just watched Adv C++/Graphics part 1, 2 and 3 and I think I will stick here for more :)
Thanks for this really great work!!!

jury
Автор

Your tutorials are crazy good! Keep it up!

Galluxi
Автор

These tutorials are so easy to follow, thanks a lot for making them!

beatipacifici
Автор

Just start watching your videos...I just can say i wish you was my teacher in university...Really enjoy...
Many many thanks to you man and good luck!!!

jonasjanaitis
Автор

For my opinion you do the best tutorials of programming on youtube!

kristibuda
Автор

Thank you for this. It is very hard to find good tutorials on making games from scratch.

hybridjaviepsilon
Автор

ultra huge series.. this guy is a god.. already lovin it at ep03...

nishadtardalkar
Автор

Wow you're such a great teacher! Thank you.

tomrago
Автор

I know this is old and it's a nitpick, but near the end there, you are not actually going to get to 1024 and 768, but rather 1023 and 767 because the pixels are 0 index (the first one in the top left is 0, 0 rather than 1, 1). Just in case anyone watching in the future is following along and gets confused by what you said and thinks they're missing a pixel or that it isn't being pixel perfect :P

zvxcvxcz
Автор

when creating SDL_Event inside processInput, wouldn't it be better to create it as a member variable of MainGame? Because you are calling processInput everytime in gameLoop, so you are creating a new instance of SDL_Event everytime you call the function

brunomello
Автор

+Peter Griffin  sounds like your compiler doesnt have C++11 enabled! What IDE are you using?

makinggameswithben
Автор

My evnt.mousemotion x and y is huge numbers. 0 -
*facepalm*
Forgot to add the space in cout so it just looked like a big number...

ibiixie
Автор

Hey, by the way, instead of doing that for a press any key to continue, you can just use System("pause");.

xnossisx
Автор

I've been wondering about the architecture of a game/game engine for a while.
For example why did you decide that the Game class should be holding the window and not a separate class called graphics?
And why did you decide to do the input processing inside of the Game class and not a Input class?

And what if 2 modules need to communicate with each other? How would I do that?

So many questions about this.

ibiixie
Автор

for errors in enum class GameState{PLAY, EXIT}; use this, enum GameState {PLAY, EXIT};

FabioSilva-bqou
visit shbcf.ru