Created
February 20, 2014 22:18
-
-
Save grahamsellers/9124481 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option 1: WHAT WE HAVE TODAY | |
glEnable(GL_DEPTH_TEST); | |
glDepthFunc(GL_LEQUAL); | |
// Blah | |
glDisable(GL_DEPTH_TEST); | |
Option 2: ONE ENTRY POINT, EXTRA PARAMETER | |
glSetEnable(GL_DEPTH_TEST, GL_TRUE); | |
glDepthFunc(GL_LEQUAL); | |
// Blah | |
glSetEnable(GL_DEPTH_TEST, GL_FALSE); | |
Option 3: ENTRY POINT PER CAP, BOOLEAN PARAMETER | |
glSetDepthTestEnable(GL_TRUE); | |
glDepthFunc(GL_LEQUAL); | |
// Blah | |
glSetDestTestEnable(GL_FALSE); | |
Option 4: TWO ENTRY POINTS PER CAP - NO PARAMETERS | |
glEnableDepthTest(); | |
glDepthFunc(GL_LEQUAL); | |
// Blah | |
glDisableDepthTest(); | |
Option 5: FOLD ENABLE INTO FUNC | |
glDepthFunc(GL_LEQUAL); | |
// Blah | |
glDepthFunc(GL_NONE); |
Option 6: enums!
enum depth_func
{
GL_DEPTH_FUNC_LEQUAL,
...
GL_DEPTH_FUNC_NONE
};
glDepthFunc(GL_DEPTH_FUNC_LEQUAL);
glDepthFunc(GL_DEPTH_FUNC_NONE);
Verbose but build time errors!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Little typo on (3). I think
glSetDestTestEnable(GL_FALSE);
should beglSetDepthTestEnable(GL_FALSE);