Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » I'm having problems with glEnable(GL_DEPTH_TEST);, and I'm ashamed of it.

This thread is locked; no one can reply to it. rss feed Print
I'm having problems with glEnable(GL_DEPTH_TEST);, and I'm ashamed of it.
Albin Engström
Member #8,110
December 2006
avatar

If you made an application that would display a model, but it turns out that the depth testing is off and the model looks kinda funny:
http://www.allegro.cc/files/attachment/595256

But then you enable it and all the vertices's disappear and you'll sit there totally confused... If you have experienced this or know of it please share the different scenarios in which this can happen.

Just by adding this:

glEnable(GL_DEPTH_TEST);

Everything goes blank :S.

I've done this like a hundred times but I've always used allegroGL so I guess I've missed out on something important one must do for the depth testing. :(

I've looked at nehe's tutorials to but i see nothing special there.
I'm uncertain of what code might be of use.

Thanks for not telling me to use AllegroGL. ;D

Thomas Fjellstrom
Member #476
June 2000
avatar

Have you remembered to clear the depth buffer at all ever?

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

X-G
Member #856
December 2000
avatar

Are you remembering to clear the depth buffer? While you're at it, enable backface culling.

EDIT: Dang it!

--
Since 2008-Jun-18, democracy in Sweden is dead. | 悪霊退散!悪霊退散!怨霊、物の怪、困った時は ドーマン!セーマン!ドーマン!セーマン! 直ぐに呼びましょう陰陽師レッツゴー!

Albin Engström
Member #8,110
December 2006
avatar

Wow! you guys are quick and precise! :o.

Bullseye, I had forgotten to clear the depth buffer ><.

I learn by mistakes.. 8-).

Thanks!

Vanneto
Member #8,643
May 2007

X-G said:

EDIT: Dang it!

Twice in a row, huh? Well, at least now, you answered in the same minute. ;D

In capitalist America bank robs you.

Go to: