Falco's (Lame-Ass) OpenGL Projects

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
Falco Girgis
Elysian Shadows Team
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: Falco's (Lame-Ass) OpenGL Projects

Post by Falco Girgis »

pubby8 wrote:
TheBuzzSaw wrote:
pubby8 wrote:Which would look cleaner in switch. I dunno, it's just style choice, however you really should avoid "default: break;" - it is bad practice.
According to who? Frankly, I do stuff like that all the time to prevent the compiler from blasting out warnings: "YOU DIDN'T ACCOUNT FOR EVERY POSSIBILITY! WE'RE ALL GONNA DIE!" If you know you haven't hit every option, you really should have the default there, even if it doesn't do anything.
The whole reason compiler complains is because not having a default label is identical to a "default: break;" label!
And? Nobody is denying that. Does that mean you are cool with a slew of compiler warnings because you know that behind-the-scenes it's still getting your shit done correctly?
pubby8
Jealous Self-Righteous Prick
Jealous Self-Righteous Prick
Posts: 58
Joined: Mon Feb 07, 2011 12:22 am

Re: Falco's (Lame-Ass) OpenGL Projects

Post by pubby8 »

GyroVorbis wrote:
pubby8 wrote:
TheBuzzSaw wrote:
pubby8 wrote:Which would look cleaner in switch. I dunno, it's just style choice, however you really should avoid "default: break;" - it is bad practice.
According to who? Frankly, I do stuff like that all the time to prevent the compiler from blasting out warnings: "YOU DIDN'T ACCOUNT FOR EVERY POSSIBILITY! WE'RE ALL GONNA DIE!" If you know you haven't hit every option, you really should have the default there, even if it doesn't do anything.
The whole reason compiler complains is because not having a default label is identical to a "default: break;" label!
And? Nobody is denying that. Does that mean you are cool with a slew of compiler warnings because you know that behind-the-scenes it's still getting your shit done correctly?
Most compiler warnings are stupid, and it makes more sense to disable the stupid ones rather than write code around them.
User avatar
Falco Girgis
Elysian Shadows Team
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: Falco's (Lame-Ass) OpenGL Projects

Post by Falco Girgis »

pubby8 wrote:
GyroVorbis wrote:
pubby8 wrote:
TheBuzzSaw wrote:
pubby8 wrote:Which would look cleaner in switch. I dunno, it's just style choice, however you really should avoid "default: break;" - it is bad practice.
According to who? Frankly, I do stuff like that all the time to prevent the compiler from blasting out warnings: "YOU DIDN'T ACCOUNT FOR EVERY POSSIBILITY! WE'RE ALL GONNA DIE!" If you know you haven't hit every option, you really should have the default there, even if it doesn't do anything.
The whole reason compiler complains is because not having a default label is identical to a "default: break;" label!
And? Nobody is denying that. Does that mean you are cool with a slew of compiler warnings because you know that behind-the-scenes it's still getting your shit done correctly?
Most compiler warnings are stupid, and it makes more sense to disable the stupid ones rather than write code around them.
Clearly demonstrating your lack of experience here...

I really miss arguing with avansc and people who are actually intelligent over whether the trivial little things took more clock cycles at a low level or used more memory. Arguing based on compiler warnings and style is honestly below me. I'm done.
User avatar
JaxDragon
Chaos Rift Junior
Chaos Rift Junior
Posts: 395
Joined: Mon Aug 04, 2008 2:03 pm
Current Project: Kanoba Engine
Favorite Gaming Platforms: PS3, PC
Programming Language of Choice: C++
Location: Northeast NC

Re: Falco's (Lame-Ass) OpenGL Projects

Post by JaxDragon »

@op, Im actually kind of interested in these kinds of things. I always enjoy reading schoolwork code, I like to see what it may be like when I get to college. And this kind of code is usually a good reference, especially with all the commenting and whatnot.

@drama ...really?
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Falco's (Lame-Ass) OpenGL Projects

Post by eatcomics »

JaxDragon wrote:@op, Im actually kind of interested in these kinds of things. I always enjoy reading schoolwork code, I like to see what it may be like when I get to college. And this kind of code is usually a good reference, especially with all the commenting and whatnot.

@drama ...really?
frlz. It be all elysian shore up in here.
Image
N64vSNES
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 632
Joined: Thu Aug 12, 2010 11:25 am

Re: Falco's (Lame-Ass) OpenGL Projects

Post by N64vSNES »

pubby8 wrote:
GyroVorbis wrote:
pubby8 wrote:
TheBuzzSaw wrote:
pubby8 wrote:Which would look cleaner in switch. I dunno, it's just style choice, however you really should avoid "default: break;" - it is bad practice.
According to who? Frankly, I do stuff like that all the time to prevent the compiler from blasting out warnings: "YOU DIDN'T ACCOUNT FOR EVERY POSSIBILITY! WE'RE ALL GONNA DIE!" If you know you haven't hit every option, you really should have the default there, even if it doesn't do anything.
The whole reason compiler complains is because not having a default label is identical to a "default: break;" label!
And? Nobody is denying that. Does that mean you are cool with a slew of compiler warnings because you know that behind-the-scenes it's still getting your shit done correctly?
Most compiler warnings are stupid, and it makes more sense to disable the stupid ones rather than write code around them.
People thought I say stupid things :shock2:

GyroVorbis wrote:
N64vSNES wrote:

Code: Select all

glOrtho(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, -100, 10000);
Wut?
Haha, what? Why you hating?
I'm not hating just through my entire OpenGL book I've never seen a depth distance as far apart as -100,10000 :lol:
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: Falco's (Lame-Ass) OpenGL Projects

Post by MrDeathNote »

Out of curiousity when people here are developing in OpenGL do you ever use gltools. I use it a fair bit when I don't want to write custom shaders. It comes with stock shaders that would be enough for most basic ogl projects. Also it allows you to stay current because it uses the core implementation so there's no use of deprecated functions.
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
User avatar
GroundUpEngine
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 835
Joined: Sun Nov 08, 2009 2:01 pm
Current Project: mixture
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Location: UK

Re: Falco's (Lame-Ass) OpenGL Projects

Post by GroundUpEngine »

eatcomics wrote:
JaxDragon wrote:@op, Im actually kind of interested in these kinds of things. I always enjoy reading schoolwork code, I like to see what it may be like when I get to college. And this kind of code is usually a good reference, especially with all the commenting and whatnot.

@drama ...really?
frlz. It be all elysian shore up in here.
:lol:
Last edited by GroundUpEngine on Fri Feb 11, 2011 10:41 am, edited 1 time in total.
User avatar
TheBuzzSaw
Chaos Rift Junior
Chaos Rift Junior
Posts: 310
Joined: Wed Dec 02, 2009 3:55 pm
Current Project: Paroxysm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: Falco's (Lame-Ass) OpenGL Projects

Post by TheBuzzSaw »

pubby8 wrote:The whole reason compiler complains is because not having a default label is identical to a "default: break;" label!
You're missing the point. It's a warning, not an error. It is good to have one because not having one generally implies you have not explicitly declared what happens if no match is found. It's not bad to have "default: break;" because it tells other programmers on your team, "If no matches are found, I acknowledge that I want nothing to happen." Having nothing is bad practice because it implies, "I assumed it would always hit one of the upper possibilities".
User avatar
TheBuzzSaw
Chaos Rift Junior
Chaos Rift Junior
Posts: 310
Joined: Wed Dec 02, 2009 3:55 pm
Current Project: Paroxysm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: Falco's (Lame-Ass) OpenGL Projects

Post by TheBuzzSaw »

MrDeathNote wrote:Out of curiousity when people here are developing in OpenGL do you ever use gltools. I use it a fair bit when I don't want to write custom shaders. It comes with stock shaders that would be enough for most basic ogl projects. Also it allows you to stay current because it uses the core implementation so there's no use of deprecated functions.
Personally, I'm not a fan. It tries to mimic the old immediate mode for comfort's sake, and I have long since moved onto using my own VBO classes. As far as stock shaders go, those take like 2 seconds to write, and I have a nice Shader class. ^_^
User avatar
GroundUpEngine
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 835
Joined: Sun Nov 08, 2009 2:01 pm
Current Project: mixture
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Location: UK

Re: Falco's (Lame-Ass) OpenGL Projects

Post by GroundUpEngine »

TheBuzzSaw wrote:and I have long since moved onto using my own VBO classes. As far as stock shaders go, those take like 2 seconds to write, and I have a nice Shader class.
+1 :)
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: Falco's (Lame-Ass) OpenGL Projects

Post by MrDeathNote »

TheBuzzSaw wrote:
MrDeathNote wrote:Out of curiousity when people here are developing in OpenGL do you ever use gltools. I use it a fair bit when I don't want to write custom shaders. It comes with stock shaders that would be enough for most basic ogl projects. Also it allows you to stay current because it uses the core implementation so there's no use of deprecated functions.
Personally, I'm not a fan. It tries to mimic the old immediate mode for comfort's sake, and I have long since moved onto using my own VBO classes. As far as stock shaders go, those take like 2 seconds to write, and I have a nice Shader class. ^_^
I agree about the VBO's and shaders, but for ppl with less experience i think it's a great idea. And isn't using it for comfort's sake the point, what I mean is that if i'm writing a quick app I don't want to have to go and write boiler plate code every time. For a larger project you're 100% right, and I prefer it the same way.
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
User avatar
TheBuzzSaw
Chaos Rift Junior
Chaos Rift Junior
Posts: 310
Joined: Wed Dec 02, 2009 3:55 pm
Current Project: Paroxysm
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Contact:

Re: Falco's (Lame-Ass) OpenGL Projects

Post by TheBuzzSaw »

MrDeathNote wrote: I agree about the VBO's and shaders, but for ppl with less experience i think it's a great idea. And isn't using it for comfort's sake the point, what I mean is that if i'm writing a quick app I don't want to have to go and write boiler plate code every time. For a larger project you're 100% right, and I prefer it the same way.
Well, but I'm referring to quick projects too. My classes make it so easy to set stuff up that I just use them instead of GLTools even for small quick ideas.

I should write the OpenGL SuperQur'an.
User avatar
dandymcgee
ES Beta Backer
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: Falco's (Lame-Ass) OpenGL Projects

Post by dandymcgee »

N64vSNES wrote:
GyroVorbis wrote:
N64vSNES wrote:

Code: Select all

glOrtho(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, -100, 10000);
Wut?
Haha, what? Why you hating?
I'm not hating just through my entire OpenGL book I've never seen a depth distance as far apart as -100,10000 :lol:
Looks like you need a book that covers a broader spectrum.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
pubby8
Jealous Self-Righteous Prick
Jealous Self-Righteous Prick
Posts: 58
Joined: Mon Feb 07, 2011 12:22 am

Re: Falco's (Lame-Ass) OpenGL Projects

Post by pubby8 »

You're missing the point. It's a warning, not an error. It is good to have one because not having one generally implies you have not explicitly declared what happens if no match is found. It's not bad to have "default: break;" because it tells other programmers on your team, "If no matches are found, I acknowledge that I want nothing to happen." Having nothing is bad practice because it implies, "I assumed it would always hit one of the upper possibilities".
So you are saying that it is good or bad practice? :s

And on topic of stupid warnings, the "/*" inside comment warning is perhaps the most annoying of them all (although strict aliasing rules is close second)
Post Reply