View Full Version : Benefit of GLfloat, etc?
06-14-2000, 09:43 AM
Pretty quick question, just wondering what the reason for using (or not using) the gl* types.
06-14-2000, 02:57 PM
Pro: portability. In theory, the GLfloat for a platform might actually be a double, though I've never heard of anyone actually doing this.
Con: extra dependency. You have to #include gl.h where you wouldn't otherwise need to. Physics code, file format loaders etc probably want to use the same basic type as your OpenGL rendering code, but there's no reason for them to include the GL header.
Compromise: set up your own typedef for your basic scalar type, and use that everywhere. If GLfloat does change, you'll only have to change the one decl to match.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.