#### Archived

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

# glListBase, Lesson 13

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

## 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 on other sites
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 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]

1. 1
2. 2
Rutin
21
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633736
• Total Posts
3013602
×