Created
April 3, 2013 20:27
-
-
Save tai2/5304927 to your computer and use it in GitHub Desktop.
Display buffer bits on Mac OSX
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <GLUT/glut.h> | |
int | |
main(int argc, char** argv) | |
{ | |
GLint red_bits, green_bits, blue_bits, alpha_bits; | |
GLint depth_bits, stencil_bits; | |
GLint accum_red_bits, accum_green_bits, accum_blue_bits, accum_alpha_bits; | |
glutInit(&argc, argv); | |
glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL | GLUT_ACCUM); | |
glutCreateWindow(argv[0]); | |
glGetIntegerv(GL_RED_BITS, &red_bits); | |
glGetIntegerv(GL_GREEN_BITS, &green_bits); | |
glGetIntegerv(GL_BLUE_BITS, &blue_bits); | |
glGetIntegerv(GL_ALPHA_BITS, &alpha_bits); | |
glGetIntegerv(GL_DEPTH_BITS, &depth_bits); | |
glGetIntegerv(GL_STENCIL_BITS, &stencil_bits); | |
glGetIntegerv(GL_ACCUM_RED_BITS, &accum_red_bits); | |
glGetIntegerv(GL_ACCUM_GREEN_BITS, &accum_green_bits); | |
glGetIntegerv(GL_ACCUM_BLUE_BITS, &accum_blue_bits); | |
glGetIntegerv(GL_ACCUM_ALPHA_BITS, &accum_alpha_bits); | |
printf("COLOR: %d %d %d %d\n", red_bits, green_bits, blue_bits, alpha_bits); | |
printf("DEPTH: %d\n", depth_bits); | |
printf("STENCIL: %d\n", stencil_bits); | |
printf("ACCUM: %d %d %d %d\n", accum_red_bits, accum_green_bits, accum_blue_bits, accum_alpha_bits); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment