Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

HairyTroll

glListBase, Lesson 13

This topic is 5578 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Why is a negative number (base - 32) passed to glListBase in Lesson 13 ? The function prototype for glListBase specifies that it accepts only unsigned integers, therefore the negative bit would be interpreted as a huge positive integer. -Luke

Share this post


Link to post
Share on other sites
Advertisement
For the CallList function to work properly we have to set base list (firts list or the character ''A'') back 32 characters because we did not create the first 32 characters. You see, the alphabet in the ASCII char starts at 65. So, in order to match the ascii values to display list values, we have top set it back by 32 characters, so the first char is 65 like in the ascii way of things. Does that make any sense at all???

Share this post


Link to post
Share on other sites
quote:
Original post by tHiSiSbOb
For the CallList function to work properly we have to set base list (firts list or the character 'A') back 32 characters because we did not create the first 32 characters.


Sure, I understand that much base = 1. (base - 32) = - 31 which is passed to glListBase, in order to offset the ASCII index.

But glListBase takes only an unsigned integer, in other words it does not expect to receive any negative values, only positive integers. So I do not understand how the program still works correctly when it passes a negative value to a function that expects only positive integers.

In my case, calling glListBase (base - 32) does not work. I have to subtract 31 from each ASCII value in the char array before passing the array to glCallLists. Weird.

-Luke

[edited by - HairyTroll on June 17, 2003 5:17:34 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!