Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL vs glfw #74

Open
Quaker762 opened this issue Jan 27, 2017 · 4 comments
Open

SDL vs glfw #74

Quaker762 opened this issue Jan 27, 2017 · 4 comments

Comments

@Quaker762
Copy link
Member

Quaker762 commented Jan 27, 2017

glfw looks a little bit friendlier and less bloated imho, I also like the idea of having callbacks instead of having to dispatch events ala SDL. Apart from this and a few other things, they're practically the same.

It apparently also deals with OpenGL in a slightly more cross platform way than SDL.

@z33ky
Copy link
Collaborator

z33ky commented Jan 29, 2017

I only tried freeglut and SDL for creating an OpenGL context. I don't remember why, but I ditched freeglut pretty fast.

SDL is certainly more "battle hardened" than glfw, but on a quick glance glfw seems like a decent choice as well. It certainly tackles less stuff and thus is a lighter dependency, although I would expect SDL is already installed on many gamer's computers anyway.

SDL covers many more platforms than glfw does, so I'm unsure what you mean by "deal[ing] with OpenGL in a slightly more cross platform way".

For controller support, there's a sort of database that maps plenty of different controllers to a uniform interface. I've heard good stuff about it, but I can't find a decent source atm.

I'm pretty sure that SDL is more widely used and it has a good reputation, so it would be my first choice. Also because Ryan Gordon, one of SDL's main authors, is a hero for pretty much all Linux gamers ;)
But I wouldn't really mind glfw either.

@Quaker762
Copy link
Member Author

Quaker762 commented Jan 30, 2017

Very true, it probably is better to run SDL considering there is a lot more support for it, though we're probably only going to be using it for GL, events and Windowing (we need OpenAL for audio). I'm pretty sure Carmack himself used it for Quake 1, 2 and 3...

SDL covers many more platforms than glfw does, so I'm unsure what you mean by "deal[ing] with OpenGL in a slightly more cross platform way".

Might've just been some buzzwords on the GLFW site, apparently it looks to include some GL stuff for you, making it a lot easier to port stuff without having to set include directories, but this is pretty much a moot point now that I think about it.

The only real reason I saw to use it was what I considered to be a superior method of event handling, though IIRC you said you had an event dispatcher or something along those lines already written for SDL, but if not, we could probably map them using an std::map and function pointers.

@z33ky
Copy link
Collaborator

z33ky commented Jan 30, 2017

I'm pretty sure Carmack himself used it for Quake 1, 2 and 3...

SDL wasn't around when Quake 1 & 2 were released ;)
And the ioquake3 fork uses SDL, but I'm 99% sure the original does not.

Some (all?) versions of the Unreal Engine have support for SDL though. Close enough, eh?

IIRC you said you had an event dispatcher or something along those lines

I have an input manager. To give you an idea, I snipped out some code where I used it: https://gist.github.com/z33ky/ac5ea29aab2e41a1b7813574d511dbc5
I have a partially cleaned up commit on a branch in my repo ("input"); Documentation is present.

@Quaker762
Copy link
Member Author

SDL wasn't around when Quake 1 & 2 were released ;)

I must've misread this somewhere then haha, or perhaps I saw some port (perhaps toaruos, I think Kevin Lange uses the SDL port)

Some (all?) versions of the Unreal Engine have support for SDL though. Close enough, eh?

Hahahaha definitely close enough.

I have a partially cleaned up commit on a branch in my repo ("input"); Documentation is present

Awesome, this will be immensely useful. I can't wait to write some actual game code ;)

@Quaker762 Quaker762 added this to Done in TODO Feb 20, 2018
@Quaker762 Quaker762 moved this from Done to Stale in TODO Feb 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
TODO
  
Stale
Development

No branches or pull requests

2 participants