Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does OpenGL specify that constants are any particular value?

Tags:

opengl

So I wouldn't be stupid enough to ask this in general, but here's the situation. I'm in a compilers class, and now that we've finished a compiler for our designed language, we need to write a nontrivial program in it. I'm doing an OpenGL spinning cube, to show off the OpenGL bindings I'm working on.

But I've run into some problems. Mostly, I can't just pull in the OpenGL headers, and in any case I don't need everything in there, but this prevents me from having any of the useful constants (GL_FLOAT, GL_COLOR_BUFFER_BIT, etc).

So I'm wondering - are the #define'd constants the same from machine to machine, and OS to OS? In other words, are the constants themselves part of the GL standard, or left as symbols?

Thanks!

like image 996
Robert Avatar asked Apr 26 '11 03:04

Robert


1 Answers

Enumerants values are allocated by Khronos/ARB, they are constant. SPEC files are provided to make bindings, you can find them at:

http://www.opengl.org/registry/

This spec file is what you want:

http://www.opengl.org/registry/api/enum.spec

You can find other spec files in the OpenGL registry.

like image 132
Dr. Snoopy Avatar answered Sep 29 '22 11:09

Dr. Snoopy