No video

Header-Only Game Framework in C | Game Engineering

  Рет қаралды 23,195

John Jackson

John Jackson

Күн бұрын

Пікірлер: 108
@arifkasim3241
@arifkasim3241 3 жыл бұрын
Finally....someone does it in C. Thanks.
@gamecodeur
@gamecodeur 3 жыл бұрын
This is pretty amazing. Incredible work. I'll use it to teach my students.
@ultrahalf
@ultrahalf 3 жыл бұрын
Man I wanna document my code like that
@shankar4510
@shankar4510 3 жыл бұрын
I deeply appreciate your effort . Thanks a lot for this.Now I will reverse engineer it and learn it all .
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Great to hear it. If you have any questions, join the discord.
@ThatOSDev
@ThatOSDev Ай бұрын
Slowly I been working on my own. But it's nice to see othes who also use C. I also agree with all your points about C. 👍
@GuilhermeTeres
@GuilhermeTeres 3 жыл бұрын
That's a very good, entertaining and informative video! I have been using gunslinger for a couple of weeks and it's simplicity and features really made it a good and pleasant framework to work with. I can't wait to explore it more, keep it up, John!
@johnjackson9767
@johnjackson9767 3 жыл бұрын
First.
@wh0d1s-l
@wh0d1s-l 3 жыл бұрын
bruhhhhh
@chandrakanth4241
@chandrakanth4241 3 жыл бұрын
this is not fair.
@theemeraldfalcon9184
@theemeraldfalcon9184 3 жыл бұрын
Cheater
@johnjackson9767
@johnjackson9767 3 жыл бұрын
@@theemeraldfalcon9184 I wouldn't dare.
@skaruts
@skaruts 3 жыл бұрын
Well, I'm first too. In spirit!
@toffeethedev
@toffeethedev 3 жыл бұрын
You code just like I do and have all the same philosophies, I feel less alone you're awesome thank you!
@LogicEu
@LogicEu 3 жыл бұрын
This is incredible. Been waiting for this. Thank you! Keep it up!
@buddyze
@buddyze 3 жыл бұрын
Just leaving a comment for th yt algo to pick this up quicker. The world needs to see this. Great job my guy
@ishdx9374
@ishdx9374 3 жыл бұрын
I love it, it looks really easy and awe
@SoulsGamerBierre
@SoulsGamerBierre 3 жыл бұрын
Awesome. This is helping me a lot to make experiments and study. Thanks, John.
@ibrakap
@ibrakap 3 жыл бұрын
Looks promising i'll give a look, good job mate.
@tommydrager5497
@tommydrager5497 3 жыл бұрын
wow, thank you for putting so much time and effort to make this accessible and presentable. The amount of content is overwhelming.. but this is defenitly a great creation of yours. Keep it up!
@tochka832
@tochka832 3 жыл бұрын
nice work, i surely would check this out, only started playing with c99/11 about two weeks ago, but this looks promising i really like the implementation of data structures as someone who coded in python before, really useful stuff
@10e999
@10e999 3 жыл бұрын
Fantastique! Thanks for this detailed video. I really like your C programming style.
@rlindner81
@rlindner81 3 жыл бұрын
Very neat framework, demo, and game
@yousefali995
@yousefali995 2 жыл бұрын
I have been looking for a simple graphics framework for C, and finally I found an awesome one! Amazing!
@botbeamer
@botbeamer 3 жыл бұрын
Really good work man 💯👍 I need to play with this at some point
@voxelrifts
@voxelrifts 3 жыл бұрын
I. Love. This.
@johnjackson9767
@johnjackson9767 3 жыл бұрын
I. Love. You.
@voxelrifts
@voxelrifts 3 жыл бұрын
@@johnjackson9767 😂sure.
@theemeraldfalcon9184
@theemeraldfalcon9184 3 жыл бұрын
Not first but like 15th or something idk Okay but in all serious, THIS. IS. SO. COOL.
@ChukoByte
@ChukoByte 3 жыл бұрын
Very impressive, keep up the good content!
@ethanviolet1
@ethanviolet1 3 жыл бұрын
Awesome! we have been waiting paitently for another video :P
@eboatwright_
@eboatwright_ 3 жыл бұрын
Ayyy Texas flag at 0:14 ! :D Also, this is really cool! I would probably use it if I used C XD
@boris_raduloff
@boris_raduloff 2 жыл бұрын
Absolutely brilliant
@pajeetsingh
@pajeetsingh 3 жыл бұрын
How to limit frame rate without using vsync feature? I tried calling (sleep) but it won't work.
@johnjackson9767
@johnjackson9767 3 жыл бұрын
If you look in "gs.h" under my repo, look for the "gs_engine_frame()" function. I limit the frame time in there based on a user set frame rate, and it should give you ideas on how to implement it for your own stuff.
@pajeetsingh
@pajeetsingh 3 жыл бұрын
@@johnjackson9767 Yeah thanks. Got that working using nanosleep instead of sleep.
@SB-rf2ye
@SB-rf2ye 3 жыл бұрын
really cool work, though it's not strict/pedantic c99 standard conforming, as it seems to use gnu extensions like unnamed structs and unions in your gs_vec structs.
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Yeah, this is something that's been pointed out and is being changed. I'm considering switching to c11, since it's become more supported as of late.
@SB-rf2ye
@SB-rf2ye 3 жыл бұрын
@@johnjackson9767 I use a named struct inside union as : typedef union blah_un { float i[2]; struct { float x, y; } s; } blah; Then use it like blah b; b.s.x = 1; b.s.y = 2; Little bit extra typing, but not required to switch to C11.
@commandershepard1944
@commandershepard1944 3 жыл бұрын
Looks great
@NeZversSounds
@NeZversSounds 3 жыл бұрын
Oh, that means no fighting to get GLFW to compile?!! I love Raylib for its ease to use and this looks like Raylib on steroids.
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Yeah, the default platform layer includes a header only version of glfw.
@skaruts
@skaruts 3 жыл бұрын
c99 header-only, sounds quite easy to bind with Lua or Nim (or others). Sounds tempting to me. :) Also especially because of snake_case, which is what I rather use. Raylib, though nice, uses PascalCase, which triggers my OCD...
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Word on the PascalCase comment.
@nickheyer
@nickheyer 2 жыл бұрын
Down with OOP
@zedrex3597
@zedrex3597 3 жыл бұрын
What things do I have to learn to build something like this on my own someday?
@shankar4510
@shankar4510 Жыл бұрын
can you tell me where you started ? your programming history ?
@sirdiealot7805
@sirdiealot7805 3 жыл бұрын
So this is a bit like Löve, only C instead of C++ and Lua.
@KanjiCoder_RTFM
@KanjiCoder_RTFM Ай бұрын
I was trying to use Nuklear and disapointed that glfw is an empty repo that needs to be built ? And Nuklear uses it ? Now I remember why I wrote my own win32 and opengl function pointer library . I just want to compile a single file and be done . No make files and build scripts .
@johnjackson9767
@johnjackson9767 Ай бұрын
@@KanjiCoder_RTFM Yes, Nuklear and Dear Imgui don't make assumptions about platform. They provide samples that show how to hookup to various backends for this reason. I vendor glfw, emscripten and Android backends default platforms to get around some of this headache, although that's controversial to some in what a framework should do.
@KanjiCoder_RTFM
@KanjiCoder_RTFM Ай бұрын
@@johnjackson9767 I think for adoptability of a framework , the less brick walls the better .
@KanjiCoder_RTFM
@KanjiCoder_RTFM Ай бұрын
@@johnjackson9767 I don't know what I am talking about here . But possibly make things just "work out of the box" and have a way where the experts who know more about linkers and build systems can do their thing if they so choose ?
@bonus5804
@bonus5804 2 жыл бұрын
I have a question about slot arrays: if I add an item, store the handle in two different places, erase the handle from one place. Now if I use the handle from the other place, it'll be invalid, BUT what if in the meantime, someone added items in the slot array, is it possible that the other handle says that it's valid, although it doesn't correspond to the right item?
@johnjackson9767
@johnjackson9767 2 жыл бұрын
Correct, this would be something that could be addressed by splitting the handle into a generation and index bit pattern, similar to how a lot of entity component systems work. You'd have 8 bits for the generation and 24 bits for the index, and you check the generation to see if it's valid before use. That way you could delete and reuse an entry 255 times before it wraps back around.
@bonus5804
@bonus5804 2 жыл бұрын
@@johnjackson9767 Ok thanks for your answer!
@michawielgus9827
@michawielgus9827 3 жыл бұрын
Wow its so clever to put all game data into single structure xd
@johnjackson9767
@johnjackson9767 3 жыл бұрын
I'm well known for being clever.
@michawielgus9827
@michawielgus9827 3 жыл бұрын
@@johnjackson9767 well i discovered you just tonight, after watching minecraft remake in pure C in 48 hours (you commented there)
@thanhlongtran9163
@thanhlongtran9163 3 жыл бұрын
Why does the user need to define GS_IMPL? I saw this in a lot of other libraries, too.
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Since it's header only, all of the implementation code is wrapped within implementation guards. So it needs to be defined once that way the implementation will be compiled once and only once.
@thanhlongtran9163
@thanhlongtran9163 3 жыл бұрын
@@johnjackson9767 Can't you do something like #ifndef then #define?
@johnjackson9767
@johnjackson9767 3 жыл бұрын
@@thanhlongtran9163 You could, but then the user has no control over where it's to be defined
@sukhchainsingh3894
@sukhchainsingh3894 3 жыл бұрын
Amazing.
@sdsdfdu4437
@sdsdfdu4437 3 жыл бұрын
Dude you're awesome. I could use this for a 3d game, right?
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Yeah, definitely. I've updated quite a bit since then (added web and android backends), and I'm currently writing a util for 2d/3d physics. Join the discord, quite a few people there who are using it if you have questions.
@sdsdfdu4437
@sdsdfdu4437 3 жыл бұрын
@@johnjackson9767 cool, thanks, I'll check out the discord. Are you writing physics from scratch or using an existing engine?
@johnjackson9767
@johnjackson9767 3 жыл бұрын
@@sdsdfdu4437 From scratch, so I can avoid any external dependencies
@fleaspoon
@fleaspoon 3 жыл бұрын
Amazing
@vellendev
@vellendev 3 жыл бұрын
Do you plan to provide Vulkan as a backend like you currently provide OpenGL as an option, or will you leave that for someone to implement themselves if they need it?
@johnjackson9767
@johnjackson9767 3 жыл бұрын
It's on the roadmap for one I'd like to provide.
@pedrogabrielnogueira1068
@pedrogabrielnogueira1068 3 жыл бұрын
How the heck is this even possible? How many years have u studied and programmed in c? Which books have you read? Needless to say the incredible work. I'm starring gunslinger
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Thanks, man. I've been programming professionally for about a decade, c/c++ are my main languages. Just keep at it, you'll get comfortable with it all.
@pedrogabrielnogueira1068
@pedrogabrielnogueira1068 3 жыл бұрын
@@johnjackson9767 Aye aye, sir! I'm never giving up neither on C nor C++ T-T C and C++ will never get boring :v
@2k7u
@2k7u 3 жыл бұрын
I wish i had these coding skills XD
@maholet
@maholet 3 жыл бұрын
Opengl::opengl_compile_shader::shader: 'gs_immediate_default_fill_shader' FAILED_TO_COMPILE: 0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Is this with the pong example or the project template?
@maholet
@maholet 3 жыл бұрын
@@johnjackson9767 It's gs_progect_template on Linux Debian 10. Build of App was ok, but compile of shader has failed at start. "App: ../third_party/include/gs/impl/gs_graphics_impl.h:896: gs_graphics_shader_create: Assertion `false' failed."
@johnjackson9767
@johnjackson9767 3 жыл бұрын
K, should be easy enough to fix.
@needlessoptions
@needlessoptions 3 жыл бұрын
👀 !
@G33KN3rd
@G33KN3rd 3 жыл бұрын
since it's a game framework, perhaps you should rename it to *"Funslinger"* ;) Also, for code naming, `frmwrk` is the same length as `engine`.
@TheRealFFS
@TheRealFFS 3 жыл бұрын
But more awkward to type.
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Lol
@Gabryx_
@Gabryx_ 3 жыл бұрын
maybe fwork that is one character less than engine
@tochka832
@tochka832 3 жыл бұрын
i don't think that it's a good idea to name things in a certain way just because it's easier to type like, yeah, frmwrk is short, but it's code that many people will use and do they have to guess what all the things mean? frmwrk is kinda alright tho, but if everything is named like that then it's fucked
@PissMasterPlus
@PissMasterPlus 3 жыл бұрын
@@Gabryx_ Maybe fork, because I'm hungry.
@CNLohr
@CNLohr 3 жыл бұрын
In b4 one of the rustites say "WHY NOT RUUUUSSTTTT"
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Wouldn't be the first time. I've enjoyed your vids, man. Thanks for commenting.
@CNLohr
@CNLohr 3 жыл бұрын
@@johnjackson9767 Would you be up for joining my discord - we are discussing a presentation on idiomatic C in 2021. Would love your input.
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Sure thing, what's your link?
@AntonioZL
@AntonioZL 3 жыл бұрын
WHY NOT RUUUUSSSSSTTTT Because I don't want to.
@KanjiCoder_RTFM
@KanjiCoder_RTFM Ай бұрын
Can I use this for UI ?
@johnjackson9767
@johnjackson9767 Ай бұрын
@@KanjiCoder_RTFM Yes. It has an immediate mode gui extension I've since added that I use exclusively for personal projects.
@KanjiCoder_RTFM
@KanjiCoder_RTFM Ай бұрын
@@johnjackson9767 Cool . I'll keep you in mind . I already stubbed raylib into my current project . But I'll take a look at your stuff the next time I write a project . I am assuming your project would be an easier way to build Nuklear into my C projects ? I saw one of your videos messing with Nuklear .
@lifeless9768
@lifeless9768 3 жыл бұрын
why did you stop using visual studio?
@johnjackson9767
@johnjackson9767 3 жыл бұрын
A simpler text editor is all I need.
@vincenzopanella2705
@vincenzopanella2705 3 жыл бұрын
Why reinventing stl ? i see this as a regular occurence,
@johnjackson9767
@johnjackson9767 3 жыл бұрын
Two reasons: - There's no "stl" for the c standard lib, so it's necessary to write your own implementation for various common data structures or find an equivalent that someone else has written. - There is no such thing as "reinventing the wheel" with regards to software.
@vincenzopanella2705
@vincenzopanella2705 3 жыл бұрын
@@johnjackson9767 Well I think there is , writing a set of vector functions over and over again is against software engineering principle, being a software engineer fro 20 and more years I 've come to the conclusion that every piece of new software must be written with less and less code entropy, just my opinion though
@johnjackson9767
@johnjackson9767 3 жыл бұрын
@@vincenzopanella2705 Most legacy, institutional software *is* entropic simply by nature of it being legacy. There's no avoiding that. One only needs to look at what modern c++ has morphed into to see it.
@vincenzopanella2705
@vincenzopanella2705 3 жыл бұрын
@@johnjackson9767 I must say though that the idea intrigues me a lot.
@deanvangreunen6457
@deanvangreunen6457 3 жыл бұрын
Second
@gamecodeur
@gamecodeur 3 жыл бұрын
late
@decodedbunny101
@decodedbunny101 3 жыл бұрын
Can you do BATCH now (.bat) Try it lad
@chandrakanth4241
@chandrakanth4241 3 жыл бұрын
third
Recreating Noita's Sand Simulation in C and OpenGL | Game Engineering
10:03
Writing a Poor Man's Reflection System in C99
44:01
John Jackson
Рет қаралды 11 М.
The Joker kisses Harley Quinn underwater!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 39 МЛН
Unity DOTS vs Handbuilt: Sample Project
27:56
Nick Caston
Рет қаралды 676 М.
Writing 2D Games in C using SDL by Thomas Lively
47:32
CS50
Рет қаралды 185 М.
Comparing C to machine language
10:02
Ben Eater
Рет қаралды 5 МЛН
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,5 МЛН
Giving Personality to Procedural Animations using Math
15:30
t3ssel8r
Рет қаралды 2,5 МЛН
Making Minecraft from scratch in 48 hours (NO GAME ENGINE)
16:38
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
Exploring the Tech and Design of Noita
31:00
GDC
Рет қаралды 225 М.
The Joker kisses Harley Quinn underwater!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 39 МЛН