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:
Pong clone in C with SDL/GL (code example).
Moderator: PC Supremacists
-
- Chaos Rift Newbie
- Posts: 18
- Joined: Thu Mar 28, 2013 10:37 pm
- Favorite Gaming Platforms: PC, Gameboy, PSP, SNES, NES
- Programming Language of Choice: C/++ usually
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Pong clone in C with SDL/GL (code example).
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.
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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
-
- Chaos Rift Newbie
- Posts: 18
- Joined: Thu Mar 28, 2013 10:37 pm
- Favorite Gaming Platforms: PC, Gameboy, PSP, SNES, NES
- Programming Language of Choice: C/++ usually
Re: Pong clone in C with SDL/GL (code example).
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.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.
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.
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: Pong clone in C with SDL/GL (code example).
I owe everything I know about SDL to LazyFoo. Good times.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.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
- superLED
- Chaos Rift Junior
- Posts: 303
- Joined: Sun Nov 21, 2010 10:56 am
- Current Project: Engine
- Favorite Gaming Platforms: N64
- Programming Language of Choice: C++, PHP
- Location: Norway
Re: Pong clone in C with SDL/GL (code example).
Haha, same here. I think I may have given up if it wasn't for his webpage with simple explanations of how tings work.dandymcgee wrote:I owe everything I know about SDL to LazyFoo. Good times.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.
- Falco Girgis
- Elysian Shadows Team
- Posts: 10294
- Joined: Thu May 20, 2004 2:04 pm
- Current Project: Elysian Shadows
- Favorite Gaming Platforms: Dreamcast, SNES, NES
- Programming Language of Choice: C/++
- Location: Studio Vorbis, AL
- Contact:
Re: Pong clone in C with SDL/GL (code example).
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).
This is really cool, thanks for the source code leland! Hope you don't mind if I play around with it!dandyemcgee 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.