00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include <glh/glh_extensions.h>
00018
00019 #include "texture.h"
00020
00021 void texActivate(int numTextureObjects, TextureObject *textureObjects)
00022 {
00023 int i;
00024
00025 for (i = 0; i < numTextureObjects; i++) {
00026 glActiveTextureARB(GL_TEXTURE0_ARB + textureObjects[i].texUnit);
00027 glEnable(textureObjects[i].texture.target);
00028 glBindTexture(textureObjects[i].texture.target,
00029 textureObjects[i].texture.id);
00030 }
00031 }
00032
00033 void texDeactivate(int numTextureObjects, TextureObject *textureObjects)
00034 {
00035 int i;
00036
00037 for (i = 0; i < numTextureObjects; i++) {
00038 glActiveTextureARB(GL_TEXTURE0_ARB + textureObjects[i].texUnit);
00039 glDisable(textureObjects[i].texture.target);
00040 }
00041 }