Advertisement

GLVoid: why??

Started by August 18, 2000 06:54 AM
7 comments, last by cow_in_the_well 24 years, 4 months ago
ive always been wondering....why do apis have their own definisions of void and boolean and so on? liike in ogl it has GLVoid and in genesis3d geVoid or geBoolean or geFloat...whats the point??? ----------------------------- -cow_in_the_well http://cowswell.gda.ods.org/ "If it's stupid but works, it's not stupid" - Murphey's Law

- Thomas Cowellwebsite | journal | engine video

Umm... To ensure portability I guess... There are so many uncertainties in this world

-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet :)
Advertisement
uhhmmm, how unportable is it to use void or float?? i would think using GLVoid wouldn''t help to ensure portability. void is just plain C/C++!

-----------------------------
-cow_in_the_well

http://cowswell.gda.ods.org/


"If it's stupid but works, it's not stupid" - Murphey's Law

- Thomas Cowellwebsite | journal | engine video

Void may be plain C/C++, but things like ints and shorts ( and perhaps even some floats until recently ) are not actually bound to a certain implementation by the C/C++ standards.

So, if you want to insure that your integer type is a 32 bit integer, you use your own type ( GLint ), and make sure that on every platform/compiler, it''s defined as whatever type will give you a 32 bit integer.


Give me one more medicated peaceful moment.
~ (V)^|) |<é!t|-| ~
ERROR: Your beta-version of Life1.0 has expired. Please upgrade to the full version. All important social functions will be disabled from now on.
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
MadKeithV, and Dwarfsoft are right, this is to ensure maximum portability.
When you''ll learn a bit more about compilers and try to compile your programm on different architectures (Mac, PC, Alpha) or compilers (Borland, GNU, M$), you''ll see that all GL? define are really worth them !

Just my 0.02$

-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
Is GLvoid ever defined as something else than void? If so, on which platform?
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Advertisement
I don''t know, but it''s better to be prepared in case of.

(I''ve not that much experience with other computers than PCs)

-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
quote: Original post by Muzzafarath
Is GLvoid ever defined as something else than void? If so, on which platform?


Probably not in C/C++. I don''t do VB, but since it don''t do pointers (at least, as I understand it) I would think it doesn''t have a void.

At work, we have always had our own type definitions for all base types. We have never compiled on another platform, but we are ready at any time. That''s probably why GLvoid exists, too.

Remember the Boy Scout motto, ''Be prepared.''

Mike Roberts
aka milo
mlbobs@telocity.com
>> Probably not in C/C++. I don''t do VB, but since it don''t do pointers (at least, as I understand it) I would think it doesn''t have a void. <<

You''re right, VB doesn''t have void, but a function that returns nothing in VB is a sub. And (I don''t think) VB does pointers, but I think you can still pass values by reference (ByRef). It''s been so long since I''ve used VB

I also use my own definitions to stay portable (although I don''t plan on compiling my programs for anything else than PCs) and I think it''s nicer to have functions/method that returns byte''s instead of char''s, dword''s instead of ints/longs etc. But I''ve never defined my own type for void, because I figured that void would be the same on every platform... Oh well
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall

This topic is closed to new replies.

Advertisement