core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

enable.c File Reference


Detailed Description

Enable/disable/query GL capabilities.

#include "glheader.h"
#include "context.h"
#include "enable.h"
#include "light.h"
#include "macros.h"
#include "simple_list.h"
#include "mtypes.h"
#include "enums.h"
#include "api_arrayelt.h"

Defines

#define CHECK_EXTENSION(EXTNAME, CAP)
#define CHECK_EXTENSION(EXTNAME, CAP)
#define CHECK_EXTENSION2(EXT1, EXT2, CAP)
#define CHECK_EXTENSION(EXTNAME)
#define CHECK_EXTENSION2(EXT1, EXT2)

Functions

static void client_state (GLcontext *ctx, GLenum cap, GLboolean state)
 Helper to enable/disable client-side state.
void GLAPIENTRY _mesa_EnableClientState (GLenum cap)
 Enable GL capability.
void GLAPIENTRY _mesa_DisableClientState (GLenum cap)
 Disable GL capability.
static struct gl_texture_unitget_texcoord_unit (GLcontext *ctx)
 Return pointer to current texture unit for setting/getting coordinate state.
static GLboolean enable_texture (GLcontext *ctx, GLboolean state, GLbitfield texBit)
 Helper function to enable or disable a texture target.
void _mesa_set_enable (GLcontext *ctx, GLenum cap, GLboolean state)
 Helper function to enable or disable state.
void GLAPIENTRY _mesa_Enable (GLenum cap)
 Enable GL capability.
void GLAPIENTRY _mesa_Disable (GLenum cap)
 Disable GL capability.
static GLboolean is_texture_enabled (GLcontext *ctx, GLbitfield bit)
 Helper function to determine whether a texture target is enabled.
GLboolean GLAPIENTRY _mesa_IsEnabled (GLenum cap)
 Return simple enable/disable state.


Define Documentation

#define CHECK_EXTENSION ( EXTNAME   ) 

Value:

if (!ctx->Extensions.EXTNAME) {                 \
      _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled"); \
      return GL_FALSE;                                  \
   }

#define CHECK_EXTENSION ( EXTNAME,
CAP   ) 

Value:

if (!ctx->Extensions.EXTNAME) {                                 \
      _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(0x%x)",                   \
                  state ? "Enable" : "Disable", CAP);                   \
      return;                                                           \
   }

#define CHECK_EXTENSION ( EXTNAME,
CAP   ) 

Value:

if (!ctx->Extensions.EXTNAME) {                                 \
      _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(0x%x)",        \
                  state ? "Enable" : "Disable", CAP);                   \
      return;                                                           \
   }

#define CHECK_EXTENSION2 ( EXT1,
EXT2   ) 

Value:

if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) {   \
      _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled");         \
      return GL_FALSE;                                          \
   }

#define CHECK_EXTENSION2 ( EXT1,
EXT2,
CAP   ) 

Value:

if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) {           \
      _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(0x%x)",                   \
                  state ? "Enable" : "Disable", CAP);                   \
      return;                                                           \
   }


Function Documentation

void GLAPIENTRY _mesa_Disable ( GLenum  cap  ) 

Disable GL capability.

Called by glDisable()

Parameters:
cap state to disable.

void GLAPIENTRY _mesa_DisableClientState ( GLenum  cap  ) 

Disable GL capability.

Parameters:
cap state to enable/disable.
Get's the current context, assures that we're outside glBegin()/glEnd() and calls client_state().

void GLAPIENTRY _mesa_Enable ( GLenum  cap  ) 

Enable GL capability.

Called by glEnable()

Parameters:
cap state to enable.

void GLAPIENTRY _mesa_EnableClientState ( GLenum  cap  ) 

Enable GL capability.

Parameters:
cap state to enable/disable.
Get's the current context, assures that we're outside glBegin()/glEnd() and calls client_state().

GLboolean GLAPIENTRY _mesa_IsEnabled ( GLenum  cap  ) 

Return simple enable/disable state.

Parameters:
cap state variable to query.
Returns the state of the specified capability from the current GL context. For the capabilities associated with extensions verifies that those extensions are effectively present before reporting.

void _mesa_set_enable ( GLcontext ctx,
GLenum  cap,
GLboolean  state 
)

Helper function to enable or disable state.

Parameters:
ctx GL context.
cap the state to enable/disable
state whether to enable or disable the specified capability.
Updates the current context and flushes the vertices as needed. For capabilities associated with extensions it verifies that those extensions are effectivly present before updating. Notifies the driver via dd_function_table::Enable.

static void client_state ( GLcontext ctx,
GLenum  cap,
GLboolean  state 
) [static]

Helper to enable/disable client-side state.

static GLboolean enable_texture ( GLcontext ctx,
GLboolean  state,
GLbitfield  texBit 
) [static]

Helper function to enable or disable a texture target.

Parameters:
bit one of the TEXTURE_x_BIT values
Returns:
GL_TRUE if state is changing or GL_FALSE if no change

static struct gl_texture_unit* get_texcoord_unit ( GLcontext ctx  )  [static, read]

Return pointer to current texture unit for setting/getting coordinate state.

Note that we'll set GL_INVALID_OPERATION if the active texture unit is higher than the number of supported coordinate units. And we'll return NULL.

static GLboolean is_texture_enabled ( GLcontext ctx,
GLbitfield  bit 
) [static]

Helper function to determine whether a texture target is enabled.


Generated on Sun Sep 27 06:47:45 2009 for Mesa Main by  doxygen 1.5.4