Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411595 Posts in 69386 Topics- by 58444 Members - Latest Member: FightingFoxGame

May 07, 2024, 04:35:03 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Entrypoint (window creation, input, etc).
Pages: [1]
Print
Author Topic: Entrypoint (window creation, input, etc).  (Read 1118 times)
jimon_c
Level 0
**


work work work


View Profile WWW
« on: November 12, 2016, 02:38:39 AM »

Hello my fellow engine developers Smiley This one is for you!

You might know that writing your own engine is an awesome and interesting journey that allow people to learn a lot.
But usually this journey starts with writing your own code to create a window, create OpenGL/D3D/etc context, get input, etc. Which is not really "an engine development" per se, and might be demotivating (I would like to create an engine, but writing entrypoint code for fifth time makes me sad :D) There are some solutions that allow you to bootstrap stuff quite fast: SDL, GLFW and others, but sometimes they feel like overkill or bulky monsters Smiley

So fear not! I recently moved my own creation from SDL to my own entrypoint (because SDL on iOS is meh) and decided to write it in very-very reusable way. So here you go https://github.com/jimon/entrypoint Smiley

PS. first post here Smiley
Logged
pelle
Level 2
**



View Profile WWW
« Reply #1 on: November 12, 2016, 12:03:28 PM »

Interesting and a good project.  Gentleman

Not that I think SDL is too heavy for what it provides though. I have my own ui.h and ui.c with the most important boilerplate to create a window etc in SDL without too much copy-paste and quite happy with that, but if you approach SDL in terms of features of course it is on my list of things to keep an eye on for future projects. Cheers!
Logged
JohnsyJohnsy
Level 0
**


View Profile
« Reply #2 on: November 13, 2016, 05:19:35 AM »

Great stuff, I only recently learned about bgfx and this seems a good fit with that. great, will follow!
Logged
qMopey
Level 6
*


View Profile WWW
« Reply #3 on: November 15, 2016, 02:48:36 PM »

Pretty cool! I like it a lot. You should consider wrapping up all of your code into a single header -- this will make it easier to consume your code. It's honestly just a headache to figure out what files are needed and when...

Some things I noticed reading your code/readme: I don't see a feature list. There's a kinda poor description on what the thing is. It's an entrypoint for games. OK, but what do I get by using your code? Talk a little more about what it does that's helpful. From checking it out it looks like you have the literal entrypoint covered, and have some mouse/input stuff. Great! Say that up-front.

It's cool to see someone else thinking about heavy dependencies. People around here generally love dependencies and don't care about shipping a 2GB game, or adding in huge libraries to do simple things (like the entrypoint!). Unity is a giant dependency. SDL is a big dependency. Even including something like dear_imgui has a negative impact on compile time (at least for my project) since it uses so many C++ features (file inclusions). Dependencies suck and avoiding them can make the download size way smaller, and make development more enjoyable.

Anyway, cool code dude. I love seeing more of these topics come up.

P.S. I noticed you mentioned adding in some OpenGL stuff. I recommend not to. Everyone will be super picky about how to handle OpenGL. Even context handling people will be picky, especially with hotloading libraries, or multi-threading stuff. What's really useful is one problem one solution one header. Don't start solving more than one problem as your code will go from solving one problem well, to solving multiple problems poorly. And then nobody will use your code.
Logged
jimon_c
Level 0
**


work work work


View Profile WWW
« Reply #4 on: November 15, 2016, 02:55:19 PM »

You should consider wrapping up all of your code into a single header -- this will make it easier to consume your code.

Actually yes, I'm a huge fan of https://github.com/nothings/stb and love one-header libraries.
The thing here is the entrypoint requires two different programming languages: C and Objective-C, while technically I could make Objective-C part in plain C (see https://github.com/jimon/osx_app_in_plain_c) the result is quite messy.

Maybe you have a better idea how to combine not only Objective-C and C API but implementation as well in one header? Because now I can simply combine them with wrapping Objective-C part in #ifdef __objc__, but than it means this header should be included in .m/.mm file otherwise it will not work on iOS/OSX, and this makes me sad :D
Logged
qMopey
Level 6
*


View Profile WWW
« Reply #5 on: November 15, 2016, 03:02:33 PM »

Yeah I can tell you liked stb headers haha  Gomez Toast Right

Not sure if there's a good way to have literally one file, I'm ignorant about iOS entry point stuff. In any case when I click into your github and see like 7 files it's sort of scares me. Dunno if you can actually fix that, but if it is 2 files that would A-OK with me.
Logged
buto
Level 0
***



View Profile WWW
« Reply #6 on: November 22, 2016, 01:41:57 PM »

7 really doesn't sound that bad!
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic