1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** 2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * \file texstate.h 3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Texture state management. 4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Mesa 3-D graphics library 8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Version: 7.1 9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. 11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person obtaining a 13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * copy of this software and associated documentation files (the "Software"), 14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * to deal in the Software without restriction, including without limitation 15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * the rights to use, copy, modify, merge, publish, distribute, sublicense, 16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * and/or sell copies of the Software, and to permit persons to whom the 17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Software is furnished to do so, subject to the following conditions: 18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice shall be included 20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * in all copies or substantial portions of the Software. 21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef TEXSTATE_H 32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEXSTATE_H 33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "compiler.h" 36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "mtypes.h" 37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** 40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Return pointer to current texture unit. 41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * This the texture unit set by glActiveTexture(), not glClientActiveTexture(). 42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic inline struct gl_texture_unit * 44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_get_current_tex_unit(struct gl_context *ctx) 45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{ 46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->Texture.Unit)); 47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org return &(ctx->Texture.Unit[ctx->Texture.CurrentUnit]); 48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org} 49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern void 52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_copy_texture_state( const struct gl_context *src, struct gl_context *dst ); 53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern void 55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_print_texunit_state( struct gl_context *ctx, GLuint unit ); 56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** 60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * \name Called from API 61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern void GLAPIENTRY 65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_ActiveTextureARB( GLenum target ); 66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern void GLAPIENTRY 68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_ClientActiveTextureARB( GLenum target ); 69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** 74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * \name Initialization, state maintenance 75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@{*/ 77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern void 79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_update_texture( struct gl_context *ctx, GLuint new_state ); 80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern GLboolean 82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_init_texture( struct gl_context *ctx ); 83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern void 85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_free_texture_data( struct gl_context *ctx ); 86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern void 88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org_mesa_update_default_objects_texture(struct gl_context *ctx); 89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*@}*/ 91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif 93