Воскресенье, 2024-05-19
Сборник компьютерных технологий
Меню сайта
Категории раздела
My articles [30]
Статистика

Онлайн всего: 1
Гостей: 1
Пользователей: 0
Главная » Статьи » My articles

glGetAttribLocation в OpenGL. Описание.

Name

glGetAttribLocation — возвращает место в памяти, отведённое под attribute переменную.

C Specification

GLint glGetAttribLocation( GLuint   program,
  const GLchar *  name);

Parameters

program

Specifies the program object to be queried.

name

Points to a null terminated string containing the name of the attribute variable whose location is to be queried.



Description

glGetAttribLocation queries the previously linked program object specified by program for the attribute variable specified by name and returns the index of the generic vertex attribute that is bound to that attribute variable. If name is a matrix attribute variable, the index of the first column of the matrix is returned. If the named attribute variable is not an active attribute in the specified program object or if name starts with the reserved prefix "gl_", a value of -1 is returned.

The association between an attribute variable name and a generic attribute index can be specified at any time by calling glBindAttribLocation. Attribute bindings do not go into effect until glLinkProgram is called. After a program object has been linked successfully, the index values for attribute variables remain fixed until the next link command occurs. The attribute values can only be queried after a link if the link was successful. glGetAttribLocation returns the binding that actually went into effect the last time glLinkProgram was called for the specified program object. Attribute bindings that have been specified since the last link operation are not returned by glGetAttribLocation.


Notes

Функция glGetAttribLocation доступна только для OpenGL 2.0 или лучше.

Errors

GL_INVALID_OPERATION будет сгенерировано, если program не сгенерированное OpenGL значение.

GL_INVALID_OPERATION будет сгенерировано, если program не программный объект.

GL_INVALID_OPERATION iбудет сгенерировано, если program has not been successfully linked.

GL_INVALID_OPERATION будет сгенерировано, если glGetAttribLocation вызывается между glBegin и glEnd.



Copyright

Copyright © 2003-2005 3Dlabs Inc. Ltd. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

Категория: My articles | Добавил: DungeonLords (2010-06-03)
Просмотров: 1373
Всего комментариев: 0
Добавлять комментарии могут только зарегистрированные пользователи.
[ Регистрация | Вход ]
Форма входа
Поиск
Друзья сайта
  • Официальный блог
  • Сообщество uCoz
  • FAQ по системе
  • Инструкции для uCoz
  • Copyright Forcer, Inc © 2024
    Бесплатный конструктор сайтов - uCoz