Page 1 of 1

Pong clone in C with SDL/GL (code example).

PostPosted: Thu Sep 17, 2015 12:33 pm
by lelandbdean
Hey guys.

Made a simple Pong clone for a thing. Thought it might help someone just starting out to understand SDL/OpenGL, basic game logic and program flow control, etc.
Be forewarned: Shit has one .c file, and is a bit ugly. It is the way it is on purpose.

Anyway, here's the repo:
https://github.com/lelandbdean/SDL-OpenGL-Pong

And here's a screenshot:
Image

Re: Pong clone in C with SDL/GL (code example).

PostPosted: Thu Sep 17, 2015 2:54 pm
by dandymcgee
Cool, thanks for sharing.

As you build on top of it and clean it up you should iteratively update the Git repo so that anyone using it to learn can go back and look at your history if they want. If you're trying to preserve the simplest possible project, you could fork it for the more complex version.

Re: Pong clone in C with SDL/GL (code example).

PostPosted: Thu Sep 17, 2015 3:57 pm
by lelandbdean
dandymcgee wrote:As you build on top of it and clean it up you should iteratively update the Git repo so that anyone using it to learn can go back and look at your history if they want. If you're trying to preserve the simplest possible project, you could fork it for the more complex version.


That's the plan, actually. :) Keep every iteration of the project available, so if someone wants they can step through the evolution. I know the project is really simple, but I think it's a valuable illustration.

When I was first getting started (as a clueless teenager) the lack of "finished" examples/usage code for most libraries was a hurdle. "Here's how to load an image" vs. "Here's how to link all these subsystems and APIs together to make something cohesive."

As you gain experience, you reach a point where basic examples (and Reading The Fucking Manual) is enough to make you comfortable, but as a programming virgin it's daunting to slog through documentation and trying to make sense of it with no frame of reference. Hopefully this will help someone past that.

Re: Pong clone in C with SDL/GL (code example).

PostPosted: Thu Sep 17, 2015 6:46 pm
by dandymcgee
lelandbdean wrote:As you gain experience, you reach a point where basic examples (and Reading The Fucking Manual) is enough to make you comfortable, but as a programming virgin it's daunting to slog through documentation and trying to make sense of it with no frame of reference. Hopefully this will help someone past that.

I owe everything I know about SDL to LazyFoo. Good times.

Re: Pong clone in C with SDL/GL (code example).

PostPosted: Thu Oct 01, 2015 10:28 am
by superLED
dandymcgee wrote:
lelandbdean wrote:As you gain experience, you reach a point where basic examples (and Reading The Fucking Manual) is enough to make you comfortable, but as a programming virgin it's daunting to slog through documentation and trying to make sense of it with no frame of reference. Hopefully this will help someone past that.

I owe everything I know about SDL to LazyFoo. Good times.

Haha, same here. I think I may have given up if it wasn't for his webpage with simple explanations of how tings work.

Re: Pong clone in C with SDL/GL (code example).

PostPosted: Mon Sep 19, 2016 7:48 am
by Falco Girgis
Shit, I missed this thread. This is a really fucking badass take on pong, and I hope a lot of the newbies here realize how useful the source code is to them.

Re: Pong clone in C with SDL/GL (code example).

PostPosted: Sat Nov 18, 2017 7:43 am
by MarioWa
This is really cool, thanks for the source code leland! Hope you don't mind if I play around with it!