Тёмный
No video :(

Win32 Input in C (Keyboard/Mouse) 

Nick Walton
Подписаться 6 тыс.
Просмотров 3,5 тыс.
50% 1

Опубликовано:

 

25 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 11   
@UltimaN3rd
@UltimaN3rd 2 года назад
Sorry this one took extra time to come out - I actually had it finished on Monday but I wasn't happy with it so I spent the next few days remaking most of it. I hope I managed to meet everyone's expectations!
@zealous_carrot8744
@zealous_carrot8744 2 года назад
hey,I am trying to make a small framework for gamedev.I am unable to figure out how to abstract away the platform-specefic implementation for window creation and the likes.Can you make a video on it?
@UltimaN3rd
@UltimaN3rd 2 года назад
@@zealous_carrot8744 Currently I'm making a small game in C and making tutorials about each part of that. Once the game itself is done I'll be porting it to Linux and as part of that I'll probably abstract the platform specific code into a reusable library, so that tutorial is coming but it's quite a ways off. In the meantime, a tip about how to do it: design the API you want first, then create the code to fit it.
@MasterMindmars
@MasterMindmars 2 года назад
Very good. Thank you
@UltimaN3rd
@UltimaN3rd 2 года назад
You're welcome mate :)
@ishanagarwal475
@ishanagarwal475 2 года назад
what debugger do you use ? If you don't mind me asking.
@UltimaN3rd
@UltimaN3rd 2 года назад
I've been using gdb, however it's been failing to perform stack traces when a multi threaded program crashes, so often I just use good old printf debugging. I'll end up trying some other debuggers when the interest strikes.
@OxxidCZ
@OxxidCZ 2 года назад
Some games support mouse raw input. How would you implement that in C & WinApi? Thanks!!!
@UltimaN3rd
@UltimaN3rd 2 года назад
Do you mean, rather than capturing mouse move events from windows which give you the pixel position of the mouse, instead handling the signals from the mouse driver directly? I've never looked into it before but it sounds like an interesting idea, especially to achieve higher precision. I'll put it on my radar :)
@OxxidCZ
@OxxidCZ 2 года назад
@@UltimaN3rd yes, higher precision and presumably lower latency. Also bypasses stupid settings for gaming like mouse acceleration. Checkout WM_INPUT docs.microsoft.com/en-us/windows/win32/dxtecharts/taking-advantage-of-high-dpi-mouse-movement?redirectedfrom=MSDN#wm_input docs.microsoft.com/en-us/windows/win32/inputdev/about-raw-input It's definitely a preferred way for games to do it this way. And it would be cool to se a similar tutorial like yours to go over an actual real concept which is used in modern games.
@UltimaN3rd
@UltimaN3rd 2 года назад
@@OxxidCZ Yes I see, that would certainly be the way to do it in any game that doesn't directly map the mouse to pixels. I think the way I showed in the video is fine for most 2d games but any 3d game with the mouse mapped to the camera or suchlike would definitely benefit from raw input. Thank you for bringing that to my attention; in the future when I'm doing 3d tutorials I'll be sure to implement this type of input.
Далее
Realtime Sound on Windows in C with WinMM
3:47
Просмотров 2,8 тыс.
why do header files even exist?
10:53
Просмотров 394 тыс.
Win32 - Drawing Pixels (C)
20:39
Просмотров 27 тыс.
Switching to C - One Year Later
4:43
Просмотров 58 тыс.
What is a mutex in C? (pthread_mutex)
9:18
Просмотров 161 тыс.
GUI Programming with Code::Blocks
14:29
Просмотров 103 тыс.
C++ Keyboard Input
4:49
Просмотров 53 тыс.
C++ 3D DirectX Tutorial [Keyboard / WM_SYSKEYDOWN]
18:46
Header Issues: Guards, Name Mangling, and extern "C"
8:32