updated mesa to 6.5.2
updated the mesa software addon to work again (maybe would need more work) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20137 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+40
-62
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.3
|
||||
* Version: 6.5.1
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -39,7 +39,6 @@
|
||||
#if !defined(__SCITECH_SNAP__)
|
||||
|
||||
#if defined(__BEOS__)
|
||||
#include <BeBuild.h>
|
||||
#include <stdlib.h> /* to get some BeOS-isms */
|
||||
#endif
|
||||
|
||||
@@ -63,6 +62,9 @@
|
||||
#elif defined(__CYGWIN__) && defined(USE_OPENGL32) /* use native windows opengl32 */
|
||||
# define GLAPI extern
|
||||
# define GLAPIENTRY __stdcall
|
||||
#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
|
||||
# define GLAPI __attribute__((visibility("default")))
|
||||
# define GLAPIENTRY
|
||||
#endif /* WIN32 && !CYGWIN */
|
||||
|
||||
#if (defined(__BEOS__) && defined(__POWERPC__)) || defined(__QUICKDRAW__)
|
||||
@@ -102,7 +104,7 @@
|
||||
#define APIENTRY GLAPIENTRY
|
||||
#endif
|
||||
|
||||
/* "P" suffix for when function returns a pointer */
|
||||
/* "P" suffix to be used for a pointer to a function */
|
||||
#ifndef APIENTRYP
|
||||
#define APIENTRYP APIENTRY *
|
||||
#endif
|
||||
@@ -439,16 +441,16 @@ typedef double GLclampd; /* double precision float in [0,1] */
|
||||
#define GL_OR_INVERTED 0x150D
|
||||
|
||||
/* Stencil */
|
||||
#define GL_STENCIL_TEST 0x0B90
|
||||
#define GL_STENCIL_WRITEMASK 0x0B98
|
||||
#define GL_STENCIL_BITS 0x0D57
|
||||
#define GL_STENCIL_TEST 0x0B90
|
||||
#define GL_STENCIL_CLEAR_VALUE 0x0B91
|
||||
#define GL_STENCIL_FUNC 0x0B92
|
||||
#define GL_STENCIL_VALUE_MASK 0x0B93
|
||||
#define GL_STENCIL_REF 0x0B97
|
||||
#define GL_STENCIL_FAIL 0x0B94
|
||||
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
|
||||
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
|
||||
#define GL_STENCIL_CLEAR_VALUE 0x0B91
|
||||
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
|
||||
#define GL_STENCIL_REF 0x0B97
|
||||
#define GL_STENCIL_WRITEMASK 0x0B98
|
||||
#define GL_STENCIL_INDEX 0x1901
|
||||
#define GL_KEEP 0x1E00
|
||||
#define GL_REPLACE 0x1E01
|
||||
@@ -498,16 +500,16 @@ typedef double GLclampd; /* double precision float in [0,1] */
|
||||
|
||||
/* Implementation limits */
|
||||
#define GL_MAX_LIST_NESTING 0x0B31
|
||||
#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
|
||||
#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
|
||||
#define GL_MAX_NAME_STACK_DEPTH 0x0D37
|
||||
#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
|
||||
#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
|
||||
#define GL_MAX_EVAL_ORDER 0x0D30
|
||||
#define GL_MAX_LIGHTS 0x0D31
|
||||
#define GL_MAX_CLIP_PLANES 0x0D32
|
||||
#define GL_MAX_TEXTURE_SIZE 0x0D33
|
||||
#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
|
||||
#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
|
||||
#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
|
||||
#define GL_MAX_NAME_STACK_DEPTH 0x0D37
|
||||
#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
|
||||
#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
|
||||
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
|
||||
#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
|
||||
|
||||
@@ -565,22 +567,22 @@ typedef double GLclampd; /* double precision float in [0,1] */
|
||||
#define GL_MAP2_GRID_DOMAIN 0x0DD2
|
||||
#define GL_MAP2_GRID_SEGMENTS 0x0DD3
|
||||
#define GL_COEFF 0x0A00
|
||||
#define GL_DOMAIN 0x0A02
|
||||
#define GL_ORDER 0x0A01
|
||||
#define GL_DOMAIN 0x0A02
|
||||
|
||||
/* Hints */
|
||||
#define GL_FOG_HINT 0x0C54
|
||||
#define GL_LINE_SMOOTH_HINT 0x0C52
|
||||
#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
|
||||
#define GL_POINT_SMOOTH_HINT 0x0C51
|
||||
#define GL_LINE_SMOOTH_HINT 0x0C52
|
||||
#define GL_POLYGON_SMOOTH_HINT 0x0C53
|
||||
#define GL_FOG_HINT 0x0C54
|
||||
#define GL_DONT_CARE 0x1100
|
||||
#define GL_FASTEST 0x1101
|
||||
#define GL_NICEST 0x1102
|
||||
|
||||
/* Scissor box */
|
||||
#define GL_SCISSOR_TEST 0x0C11
|
||||
#define GL_SCISSOR_BOX 0x0C10
|
||||
#define GL_SCISSOR_TEST 0x0C11
|
||||
|
||||
/* Pixel Mode / Transfer */
|
||||
#define GL_MAP_COLOR 0x0D10
|
||||
@@ -685,8 +687,8 @@ typedef double GLclampd; /* double precision float in [0,1] */
|
||||
|
||||
/* Errors */
|
||||
#define GL_NO_ERROR 0x0
|
||||
#define GL_INVALID_VALUE 0x0501
|
||||
#define GL_INVALID_ENUM 0x0500
|
||||
#define GL_INVALID_VALUE 0x0501
|
||||
#define GL_INVALID_OPERATION 0x0502
|
||||
#define GL_STACK_OVERFLOW 0x0503
|
||||
#define GL_STACK_UNDERFLOW 0x0504
|
||||
@@ -851,7 +853,7 @@ GLAPI GLint GLAPIENTRY glRenderMode( GLenum mode );
|
||||
|
||||
GLAPI GLenum GLAPIENTRY glGetError( void );
|
||||
|
||||
GLAPI const GLubyte GLAPIENTRYP glGetString( GLenum name );
|
||||
GLAPI const GLubyte * GLAPIENTRY glGetString( GLenum name );
|
||||
|
||||
GLAPI void GLAPIENTRY glFinish( void );
|
||||
|
||||
@@ -2150,35 +2152,24 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ???. GL_MESA_trace
|
||||
* XXX obsolete
|
||||
*/
|
||||
#ifndef GL_MESA_trace
|
||||
#define GL_MESA_trace 1
|
||||
#if GL_ARB_shader_objects
|
||||
|
||||
#define GL_TRACE_ALL_BITS_MESA 0xFFFF
|
||||
#define GL_TRACE_OPERATIONS_BIT_MESA 0x0001
|
||||
#define GL_TRACE_PRIMITIVES_BIT_MESA 0x0002
|
||||
#define GL_TRACE_ARRAYS_BIT_MESA 0x0004
|
||||
#define GL_TRACE_TEXTURES_BIT_MESA 0x0008
|
||||
#define GL_TRACE_PIXELS_BIT_MESA 0x0010
|
||||
#define GL_TRACE_ERRORS_BIT_MESA 0x0020
|
||||
#define GL_TRACE_MASK_MESA 0x8755
|
||||
#define GL_TRACE_NAME_MESA 0x8756
|
||||
#ifndef GL_MESA_shader_debug
|
||||
#define GL_MESA_shader_debug 1
|
||||
|
||||
GLAPI void GLAPIENTRY glEnableTraceMESA( GLbitfield mask );
|
||||
GLAPI void GLAPIENTRY glDisableTraceMESA( GLbitfield mask );
|
||||
GLAPI void GLAPIENTRY glNewTraceMESA( GLbitfield mask, const GLubyte * traceName );
|
||||
GLAPI void GLAPIENTRY glEndTraceMESA( void );
|
||||
GLAPI void GLAPIENTRY glTraceAssertAttribMESA( GLbitfield attribMask );
|
||||
GLAPI void GLAPIENTRY glTraceCommentMESA( const GLubyte * comment );
|
||||
GLAPI void GLAPIENTRY glTraceTextureMESA( GLuint name, const GLubyte* comment );
|
||||
GLAPI void GLAPIENTRY glTraceListMESA( GLuint name, const GLubyte* comment );
|
||||
GLAPI void GLAPIENTRY glTracePointerMESA( GLvoid* pointer, const GLubyte* comment );
|
||||
GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid* last, const GLubyte* comment );
|
||||
#define GL_DEBUG_OBJECT_MESA 0x8759
|
||||
#define GL_DEBUG_PRINT_MESA 0x875A
|
||||
#define GL_DEBUG_ASSERT_MESA 0x875B
|
||||
|
||||
#endif /* GL_MESA_trace */
|
||||
GLAPI GLhandleARB APIENTRY glCreateDebugObjectMESA (void);
|
||||
GLAPI void APIENTRY glClearDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
|
||||
GLAPI void APIENTRY glGetDebugLogMESA (GLhandleARB obj, GLenum logType, GLenum shaderType, GLsizei maxLength,
|
||||
GLsizei *length, GLcharARB *debugLog);
|
||||
GLAPI GLsizei APIENTRY glGetDebugLogLengthMESA (GLhandleARB obj, GLenum logType, GLenum shaderType);
|
||||
|
||||
#endif /* GL_MESA_shader_debug */
|
||||
|
||||
#endif /* GL_ARB_shader_objects */
|
||||
|
||||
|
||||
/*
|
||||
@@ -2211,13 +2202,9 @@ GLAPI void GLAPIENTRY glTracePointerRangeMESA( const GLvoid* first, const GLvoid
|
||||
|
||||
typedef void (*GLprogramcallbackMESA)(GLenum target, GLvoid *data);
|
||||
|
||||
extern void
|
||||
glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback,
|
||||
GLvoid *data);
|
||||
GLAPI void GLAPIENTRY glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, GLvoid *data);
|
||||
|
||||
extern void
|
||||
glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name,
|
||||
GLfloat *v);
|
||||
GLAPI void GLAPIENTRY glGetProgramRegisterfvMESA(GLenum target, GLsizei len, const GLubyte *name, GLfloat *v);
|
||||
|
||||
#endif /* GL_MESA_program_debug */
|
||||
|
||||
@@ -2233,16 +2220,6 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
|
||||
#endif /* GL_ATI_blend_equation_separate */
|
||||
|
||||
|
||||
/* As soon as the official glext.h is updated to include this, it will be
|
||||
* removed from here.
|
||||
*/
|
||||
#ifndef GL_OES_read_format
|
||||
#define GL_OES_read_format 1
|
||||
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
|
||||
|
||||
#endif /* GL_OES_read_format */
|
||||
|
||||
/**
|
||||
** NOTE!!!!! If you add new functions to this file, or update
|
||||
@@ -2251,6 +2228,7 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLen
|
||||
**/
|
||||
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* Begin system-specific stuff
|
||||
*/
|
||||
|
||||
@@ -52,9 +52,9 @@ extern "C" {
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number, required by OpenGL ABI for Linux */
|
||||
/* glext.h last updated 2004/7/26 */
|
||||
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
|
||||
#define GL_GLEXT_VERSION 24
|
||||
/* glext.h last updated 2006/08/30 */
|
||||
/* Current version at http://www.opengl.org/registry/ */
|
||||
#define GL_GLEXT_VERSION 34
|
||||
|
||||
#ifndef GL_VERSION_1_2
|
||||
#define GL_UNSIGNED_BYTE_3_3_2 0x8032
|
||||
@@ -372,6 +372,119 @@ extern "C" {
|
||||
#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_2_0
|
||||
#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
|
||||
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
|
||||
#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
|
||||
#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
|
||||
#define GL_STENCIL_BACK_FUNC 0x8800
|
||||
#define GL_STENCIL_BACK_FAIL 0x8801
|
||||
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
|
||||
#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
|
||||
#define GL_MAX_DRAW_BUFFERS 0x8824
|
||||
#define GL_DRAW_BUFFER0 0x8825
|
||||
#define GL_DRAW_BUFFER1 0x8826
|
||||
#define GL_DRAW_BUFFER2 0x8827
|
||||
#define GL_DRAW_BUFFER3 0x8828
|
||||
#define GL_DRAW_BUFFER4 0x8829
|
||||
#define GL_DRAW_BUFFER5 0x882A
|
||||
#define GL_DRAW_BUFFER6 0x882B
|
||||
#define GL_DRAW_BUFFER7 0x882C
|
||||
#define GL_DRAW_BUFFER8 0x882D
|
||||
#define GL_DRAW_BUFFER9 0x882E
|
||||
#define GL_DRAW_BUFFER10 0x882F
|
||||
#define GL_DRAW_BUFFER11 0x8830
|
||||
#define GL_DRAW_BUFFER12 0x8831
|
||||
#define GL_DRAW_BUFFER13 0x8832
|
||||
#define GL_DRAW_BUFFER14 0x8833
|
||||
#define GL_DRAW_BUFFER15 0x8834
|
||||
#define GL_BLEND_EQUATION_ALPHA 0x883D
|
||||
#define GL_POINT_SPRITE 0x8861
|
||||
#define GL_COORD_REPLACE 0x8862
|
||||
#define GL_MAX_VERTEX_ATTRIBS 0x8869
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
|
||||
#define GL_MAX_TEXTURE_COORDS 0x8871
|
||||
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
|
||||
#define GL_FRAGMENT_SHADER 0x8B30
|
||||
#define GL_VERTEX_SHADER 0x8B31
|
||||
#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
|
||||
#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
|
||||
#define GL_MAX_VARYING_FLOATS 0x8B4B
|
||||
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
|
||||
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
|
||||
#define GL_SHADER_TYPE 0x8B4F
|
||||
#define GL_FLOAT_VEC2 0x8B50
|
||||
#define GL_FLOAT_VEC3 0x8B51
|
||||
#define GL_FLOAT_VEC4 0x8B52
|
||||
#define GL_INT_VEC2 0x8B53
|
||||
#define GL_INT_VEC3 0x8B54
|
||||
#define GL_INT_VEC4 0x8B55
|
||||
#define GL_BOOL 0x8B56
|
||||
#define GL_BOOL_VEC2 0x8B57
|
||||
#define GL_BOOL_VEC3 0x8B58
|
||||
#define GL_BOOL_VEC4 0x8B59
|
||||
#define GL_FLOAT_MAT2 0x8B5A
|
||||
#define GL_FLOAT_MAT3 0x8B5B
|
||||
#define GL_FLOAT_MAT4 0x8B5C
|
||||
#define GL_SAMPLER_1D 0x8B5D
|
||||
#define GL_SAMPLER_2D 0x8B5E
|
||||
#define GL_SAMPLER_3D 0x8B5F
|
||||
#define GL_SAMPLER_CUBE 0x8B60
|
||||
#define GL_SAMPLER_1D_SHADOW 0x8B61
|
||||
#define GL_SAMPLER_2D_SHADOW 0x8B62
|
||||
#define GL_DELETE_STATUS 0x8B80
|
||||
#define GL_COMPILE_STATUS 0x8B81
|
||||
#define GL_LINK_STATUS 0x8B82
|
||||
#define GL_VALIDATE_STATUS 0x8B83
|
||||
#define GL_INFO_LOG_LENGTH 0x8B84
|
||||
#define GL_ATTACHED_SHADERS 0x8B85
|
||||
#define GL_ACTIVE_UNIFORMS 0x8B86
|
||||
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
|
||||
#define GL_SHADER_SOURCE_LENGTH 0x8B88
|
||||
#define GL_ACTIVE_ATTRIBUTES 0x8B89
|
||||
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
|
||||
#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
|
||||
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
|
||||
#define GL_CURRENT_PROGRAM 0x8B8D
|
||||
#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
|
||||
#define GL_LOWER_LEFT 0x8CA1
|
||||
#define GL_UPPER_LEFT 0x8CA2
|
||||
#define GL_STENCIL_BACK_REF 0x8CA3
|
||||
#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
|
||||
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_2_1
|
||||
#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
|
||||
#define GL_PIXEL_PACK_BUFFER 0x88EB
|
||||
#define GL_PIXEL_UNPACK_BUFFER 0x88EC
|
||||
#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
|
||||
#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
|
||||
#define GL_FLOAT_MAT2x3 0x8B65
|
||||
#define GL_FLOAT_MAT2x4 0x8B66
|
||||
#define GL_FLOAT_MAT3x2 0x8B67
|
||||
#define GL_FLOAT_MAT3x4 0x8B68
|
||||
#define GL_FLOAT_MAT4x2 0x8B69
|
||||
#define GL_FLOAT_MAT4x3 0x8B6A
|
||||
#define GL_SRGB 0x8C40
|
||||
#define GL_SRGB8 0x8C41
|
||||
#define GL_SRGB_ALPHA 0x8C42
|
||||
#define GL_SRGB8_ALPHA8 0x8C43
|
||||
#define GL_SLUMINANCE_ALPHA 0x8C44
|
||||
#define GL_SLUMINANCE8_ALPHA8 0x8C45
|
||||
#define GL_SLUMINANCE 0x8C46
|
||||
#define GL_SLUMINANCE8 0x8C47
|
||||
#define GL_COMPRESSED_SRGB 0x8C48
|
||||
#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
|
||||
#define GL_COMPRESSED_SLUMINANCE 0x8C4A
|
||||
#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_multitexture
|
||||
#define GL_TEXTURE0_ARB 0x84C0
|
||||
#define GL_TEXTURE1_ARB 0x84C1
|
||||
@@ -825,6 +938,48 @@ extern "C" {
|
||||
#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_color_buffer_float
|
||||
#define GL_RGBA_FLOAT_MODE_ARB 0x8820
|
||||
#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
|
||||
#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
|
||||
#define GL_CLAMP_READ_COLOR_ARB 0x891C
|
||||
#define GL_FIXED_ONLY_ARB 0x891D
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_half_float_pixel
|
||||
#define GL_HALF_FLOAT_ARB 0x140B
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_float
|
||||
#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
|
||||
#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
|
||||
#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
|
||||
#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
|
||||
#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
|
||||
#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
|
||||
#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
|
||||
#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
|
||||
#define GL_RGBA32F_ARB 0x8814
|
||||
#define GL_RGB32F_ARB 0x8815
|
||||
#define GL_ALPHA32F_ARB 0x8816
|
||||
#define GL_INTENSITY32F_ARB 0x8817
|
||||
#define GL_LUMINANCE32F_ARB 0x8818
|
||||
#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
|
||||
#define GL_RGBA16F_ARB 0x881A
|
||||
#define GL_RGB16F_ARB 0x881B
|
||||
#define GL_ALPHA16F_ARB 0x881C
|
||||
#define GL_INTENSITY16F_ARB 0x881D
|
||||
#define GL_LUMINANCE16F_ARB 0x881E
|
||||
#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_pixel_buffer_object
|
||||
#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
|
||||
#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
|
||||
#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
|
||||
#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_abgr
|
||||
#define GL_ABGR_EXT 0x8000
|
||||
#endif
|
||||
@@ -2793,6 +2948,11 @@ extern "C" {
|
||||
#ifndef GL_ATI_vertex_attrib_array_object
|
||||
#endif
|
||||
|
||||
#ifndef GL_OES_read_format
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_depth_bounds_test
|
||||
#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
|
||||
#define GL_DEPTH_BOUNDS_EXT 0x8891
|
||||
@@ -2846,10 +3006,131 @@ extern "C" {
|
||||
/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_object
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
|
||||
#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
|
||||
#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
|
||||
#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
|
||||
#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
|
||||
#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
|
||||
#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
|
||||
#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
|
||||
#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
|
||||
#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
|
||||
#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
|
||||
#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
|
||||
#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
|
||||
#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
|
||||
#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
|
||||
#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
|
||||
#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
|
||||
#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
|
||||
#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
|
||||
#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
|
||||
#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
|
||||
#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
|
||||
#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
|
||||
#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
|
||||
#define GL_FRAMEBUFFER_EXT 0x8D40
|
||||
#define GL_RENDERBUFFER_EXT 0x8D41
|
||||
#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
|
||||
#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
|
||||
#define GL_STENCIL_INDEX1_EXT 0x8D46
|
||||
#define GL_STENCIL_INDEX4_EXT 0x8D47
|
||||
#define GL_STENCIL_INDEX8_EXT 0x8D48
|
||||
#define GL_STENCIL_INDEX16_EXT 0x8D49
|
||||
#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
|
||||
#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
|
||||
#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
|
||||
#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
|
||||
#endif
|
||||
|
||||
#ifndef GL_GREMEDY_string_marker
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_packed_depth_stencil
|
||||
#define GL_DEPTH_STENCIL_EXT 0x84F9
|
||||
#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
|
||||
#define GL_DEPTH24_STENCIL8_EXT 0x88F0
|
||||
#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_stencil_clear_tag
|
||||
#define GL_STENCIL_TAG_BITS_EXT 0x88F2
|
||||
#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_sRGB
|
||||
#define GL_SRGB_EXT 0x8C40
|
||||
#define GL_SRGB8_EXT 0x8C41
|
||||
#define GL_SRGB_ALPHA_EXT 0x8C42
|
||||
#define GL_SRGB8_ALPHA8_EXT 0x8C43
|
||||
#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
|
||||
#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
|
||||
#define GL_SLUMINANCE_EXT 0x8C46
|
||||
#define GL_SLUMINANCE8_EXT 0x8C47
|
||||
#define GL_COMPRESSED_SRGB_EXT 0x8C48
|
||||
#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
|
||||
#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
|
||||
#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
|
||||
#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
|
||||
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
|
||||
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
|
||||
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_blit
|
||||
#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
|
||||
#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
|
||||
#define GL_READ_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT
|
||||
#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CAA
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_multisample
|
||||
#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
|
||||
#endif
|
||||
|
||||
#ifndef GL_MESAX_texture_stack
|
||||
#define GL_TEXTURE_1D_STACK_MESAX 0x8759
|
||||
#define GL_TEXTURE_2D_STACK_MESAX 0x875A
|
||||
#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
|
||||
#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
|
||||
#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
|
||||
#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_timer_query
|
||||
#define GL_TIME_ELAPSED_EXT 0x88BF
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_gpu_program_parameters
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
#include <stddef.h>
|
||||
#ifndef GL_VERSION_2_0
|
||||
/* GL type for program/shader text */
|
||||
typedef char GLchar; /* native character */
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_5
|
||||
/* GL types for handling large vertex buffer objects */
|
||||
typedef ptrdiff_t GLintptr;
|
||||
@@ -2863,16 +3144,62 @@ typedef ptrdiff_t GLsizeiptrARB;
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_shader_objects
|
||||
/* GL types for handling shader object handles and characters */
|
||||
/* GL types for handling shader object handles and program/shader text */
|
||||
typedef char GLcharARB; /* native character */
|
||||
typedef unsigned int GLhandleARB; /* shader object handle */
|
||||
#endif
|
||||
|
||||
/* GL types for "half" precision (s10e5) float data in host memory */
|
||||
#ifndef GL_ARB_half_float_pixel
|
||||
typedef unsigned short GLhalfARB;
|
||||
#endif
|
||||
|
||||
#ifndef GL_NV_half_float
|
||||
/* GL type for representing NVIDIA "half" floating point type in host memory */
|
||||
typedef unsigned short GLhalfNV;
|
||||
#endif
|
||||
|
||||
#ifndef GLEXT_64_TYPES_DEFINED
|
||||
/* This code block is duplicated in glext.h, so must be protected */
|
||||
#define GLEXT_64_TYPES_DEFINED
|
||||
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
|
||||
/* (as used in the GLX_OML_sync_control extension). */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#include <inttypes.h>
|
||||
#elif defined(__sun__)
|
||||
#include <inttypes.h>
|
||||
#if defined(__STDC__)
|
||||
#if defined(__arch64__)
|
||||
typedef long int int64_t;
|
||||
typedef unsigned long int uint64_t;
|
||||
#else
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#endif /* __STDC__ */
|
||||
#elif defined( __VMS )
|
||||
#include <inttypes.h>
|
||||
#elif defined(__SCO__) || defined(__USLC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(__UNIXOS2__) || defined(__SOL64__)
|
||||
typedef long int int32_t;
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#elif defined(WIN32) && defined(_MSC_VER)
|
||||
typedef long int int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#elif defined(WIN32) && defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#include <inttypes.h> /* Fallback option */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_timer_query
|
||||
typedef int64_t GLint64EXT;
|
||||
typedef uint64_t GLuint64EXT;
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_1_2
|
||||
#define GL_VERSION_1_2 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
@@ -3193,6 +3520,216 @@ typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pn
|
||||
typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params);
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_2_0
|
||||
#define GL_VERSION_2_0 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum);
|
||||
GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *);
|
||||
GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum);
|
||||
GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint);
|
||||
GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glAttachShader (GLuint, GLuint);
|
||||
GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *);
|
||||
GLAPI void APIENTRY glCompileShader (GLuint);
|
||||
GLAPI GLuint APIENTRY glCreateProgram (void);
|
||||
GLAPI GLuint APIENTRY glCreateShader (GLenum);
|
||||
GLAPI void APIENTRY glDeleteProgram (GLuint);
|
||||
GLAPI void APIENTRY glDeleteShader (GLuint);
|
||||
GLAPI void APIENTRY glDetachShader (GLuint, GLuint);
|
||||
GLAPI void APIENTRY glDisableVertexAttribArray (GLuint);
|
||||
GLAPI void APIENTRY glEnableVertexAttribArray (GLuint);
|
||||
GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
|
||||
GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *);
|
||||
GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *);
|
||||
GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *);
|
||||
GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
|
||||
GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *);
|
||||
GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *);
|
||||
GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *);
|
||||
GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *);
|
||||
GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *);
|
||||
GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *);
|
||||
GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *);
|
||||
GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *);
|
||||
GLAPI GLboolean APIENTRY glIsProgram (GLuint);
|
||||
GLAPI GLboolean APIENTRY glIsShader (GLuint);
|
||||
GLAPI void APIENTRY glLinkProgram (GLuint);
|
||||
GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *);
|
||||
GLAPI void APIENTRY glUseProgram (GLuint);
|
||||
GLAPI void APIENTRY glUniform1f (GLint, GLfloat);
|
||||
GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glUniform1i (GLint, GLint);
|
||||
GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint);
|
||||
GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *);
|
||||
GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *);
|
||||
GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *);
|
||||
GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *);
|
||||
GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *);
|
||||
GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glValidateProgram (GLuint);
|
||||
GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble);
|
||||
GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *);
|
||||
GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat);
|
||||
GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *);
|
||||
GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort);
|
||||
GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *);
|
||||
GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble);
|
||||
GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *);
|
||||
GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *);
|
||||
GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort);
|
||||
GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *);
|
||||
GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble);
|
||||
GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *);
|
||||
GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *);
|
||||
GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort);
|
||||
GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *);
|
||||
GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *);
|
||||
GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *);
|
||||
GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte);
|
||||
GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *);
|
||||
GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *);
|
||||
GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *);
|
||||
GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble);
|
||||
GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *);
|
||||
GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat);
|
||||
GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *);
|
||||
GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *);
|
||||
GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort);
|
||||
GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *);
|
||||
GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *);
|
||||
GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *);
|
||||
GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *);
|
||||
GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
|
||||
typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs);
|
||||
typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
|
||||
typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
|
||||
typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
|
||||
typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
|
||||
typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
|
||||
typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
|
||||
typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
|
||||
typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
|
||||
typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
|
||||
typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
|
||||
typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
|
||||
typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj);
|
||||
typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
|
||||
typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
|
||||
typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer);
|
||||
typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
|
||||
typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
|
||||
typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
|
||||
typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length);
|
||||
typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v);
|
||||
typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
|
||||
#endif
|
||||
|
||||
#ifndef GL_VERSION_2_1
|
||||
#define GL_VERSION_2_1 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glUniformMatrix2x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glUniformMatrix3x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glUniformMatrix2x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glUniformMatrix4x2fv (GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glUniformMatrix3x4fv (GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
GLAPI void APIENTRY glUniformMatrix4x3fv (GLint, GLsizei, GLboolean, const GLfloat *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_multitexture
|
||||
#define GL_ARB_multitexture 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
@@ -3752,6 +4289,26 @@ typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs)
|
||||
#define GL_ARB_texture_rectangle 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_color_buffer_float
|
||||
#define GL_ARB_color_buffer_float 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glClampColorARB (GLenum, GLenum);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_half_float_pixel
|
||||
#define GL_ARB_half_float_pixel 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_texture_float
|
||||
#define GL_ARB_texture_float 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_pixel_buffer_object
|
||||
#define GL_ARB_pixel_buffer_object 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_abgr
|
||||
#define GL_EXT_abgr 1
|
||||
#endif
|
||||
@@ -3880,8 +4437,8 @@ typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum f
|
||||
typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_color_matrix
|
||||
#define GL_EXT_color_matrix 1
|
||||
#ifndef GL_SGI_color_matrix
|
||||
#define GL_SGI_color_matrix 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_SGI_color_table
|
||||
@@ -5741,12 +6298,12 @@ typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint);
|
||||
GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, GLuint *);
|
||||
GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
|
||||
typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
|
||||
typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays);
|
||||
typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays);
|
||||
typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
|
||||
#endif
|
||||
|
||||
@@ -5974,6 +6531,10 @@ typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index,
|
||||
typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params);
|
||||
#endif
|
||||
|
||||
#ifndef GL_OES_read_format
|
||||
#define GL_OES_read_format 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_depth_bounds_test
|
||||
#define GL_EXT_depth_bounds_test 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
@@ -6022,6 +6583,110 @@ typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLen
|
||||
#define GL_NV_vertex_program3 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_object
|
||||
#define GL_EXT_framebuffer_object 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint);
|
||||
GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *);
|
||||
GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei);
|
||||
GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *);
|
||||
GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint);
|
||||
GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint);
|
||||
GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *);
|
||||
GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *);
|
||||
GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum);
|
||||
GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint);
|
||||
GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint);
|
||||
GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *);
|
||||
GLAPI void APIENTRY glGenerateMipmapEXT (GLenum);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers);
|
||||
typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers);
|
||||
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
|
||||
typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
|
||||
typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers);
|
||||
typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers);
|
||||
typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
|
||||
typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
|
||||
#endif
|
||||
|
||||
#ifndef GL_GREMEDY_string_marker
|
||||
#define GL_GREMEDY_string_marker 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_packed_depth_stencil
|
||||
#define GL_EXT_packed_depth_stencil 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_stencil_clear_tag
|
||||
#define GL_EXT_stencil_clear_tag 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glStencilClearTagEXT (GLsizei, GLuint);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_texture_sRGB
|
||||
#define GL_EXT_texture_sRGB 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_blit
|
||||
#define GL_EXT_framebuffer_blit 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_framebuffer_multisample
|
||||
#define GL_EXT_framebuffer_multisample 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
#endif
|
||||
|
||||
#ifndef GL_MESAX_texture_stack
|
||||
#define GL_MESAX_texture_stack 1
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_timer_query
|
||||
#define GL_EXT_timer_query 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint, GLenum, GLint64EXT *);
|
||||
GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint, GLenum, GLuint64EXT *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
|
||||
typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
|
||||
#endif
|
||||
|
||||
#ifndef GL_EXT_gpu_program_parameters
|
||||
#define GL_EXT_gpu_program_parameters 1
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
|
||||
GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum, GLuint, GLsizei, const GLfloat *);
|
||||
#endif /* GL_GLEXT_PROTOTYPES */
|
||||
typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
|
||||
typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
#ifndef __glu_h__
|
||||
#define __glu_h__
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#include "glu_mangle.h"
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
|
||||
#ifndef GLAPIENTRY
|
||||
@@ -41,9 +45,12 @@
|
||||
#endif
|
||||
|
||||
#ifndef GLAPI
|
||||
#define GLAPI _IMPEXP_GL
|
||||
#define GLAPI
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
@@ -250,17 +257,16 @@
|
||||
class GLUnurbs;
|
||||
class GLUquadric;
|
||||
class GLUtesselator;
|
||||
extern "C" {
|
||||
#else
|
||||
typedef struct GLUnurbs GLUnurbs;
|
||||
typedef struct GLUquadric GLUquadric;
|
||||
typedef struct GLUtesselator GLUtesselator;
|
||||
#endif
|
||||
|
||||
typedef struct GLUnurbs GLUnurbsObj;
|
||||
typedef struct GLUquadric GLUquadricObj;
|
||||
typedef struct GLUtesselator GLUtesselatorObj;
|
||||
typedef struct GLUtesselator GLUtriangulatorObj;
|
||||
typedef GLUnurbs GLUnurbsObj;
|
||||
typedef GLUquadric GLUquadricObj;
|
||||
typedef GLUtesselator GLUtesselatorObj;
|
||||
typedef GLUtesselator GLUtriangulatorObj;
|
||||
|
||||
#define GLU_TESS_MAX_COORD 1.0e150
|
||||
|
||||
|
||||
@@ -193,13 +193,11 @@ WGLAPI int GLAPIENTRY SetPixelFormat(HDC,int,const PIXELFORMATDESCRIPTOR *);
|
||||
#else /* _WIN32 not defined */
|
||||
|
||||
/* Define GLUTAPIENTRY and GLUTCALLBACK to nothing if we aren't on Win32. */
|
||||
# define GLUTAPIENTRY
|
||||
# define GLUTAPIENTRY GLAPIENTRY
|
||||
# define GLUTAPIENTRYV
|
||||
# define GLUT_APIENTRY_DEFINED
|
||||
# define GLUTCALLBACK
|
||||
# define GLUTAPI extern
|
||||
/* Prototype exit for the non-Win32 case (see above). */
|
||||
/*extern void exit(int); this screws up gcc -ansi -pedantic! */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -747,26 +745,4 @@ GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#ifdef GLUT_APIENTRY_DEFINED
|
||||
# undef GLUT_APIENTRY_DEFINED
|
||||
# undef APIENTRY
|
||||
#endif
|
||||
|
||||
#ifdef GLUT_WINGDIAPI_DEFINED
|
||||
# undef GLUT_WINGDIAPI_DEFINED
|
||||
# undef WINGDIAPI
|
||||
#endif
|
||||
|
||||
#ifdef GLUT_DEFINED___CDECL
|
||||
# undef GLUT_DEFINED___CDECL
|
||||
# undef __cdecl
|
||||
#endif
|
||||
|
||||
#ifdef GLUT_DEFINED__CRTIMP
|
||||
# undef GLUT_DEFINED__CRTIMP
|
||||
# undef _CRTIMP
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __glut_h__ */
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* $XFree86: xc/lib/GL/include/GL/internal/glcore.h,v 1.7 2001/03/25 05:32:00 tsi Exp $ */
|
||||
#ifndef __gl_core_h_
|
||||
#define __gl_core_h_
|
||||
|
||||
@@ -37,9 +36,7 @@
|
||||
**
|
||||
*/
|
||||
|
||||
#ifndef XFree86LOADER
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef CAPI
|
||||
#undef CAPI
|
||||
@@ -64,12 +61,18 @@ typedef struct __GLinterfaceRec __GLinterface;
|
||||
** and used by the "operating system".
|
||||
*/
|
||||
|
||||
/*
|
||||
** Mode and limit information for a context. This information is
|
||||
** kept around in the context so that values can be used during
|
||||
** command execution, and for returning information about the
|
||||
** context to the application.
|
||||
*/
|
||||
/**
|
||||
* Mode and limit information for a context. This information is
|
||||
* kept around in the context so that values can be used during
|
||||
* command execution, and for returning information about the
|
||||
* context to the application.
|
||||
*
|
||||
* Instances of this structure are shared by the driver and the loader. To
|
||||
* maintain binary compatability, new fields \b must be added only to the
|
||||
* end of the structure.
|
||||
*
|
||||
* \sa _gl_context_modes_create
|
||||
*/
|
||||
typedef struct __GLcontextModesRec {
|
||||
struct __GLcontextModesRec * next;
|
||||
|
||||
@@ -137,6 +140,13 @@ typedef struct __GLcontextModesRec {
|
||||
GLint swapMethod;
|
||||
|
||||
GLint screen;
|
||||
|
||||
/* EXT_texture_from_pixmap */
|
||||
GLint bindToTextureRgb;
|
||||
GLint bindToTextureRgba;
|
||||
GLint bindToMipmapTexture;
|
||||
GLint bindToTextureTargets;
|
||||
GLint yInverted;
|
||||
} __GLcontextModes;
|
||||
|
||||
/* Several fields of __GLcontextModes can take these as values. Since
|
||||
@@ -166,6 +176,17 @@ typedef struct __GLcontextModesRec {
|
||||
#define GLX_PIXMAP_BIT 0x00000002
|
||||
#define GLX_PBUFFER_BIT 0x00000004
|
||||
|
||||
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
|
||||
#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
|
||||
#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
|
||||
#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
|
||||
#define GLX_Y_INVERTED_EXT 0x20D4
|
||||
|
||||
#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
|
||||
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
|
||||
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
/*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,10 @@
|
||||
/*
|
||||
* Copyright 2006, Haiku. All rights reserved.
|
||||
* Copyright 2006-2007, Haiku. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Jérôme Duval, [email protected]
|
||||
* Philippe Houdoin, [email protected]
|
||||
*/
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
@@ -38,120 +42,69 @@ private:
|
||||
static const GLubyte * GetString(GLcontext *ctx, GLenum name);
|
||||
static void Viewport(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h);
|
||||
static void UpdateState(GLcontext *ctx, GLuint new_state);
|
||||
static void GetBufferSize(GLframebuffer * framebuffer, GLuint *width,
|
||||
GLuint *height);
|
||||
static void SetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
|
||||
GLenum mode);
|
||||
static void ClearFront(GLcontext *ctx, GLboolean all, GLint x, GLint y,
|
||||
GLint width, GLint height);
|
||||
static void ClearBack(GLcontext *ctx, GLboolean all, GLint x, GLint y,
|
||||
GLint width, GLint height);
|
||||
static void ClearFront(GLcontext *ctx);
|
||||
static void ClearBack(GLcontext *ctx);
|
||||
static void ClearIndex(GLcontext *ctx, GLuint index);
|
||||
static void ClearColor(GLcontext *ctx, const GLfloat color[4]);
|
||||
static void Clear(GLcontext *ctx, GLbitfield mask,
|
||||
GLboolean all, GLint x, GLint y,
|
||||
GLint width, GLint height);
|
||||
static void Clear(GLcontext *ctx, GLbitfield mask);
|
||||
static GLboolean RenderbufferStorage(GLcontext *ctx, struct gl_renderbuffer *render,
|
||||
GLenum internalFormat, GLuint width, GLuint height );
|
||||
|
||||
// Front-buffer functions
|
||||
static void WriteRGBASpanFront(const GLcontext *ctx, GLuint n,
|
||||
// Buffer functions
|
||||
static void WriteRGBASpan(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
|
||||
GLint x, GLint y,
|
||||
CONST GLubyte rgba[][4],
|
||||
const void *values,
|
||||
const GLubyte mask[]);
|
||||
static void WriteRGBSpanFront(const GLcontext *ctx, GLuint n,
|
||||
static void WriteRGBSpan(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
|
||||
GLint x, GLint y,
|
||||
CONST GLubyte rgba[][3],
|
||||
const void *values,
|
||||
const GLubyte mask[]);
|
||||
static void WriteMonoRGBASpanFront(const GLcontext *ctx, GLuint n,
|
||||
static void WriteMonoRGBASpan(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
|
||||
GLint x, GLint y,
|
||||
const GLchan color[4],
|
||||
const void *values,
|
||||
const GLubyte mask[]);
|
||||
static void WriteRGBAPixelsFront(const GLcontext *ctx, GLuint n,
|
||||
static void WriteRGBAPixels(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
CONST GLubyte rgba[][4],
|
||||
const void *values,
|
||||
const GLubyte mask[]);
|
||||
static void WriteMonoRGBAPixelsFront(const GLcontext *ctx, GLuint n,
|
||||
static void WriteMonoRGBAPixels(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const GLchan color[4],
|
||||
const void *values,
|
||||
const GLubyte mask[]);
|
||||
static void WriteCI32SpanFront(const GLcontext *ctx, GLuint n,
|
||||
static void WriteCI32Span(const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
|
||||
GLint x, GLint y,
|
||||
const GLuint index[], const GLubyte mask[]);
|
||||
static void WriteCI8SpanFront(const GLcontext *ctx, GLuint n,
|
||||
static void WriteCI8Span(const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
|
||||
GLint x, GLint y,
|
||||
const GLubyte index[], const GLubyte mask[]);
|
||||
static void WriteMonoCISpanFront(const GLcontext *ctx, GLuint n,
|
||||
static void WriteMonoCISpan(const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
|
||||
GLint x, GLint y,
|
||||
GLuint colorIndex, const GLubyte mask[]);
|
||||
static void WriteCI32PixelsFront(const GLcontext *ctx,
|
||||
static void WriteCI32Pixels(const GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const GLuint index[], const GLubyte mask[]);
|
||||
static void WriteMonoCIPixelsFront(const GLcontext *ctx, GLuint n,
|
||||
static void WriteMonoCIPixels(const GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
GLuint colorIndex, const GLubyte mask[]);
|
||||
static void ReadCI32SpanFront(const GLcontext *ctx,
|
||||
static void ReadCI32Span(const GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, GLint x, GLint y, GLuint index[]);
|
||||
static void ReadRGBASpanFront(const GLcontext *ctx, GLuint n,
|
||||
static void ReadRGBASpan(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint n,
|
||||
GLint x, GLint y,
|
||||
GLubyte rgba[][4]);
|
||||
static void ReadCI32PixelsFront(const GLcontext *ctx,
|
||||
void *values);
|
||||
static void ReadCI32Pixels(const GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLuint indx[], const GLubyte mask[]);
|
||||
static void ReadRGBAPixelsFront(const GLcontext *ctx,
|
||||
static void ReadRGBAPixels(GLcontext *ctx, struct gl_renderbuffer *rb,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLubyte rgba[][4], const GLubyte mask[]);
|
||||
void *values);
|
||||
|
||||
// Back buffer functions
|
||||
static void WriteRGBASpanBack(const GLcontext *ctx, GLuint n,
|
||||
GLint x, GLint y,
|
||||
CONST GLubyte rgba[][4],
|
||||
const GLubyte mask[]);
|
||||
static void WriteRGBSpanBack(const GLcontext *ctx, GLuint n,
|
||||
GLint x, GLint y,
|
||||
CONST GLubyte rgba[][3],
|
||||
const GLubyte mask[]);
|
||||
static void WriteMonoRGBASpanBack(const GLcontext *ctx, GLuint n,
|
||||
GLint x, GLint y,
|
||||
const GLchan color[4],
|
||||
const GLubyte mask[]);
|
||||
static void WriteRGBAPixelsBack(const GLcontext *ctx, GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
CONST GLubyte rgba[][4],
|
||||
const GLubyte mask[]);
|
||||
static void WriteMonoRGBAPixelsBack(const GLcontext *ctx, GLuint n,
|
||||
const GLint x[], const GLint y[],
|
||||
const GLchan color[4],
|
||||
const GLubyte mask[]);
|
||||
static void WriteCI32SpanBack(const GLcontext *ctx, GLuint n,
|
||||
GLint x, GLint y,
|
||||
const GLuint index[], const GLubyte mask[]);
|
||||
static void WriteCI8SpanBack(const GLcontext *ctx, GLuint n, GLint x, GLint y,
|
||||
const GLubyte index[], const GLubyte mask[]);
|
||||
static void WriteMonoCISpanBack(const GLcontext *ctx, GLuint n,
|
||||
GLint x, GLint y, GLuint colorIndex,
|
||||
const GLubyte mask[]);
|
||||
static void WriteCI32PixelsBack(const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
const GLuint index[], const GLubyte mask[]);
|
||||
static void WriteMonoCIPixelsBack(const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLuint colorIndex, const GLubyte mask[]);
|
||||
static void ReadCI32SpanBack(const GLcontext *ctx,
|
||||
GLuint n, GLint x, GLint y, GLuint index[]);
|
||||
static void ReadRGBASpanBack(const GLcontext *ctx, GLuint n,
|
||||
GLint x, GLint y,
|
||||
GLubyte rgba[][4]);
|
||||
static void ReadCI32PixelsBack(const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLuint indx[], const GLubyte mask[]);
|
||||
static void ReadRGBAPixelsBack(const GLcontext *ctx,
|
||||
GLuint n, const GLint x[], const GLint y[],
|
||||
GLubyte rgba[][4], const GLubyte mask[]);
|
||||
|
||||
BBitmap *fBitmap;
|
||||
|
||||
GLcontext *fContext;
|
||||
GLvisual *fVisual;
|
||||
GLframebuffer *fFrameBuffer;
|
||||
struct gl_renderbuffer *fRenderBuffer;
|
||||
|
||||
GLchan fClearColor[4]; // buffer clear color
|
||||
GLuint fClearIndex; // buffer clear color index
|
||||
|
||||
@@ -19,8 +19,6 @@ class BGLDispatcher
|
||||
BGLDispatcher();
|
||||
~BGLDispatcher();
|
||||
|
||||
const char * Version();
|
||||
|
||||
void SetCurrentContext(void * context);
|
||||
void * CurrentContext();
|
||||
|
||||
@@ -36,12 +34,6 @@ class BGLDispatcher
|
||||
};
|
||||
|
||||
// Inlines methods
|
||||
inline const char * BGLDispatcher::Version()
|
||||
{
|
||||
return _glapi_get_version();
|
||||
}
|
||||
|
||||
|
||||
inline void BGLDispatcher::SetCurrentContext(void * context)
|
||||
{
|
||||
_glapi_set_context(context);
|
||||
|
||||
@@ -57,7 +57,9 @@
|
||||
|
||||
static void normalize(float vec[3]);
|
||||
static void crossProduct(float x[3], float y[3], float ret[3]);
|
||||
#if 0 // UNUSED
|
||||
static void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[]);
|
||||
#endif
|
||||
|
||||
static float binomialCoefficients[8][8] = {
|
||||
{1,0,0,0,0,0,0,0},
|
||||
@@ -91,7 +93,7 @@ void bezierCurveEval(float u0, float u1, int order, float *ctlpoints, int stride
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if 0 // UNUSED
|
||||
/*order = degree +1 >=1.
|
||||
*/
|
||||
void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int stride, int dimension, float u, float retpoint[])
|
||||
@@ -115,7 +117,7 @@ void bezierCurveEvalfast(float u0, float u1, int order, float *ctlpoints, int st
|
||||
for(j=0; j<dimension; j++)
|
||||
retpoint[j] = buf[order-1][0][j];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*order = degree +1 >=1.
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* glcurveval.c++
|
||||
*
|
||||
* $Date: 2004/05/12 15:29:36 $ $Revision: 1.6 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc,v 1.6 2004/05/12 15:29:36 brianp Exp $
|
||||
* $Date: 2006/03/29 18:46:46 $ $Revision: 1.7 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/interface/glcurveval.cc,v 1.7 2006/03/29 18:46:46 brianp Exp $
|
||||
*/
|
||||
|
||||
/* Polynomial Evaluator Interface */
|
||||
@@ -74,6 +74,7 @@ OpenGLCurveEvaluator::OpenGLCurveEvaluator(void)
|
||||
em_normal.uprime = -1.0;
|
||||
em_color.uprime = -1.0;
|
||||
em_texcoord.uprime = -1.0;
|
||||
output_triangles = 0; // don't output triangles by default
|
||||
}
|
||||
|
||||
OpenGLCurveEvaluator::~OpenGLCurveEvaluator(void)
|
||||
|
||||
@@ -779,8 +779,8 @@ OpenGLSurfaceEvaluator::bgnmap2f(long)
|
||||
else
|
||||
auto_normal_flag = 0;
|
||||
*/
|
||||
glPushAttrib((GLbitfield) GL_EVAL_BIT);
|
||||
|
||||
//NEWCALLBACK: no need to worry about gl states when gling clalback
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -842,12 +842,12 @@ OpenGLSurfaceEvaluator::endmap2f(void)
|
||||
bezierPatchMeshListDelete(global_bpm);
|
||||
global_bpm = NULL;
|
||||
#endif
|
||||
|
||||
glPopAttrib();
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifndef USE_LOD
|
||||
glPopAttrib();
|
||||
glPopAttrib();
|
||||
#endif
|
||||
|
||||
#ifdef STATISTICS
|
||||
|
||||
@@ -35,28 +35,28 @@
|
||||
/*
|
||||
* mystdio.h
|
||||
*
|
||||
* $Date: 2001/03/19 17:52:02 $ $Revision: 1.3 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/interface/mystdio.h,v 1.3 2001/03/19 17:52:02 pesco Exp $
|
||||
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/interface/mystdio.h,v 1.4 2006/03/14 15:08:52 brianp Exp $
|
||||
*/
|
||||
|
||||
#ifndef __glumystdio_h_
|
||||
#define __glumystdio_h_
|
||||
|
||||
#ifdef STANDALONE
|
||||
inline void dprintf( char *, ... ) { }
|
||||
inline void _glu_dprintf( char *, ... ) { }
|
||||
#endif
|
||||
|
||||
#ifdef LIBRARYBUILD
|
||||
#ifndef NDEBUG
|
||||
#include <stdio.h>
|
||||
#define dprintf printf
|
||||
#define _glu_dprintf printf
|
||||
#else
|
||||
inline void dprintf( char *, ... ) { }
|
||||
inline void _glu_dprintf( char *, ... ) { }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef GLBUILD
|
||||
inline void dprintf( char *, ... ) { }
|
||||
inline void _glu_dprintf( char *, ... ) { }
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
|
||||
@@ -156,9 +156,9 @@ void
|
||||
Arc::show()
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts );
|
||||
_glu_dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts );
|
||||
for( int i = 0; i < pwlArc->npts; i++ ) {
|
||||
dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0],
|
||||
_glu_dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0],
|
||||
pwlArc->pts[i].param[1] );
|
||||
}
|
||||
#endif
|
||||
@@ -175,14 +175,14 @@ Arc::print( void )
|
||||
Arc_ptr jarc = this;
|
||||
|
||||
#ifndef NDEBUG
|
||||
dprintf( "BGNTRIM\n" );
|
||||
_glu_dprintf( "BGNTRIM\n" );
|
||||
#endif
|
||||
do {
|
||||
jarc->show( );
|
||||
jarc = jarc->next;
|
||||
} while (jarc != this);
|
||||
#ifndef NDEBUG
|
||||
dprintf("ENDTRIM\n" );
|
||||
_glu_dprintf("ENDTRIM\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -203,8 +203,8 @@ Arc::isDisconnected( void )
|
||||
if( ((p0[0] - p1[0]) > ZERO) || ((p1[0] - p0[0]) > ZERO) ||
|
||||
((p0[1] - p1[1]) > ZERO) || ((p1[1] - p0[1]) > ZERO) ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] );
|
||||
dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] );
|
||||
_glu_dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] );
|
||||
_glu_dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] );
|
||||
#endif
|
||||
return 1;
|
||||
} else {
|
||||
@@ -244,7 +244,7 @@ Arc::check( void )
|
||||
|
||||
if (jarc->prev == 0 || jarc->next == 0) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "checkjarc:null next/prev pointer\n");
|
||||
_glu_dprintf( "checkjarc:null next/prev pointer\n");
|
||||
jarc->print( );
|
||||
#endif
|
||||
return 0;
|
||||
@@ -252,7 +252,7 @@ Arc::check( void )
|
||||
|
||||
if (jarc->next->prev != jarc) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "checkjarc: pointer linkage screwed up\n");
|
||||
_glu_dprintf( "checkjarc: pointer linkage screwed up\n");
|
||||
jarc->print( );
|
||||
#endif
|
||||
return 0;
|
||||
@@ -271,7 +271,7 @@ Arc::check( void )
|
||||
if( jarc->prev->pwlArc ) {
|
||||
if( jarc->tail()[1] != jarc->prev->rhead()[1] ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "checkjarc: geometric linkage screwed up 1\n");
|
||||
_glu_dprintf( "checkjarc: geometric linkage screwed up 1\n");
|
||||
jarc->prev->show();
|
||||
jarc->show();
|
||||
#endif
|
||||
@@ -280,7 +280,7 @@ Arc::check( void )
|
||||
if( jarc->tail()[0] != jarc->prev->rhead()[0] ) {
|
||||
|
||||
#ifndef NDEBUG
|
||||
dprintf( "checkjarc: geometric linkage screwed up 2\n");
|
||||
_glu_dprintf( "checkjarc: geometric linkage screwed up 2\n");
|
||||
jarc->prev->show();
|
||||
jarc->show();
|
||||
#endif
|
||||
@@ -290,7 +290,7 @@ Arc::check( void )
|
||||
if( jarc->next->pwlArc ) {
|
||||
if( jarc->next->tail()[0] != jarc->rhead()[0] ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "checkjarc: geometric linkage screwed up 3\n");
|
||||
_glu_dprintf( "checkjarc: geometric linkage screwed up 3\n");
|
||||
jarc->show();
|
||||
jarc->next->show();
|
||||
#endif
|
||||
@@ -298,7 +298,7 @@ Arc::check( void )
|
||||
}
|
||||
if( jarc->next->tail()[1] != jarc->rhead()[1] ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "checkjarc: geometric linkage screwed up 4\n");
|
||||
_glu_dprintf( "checkjarc: geometric linkage screwed up 4\n");
|
||||
jarc->show();
|
||||
jarc->next->show();
|
||||
#endif
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* arcsorter.c++
|
||||
*
|
||||
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $
|
||||
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/arcsorter.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
|
||||
*/
|
||||
|
||||
#ifndef __gluarcsorter_c_
|
||||
@@ -54,7 +54,7 @@ ArcSorter::ArcSorter(Subdivider &s) : Sorter( sizeof( Arc ** ) ), subdivider(s)
|
||||
int
|
||||
ArcSorter::qscmp( char *, char * )
|
||||
{
|
||||
dprintf( "ArcSorter::qscmp: pure virtual called\n" );
|
||||
_glu_dprintf( "ArcSorter::qscmp: pure virtual called\n" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ ArcTessellator::tessellateNonlinear( Arc *arc, REAL geo_stepsize, REAL arc_steps
|
||||
REAL min_u, min_v, max_u,max_v;
|
||||
min_u = max_u = bezierArc->cpts[0];
|
||||
min_v = max_v = bezierArc->cpts[1];
|
||||
for(i=1, j=2; i<bezierArc->order; i++, j+= bezierArc->stride)
|
||||
for(i=1, j=bezierArc->stride; i<bezierArc->order; i++, j+= bezierArc->stride)
|
||||
{
|
||||
if(bezierArc->cpts[j] < min_u)
|
||||
min_u = bezierArc->cpts[j];
|
||||
|
||||
@@ -45,7 +45,7 @@ void
|
||||
BasicCurveEvaluator::domain1f( REAL, REAL )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "domain1f\n" );
|
||||
_glu_dprintf( "domain1f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ void
|
||||
BasicCurveEvaluator::range1f( long , REAL *, REAL * )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "range1f\n" );
|
||||
_glu_dprintf( "range1f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ void
|
||||
BasicCurveEvaluator::enable( long )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "enable\n" );
|
||||
_glu_dprintf( "enable\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ void
|
||||
BasicCurveEvaluator::disable( long )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "disable\n" );
|
||||
_glu_dprintf( "disable\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ void
|
||||
BasicCurveEvaluator::bgnmap1f( long )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "bgnmap1f\n" );
|
||||
_glu_dprintf( "bgnmap1f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ void
|
||||
BasicCurveEvaluator::map1f( long, REAL, REAL, long, long, REAL * )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "map1f\n" );
|
||||
_glu_dprintf( "map1f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ void
|
||||
BasicCurveEvaluator::mapgrid1f( long, REAL, REAL )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "mapgrid1f\n" );
|
||||
_glu_dprintf( "mapgrid1f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ void
|
||||
BasicCurveEvaluator::mapmesh1f( long, long, long )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "mapmesh1f\n" );
|
||||
_glu_dprintf( "mapmesh1f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ void
|
||||
BasicCurveEvaluator::evalcoord1f( long, REAL )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "evalcoord1f\n" );
|
||||
_glu_dprintf( "evalcoord1f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ void
|
||||
BasicCurveEvaluator::endmap1f( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "endmap1f\n" );
|
||||
_glu_dprintf( "endmap1f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ void
|
||||
BasicCurveEvaluator::bgnline( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "bgnline\n" );
|
||||
_glu_dprintf( "bgnline\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -133,6 +133,6 @@ void
|
||||
BasicCurveEvaluator::endline( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "endline\n" );
|
||||
_glu_dprintf( "endline\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* basiccurveeval.h
|
||||
*
|
||||
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
|
||||
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/basiccrveval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
|
||||
*/
|
||||
|
||||
#ifndef __glubasiccrveval_h_
|
||||
@@ -48,6 +48,7 @@
|
||||
|
||||
class BasicCurveEvaluator : public CachingEvaluator {
|
||||
public:
|
||||
virtual ~BasicCurveEvaluator() { /* silence warning*/ }
|
||||
virtual void domain1f( REAL, REAL );
|
||||
virtual void range1f( long, REAL *, REAL * );
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ void
|
||||
BasicSurfaceEvaluator::domain2f( REAL, REAL, REAL, REAL )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "domain2f\n" );
|
||||
_glu_dprintf( "domain2f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void
|
||||
BasicSurfaceEvaluator::polymode( long )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "polymode\n" );
|
||||
_glu_dprintf( "polymode\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ void
|
||||
BasicSurfaceEvaluator::range2f( long type, REAL *from, REAL *to )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n",
|
||||
_glu_dprintf( "range2f type %ld, from (%g,%g), to (%g,%g)\n",
|
||||
type, from[0], from[1], to[0], to[1] );
|
||||
#endif
|
||||
}
|
||||
@@ -74,7 +74,7 @@ void
|
||||
BasicSurfaceEvaluator::enable( long )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "enable\n" );
|
||||
_glu_dprintf( "enable\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ void
|
||||
BasicSurfaceEvaluator::disable( long )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "disable\n" );
|
||||
_glu_dprintf( "disable\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ void
|
||||
BasicSurfaceEvaluator::bgnmap2f( long )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "bgnmap2f\n" );
|
||||
_glu_dprintf( "bgnmap2f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ void
|
||||
BasicSurfaceEvaluator::endmap2f( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "endmap2f\n" );
|
||||
_glu_dprintf( "endmap2f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ BasicSurfaceEvaluator::map2f( long, REAL, REAL, long, long,
|
||||
REAL * )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "map2f\n" );
|
||||
_glu_dprintf( "map2f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void
|
||||
BasicSurfaceEvaluator::mapgrid2f( long, REAL, REAL, long, REAL, REAL )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "mapgrid2f\n" );
|
||||
_glu_dprintf( "mapgrid2f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ void
|
||||
BasicSurfaceEvaluator::mapmesh2f( long, long, long, long, long )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "mapmesh2f\n" );
|
||||
_glu_dprintf( "mapmesh2f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ void
|
||||
BasicSurfaceEvaluator::evalcoord2f( long, REAL, REAL )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "evalcoord2f\n" );
|
||||
_glu_dprintf( "evalcoord2f\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ void
|
||||
BasicSurfaceEvaluator::evalpoint2i( long, long )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "evalpoint2i\n" );
|
||||
_glu_dprintf( "evalpoint2i\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ void
|
||||
BasicSurfaceEvaluator::bgnline( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "bgnline\n" );
|
||||
_glu_dprintf( "bgnline\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ void
|
||||
BasicSurfaceEvaluator::endline( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "endline\n" );
|
||||
_glu_dprintf( "endline\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ void
|
||||
BasicSurfaceEvaluator::bgnclosedline( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "bgnclosedline\n" );
|
||||
_glu_dprintf( "bgnclosedline\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ void
|
||||
BasicSurfaceEvaluator::endclosedline( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "endclosedline\n" );
|
||||
_glu_dprintf( "endclosedline\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ void
|
||||
BasicSurfaceEvaluator::bgntfan( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "bgntfan\n" );
|
||||
_glu_dprintf( "bgntfan\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ void
|
||||
BasicSurfaceEvaluator::bgntmesh( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "bgntmesh\n" );
|
||||
_glu_dprintf( "bgntmesh\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ void
|
||||
BasicSurfaceEvaluator::swaptmesh( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "swaptmesh\n" );
|
||||
_glu_dprintf( "swaptmesh\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ void
|
||||
BasicSurfaceEvaluator::endtmesh( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "endtmesh\n" );
|
||||
_glu_dprintf( "endtmesh\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ void
|
||||
BasicSurfaceEvaluator::bgnqstrip( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "bgnqstrip\n" );
|
||||
_glu_dprintf( "bgnqstrip\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ void
|
||||
BasicSurfaceEvaluator::endqstrip( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "endqstrip\n" );
|
||||
_glu_dprintf( "endqstrip\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* basicsurfeval.h
|
||||
*
|
||||
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
|
||||
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/basicsurfeval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
|
||||
*/
|
||||
|
||||
#ifndef __glubasicsurfeval_h_
|
||||
@@ -48,6 +48,7 @@
|
||||
|
||||
class BasicSurfaceEvaluator : public CachingEvaluator {
|
||||
public:
|
||||
virtual ~BasicSurfaceEvaluator() { /* silence warning*/ }
|
||||
virtual void range2f( long, REAL *, REAL * );
|
||||
virtual void domain2f( REAL, REAL, REAL, REAL );
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* bin.c++
|
||||
*
|
||||
* $Date: 2004/05/12 15:29:36 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/bin.cc,v 1.2 2004/05/12 15:29:36 brianp Exp $
|
||||
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/bin.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "glimports.h"
|
||||
@@ -123,7 +123,7 @@ void
|
||||
Bin::show( char *name )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "%s\n", name );
|
||||
_glu_dprintf( "%s\n", name );
|
||||
for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() )
|
||||
jarc->show( );
|
||||
#endif
|
||||
@@ -160,7 +160,7 @@ Bin::listBezier( void )
|
||||
REAL t1 = pts[0].param[1];
|
||||
REAL s2 = pts[1].param[0];
|
||||
REAL t2 = pts[1].param[1];
|
||||
dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 );
|
||||
_glu_dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* bufpool.h
|
||||
*
|
||||
* $Date: 2001/03/22 11:38:36 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/bufpool.h,v 1.2 2001/03/22 11:38:36 joukj Exp $
|
||||
* $Date: 2006/03/29 18:46:46 $ $Revision: 1.3 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/bufpool.h,v 1.3 2006/03/29 18:46:46 brianp Exp $
|
||||
*/
|
||||
|
||||
#ifndef __glubufpool_h_
|
||||
@@ -128,6 +128,7 @@ public:
|
||||
inline void * operator new( size_t s)
|
||||
{ return ::new char[s]; }
|
||||
inline void operator delete( void * ) { assert( 0 ); }
|
||||
inline void operator delete( void *, Pool & ) { assert( 0 ); }
|
||||
inline void deleteMe( Pool & );
|
||||
};
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* cachingeval.h
|
||||
*
|
||||
* $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/cachingeval.h,v 1.1 2001/03/17 00:25:40 brianp Exp $
|
||||
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/cachingeval.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
|
||||
*/
|
||||
|
||||
#ifndef __glucachingval_h_
|
||||
@@ -44,6 +44,7 @@
|
||||
|
||||
class CachingEvaluator {
|
||||
public:
|
||||
virtual ~CachingEvaluator() { /* silence warning*/ }
|
||||
enum ServiceMode { play, record, playAndRecord };
|
||||
virtual int canRecord( void );
|
||||
virtual int canPlayAndRecord( void );
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* ccw.c++
|
||||
*
|
||||
* $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/ccw.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
|
||||
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/ccw.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "glimports.h"
|
||||
@@ -70,7 +70,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
assert( v2 != v2last );
|
||||
|
||||
#ifndef NDEBUG
|
||||
dprintf( "arc_ccw_turn, p = %d\n", 0 );
|
||||
_glu_dprintf( "arc_ccw_turn, p = %d\n", 0 );
|
||||
#endif
|
||||
|
||||
// the arcs lie on the line (0 == v1->param[0])
|
||||
@@ -88,7 +88,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
while( 1 ) {
|
||||
if( v1next->param[0] < v2next->param[0] ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "case a\n" );
|
||||
_glu_dprintf( "case a\n" );
|
||||
#endif
|
||||
assert( v1->param[0] <= v1next->param[0] );
|
||||
assert( v2->param[0] <= v1next->param[0] );
|
||||
@@ -101,12 +101,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
return sgn;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
dprintf( "decr\n" );
|
||||
_glu_dprintf( "decr\n" );
|
||||
#endif
|
||||
v1 = v1next--;
|
||||
if( v1 == v1last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
@@ -117,7 +117,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
}
|
||||
} else if( v1next->param[0] > v2next->param[0] ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "case b\n" );
|
||||
_glu_dprintf( "case b\n" );
|
||||
#endif
|
||||
assert( v1->param[0] <= v2next->param[0] );
|
||||
assert( v2->param[0] <= v2next->param[0] );
|
||||
@@ -130,12 +130,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
return sgn;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
dprintf( "incr\n" );
|
||||
_glu_dprintf( "incr\n" );
|
||||
#endif
|
||||
v2 = v2next++;
|
||||
if( v2 == v2last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
@@ -146,7 +146,7 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
}
|
||||
} else {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "case ab\n" );
|
||||
_glu_dprintf( "case ab\n" );
|
||||
#endif
|
||||
if( v1next->param[1] < v2next->param[1] )
|
||||
return 0;
|
||||
@@ -154,12 +154,12 @@ Subdivider::ccwTurn_sr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
return 1;
|
||||
else {
|
||||
#ifdef DEBUG
|
||||
dprintf( "incr\n" );
|
||||
_glu_dprintf( "incr\n" );
|
||||
#endif
|
||||
v2 = v2next++;
|
||||
if( v2 == v2last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
@@ -183,7 +183,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
|
||||
assert( v2 != v2last );
|
||||
|
||||
#ifndef NDEBUG
|
||||
dprintf( "arc_ccw_turn, p = %d\n", 0 );
|
||||
_glu_dprintf( "arc_ccw_turn, p = %d\n", 0 );
|
||||
#endif
|
||||
|
||||
// the arcs lie on the line (0 == v1->param[0])
|
||||
@@ -201,7 +201,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
|
||||
while( 1 ) {
|
||||
if( v1next->param[0] > v2next->param[0] ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "case c\n" );
|
||||
_glu_dprintf( "case c\n" );
|
||||
#endif
|
||||
assert( v1->param[0] >= v1next->param[0] );
|
||||
assert( v2->param[0] >= v1next->param[0] );
|
||||
@@ -215,11 +215,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
|
||||
else {
|
||||
v1 = v1next--;
|
||||
#ifdef DEBUG
|
||||
dprintf( "decr\n" );
|
||||
_glu_dprintf( "decr\n" );
|
||||
#endif
|
||||
if( v1 == v1last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
@@ -230,7 +230,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
|
||||
}
|
||||
} else if( v1next->param[0] < v2next->param[0] ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "case d\n" );
|
||||
_glu_dprintf( "case d\n" );
|
||||
#endif
|
||||
assert( v1->param[0] >= v2next->param[0] );
|
||||
assert( v2->param[0] >= v2next->param[0] );
|
||||
@@ -244,11 +244,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
|
||||
else {
|
||||
v2 = v2next++;
|
||||
#ifdef DEBUG
|
||||
dprintf( "incr\n" );
|
||||
_glu_dprintf( "incr\n" );
|
||||
#endif
|
||||
if( v2 == v2last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
@@ -259,7 +259,7 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
|
||||
}
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
dprintf( "case cd\n" );
|
||||
_glu_dprintf( "case cd\n" );
|
||||
#endif
|
||||
if( v1next->param[1] < v2next->param[1] )
|
||||
return 1;
|
||||
@@ -268,11 +268,11 @@ Subdivider::ccwTurn_sl( Arc_ptr j1, Arc_ptr j2 ) // dir = 0
|
||||
else {
|
||||
v2 = v2next++;
|
||||
#ifdef DEBUG
|
||||
dprintf( "incr\n" );
|
||||
_glu_dprintf( "incr\n" );
|
||||
#endif
|
||||
if( v2 == v2last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
@@ -296,7 +296,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
assert( v2 != v2last );
|
||||
|
||||
#ifndef NDEBUG
|
||||
dprintf( "arc_ccw_turn, p = %d\n", 1 );
|
||||
_glu_dprintf( "arc_ccw_turn, p = %d\n", 1 );
|
||||
#endif
|
||||
|
||||
// the arcs lie on the line (1 == v1->param[1])
|
||||
@@ -314,7 +314,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
while( 1 ) {
|
||||
if( v1next->param[1] < v2next->param[1] ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "case a\n" );
|
||||
_glu_dprintf( "case a\n" );
|
||||
#endif
|
||||
assert( v1->param[1] <= v1next->param[1] );
|
||||
assert( v2->param[1] <= v1next->param[1] );
|
||||
@@ -327,12 +327,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
return sgn;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
dprintf( "decr\n" );
|
||||
_glu_dprintf( "decr\n" );
|
||||
#endif
|
||||
v1 = v1next--;
|
||||
if( v1 == v1last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
@@ -343,7 +343,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
}
|
||||
} else if( v1next->param[1] > v2next->param[1] ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "case b\n" );
|
||||
_glu_dprintf( "case b\n" );
|
||||
#endif
|
||||
assert( v1->param[1] <= v2next->param[1] );
|
||||
assert( v2->param[1] <= v2next->param[1] );
|
||||
@@ -356,12 +356,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
return sgn;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
dprintf( "incr\n" );
|
||||
_glu_dprintf( "incr\n" );
|
||||
#endif
|
||||
v2 = v2next++;
|
||||
if( v2 == v2last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
@@ -372,7 +372,7 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
}
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
dprintf( "case ab\n" );
|
||||
_glu_dprintf( "case ab\n" );
|
||||
#endif
|
||||
if( v1next->param[0] < v2next->param[0] )
|
||||
return 1;
|
||||
@@ -380,12 +380,12 @@ Subdivider::ccwTurn_tr( Arc_ptr j1, Arc_ptr j2 ) // dir = 1
|
||||
return 0;
|
||||
else {
|
||||
#ifdef DEBUG
|
||||
dprintf( "incr\n" );
|
||||
_glu_dprintf( "incr\n" );
|
||||
#endif
|
||||
v2 = v2next++;
|
||||
if( v2 == v2last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
@@ -409,7 +409,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
|
||||
assert( v2 != v2last );
|
||||
|
||||
#ifndef NDEBUG
|
||||
dprintf( "arc_ccw_turn, p = %d\n", 1 );
|
||||
_glu_dprintf( "arc_ccw_turn, p = %d\n", 1 );
|
||||
#endif
|
||||
|
||||
// the arcs lie on the line (1 == v1->param[1])
|
||||
@@ -427,7 +427,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
|
||||
while( 1 ) {
|
||||
if( v1next->param[1] > v2next->param[1] ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "case c\n" );
|
||||
_glu_dprintf( "case c\n" );
|
||||
#endif
|
||||
assert( v1->param[1] >= v1next->param[1] );
|
||||
assert( v2->param[1] >= v1next->param[1] );
|
||||
@@ -441,11 +441,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
|
||||
else {
|
||||
v1 = v1next--;
|
||||
#ifdef DEBUG
|
||||
dprintf( "decr\n" );
|
||||
_glu_dprintf( "decr\n" );
|
||||
#endif
|
||||
if( v1 == v1last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
@@ -456,7 +456,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
|
||||
}
|
||||
} else if( v1next->param[1] < v2next->param[1] ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "case d\n" );
|
||||
_glu_dprintf( "case d\n" );
|
||||
assert( v1->param[1] >= v2next->param[1] );
|
||||
assert( v2->param[1] >= v2next->param[1] );
|
||||
#endif
|
||||
@@ -470,11 +470,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
|
||||
else {
|
||||
v2 = v2next++;
|
||||
#ifdef DEBUG
|
||||
dprintf( "incr\n" );
|
||||
_glu_dprintf( "incr\n" );
|
||||
#endif
|
||||
if( v2 == v2last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
@@ -485,7 +485,7 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
|
||||
}
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
dprintf( "case cd\n" );
|
||||
_glu_dprintf( "case cd\n" );
|
||||
#endif
|
||||
if( v1next->param[0] < v2next->param[0] )
|
||||
return 0;
|
||||
@@ -494,11 +494,11 @@ Subdivider::ccwTurn_tl( Arc_ptr j1, Arc_ptr j2 )
|
||||
else {
|
||||
v2 = v2next++;
|
||||
#ifdef DEBUG
|
||||
dprintf( "incr\n" );
|
||||
_glu_dprintf( "incr\n" );
|
||||
#endif
|
||||
if( v2 == v2last ) {
|
||||
#ifdef DEBUG
|
||||
dprintf( "no good results\n" );
|
||||
_glu_dprintf( "no good results\n" );
|
||||
#endif
|
||||
return 0; // ill-conditioned, guess answer
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
** $Date: 2001/03/17 00:25:40 $ $Revision: 1.1 $
|
||||
** $Date: 2005/10/28 13:09:23 $ $Revision: 1.2 $
|
||||
*/
|
||||
/*
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/dataTransform.cc,v 1.1 2001/03/17 00:25:40 brianp Exp $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/dataTransform.cc,v 1.2 2005/10/28 13:09:23 brianp Exp $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -47,6 +47,7 @@
|
||||
|
||||
extern directedLine* arcLoopToDLineLoop(Arc_ptr loop);
|
||||
|
||||
#if 0 // UNUSED
|
||||
static directedLine* copy_loop(Arc_ptr loop, Real2* vertArray, int& index, directedLine dline_buf[], sampledLine sline_buf[], int& index_dline)
|
||||
{
|
||||
directedLine *ret;
|
||||
@@ -95,7 +96,9 @@ static directedLine* copy_loop(Arc_ptr loop, Real2* vertArray, int& index, direc
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0 // UNUSED
|
||||
static int num_edges(Bin& bin)
|
||||
{
|
||||
int sum=0;
|
||||
@@ -103,6 +106,8 @@ static int num_edges(Bin& bin)
|
||||
sum += jarc->pwlArc->npts-1;
|
||||
return sum;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
directedLine* bin_to_DLineLoops(Bin& bin)
|
||||
{
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* flistsorter.h
|
||||
*
|
||||
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/flistsorter.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
|
||||
* $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/flistsorter.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
|
||||
*/
|
||||
|
||||
#ifndef __gluflistsorter_h_
|
||||
@@ -48,6 +48,7 @@
|
||||
class FlistSorter : public Sorter {
|
||||
public:
|
||||
FlistSorter(void);
|
||||
virtual ~FlistSorter() { /* silence warning*/ }
|
||||
void qsort( REAL *a, int n );
|
||||
|
||||
protected:
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* intersect.c++
|
||||
*
|
||||
* $Date: 2004/05/12 15:29:36 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/intersect.cc,v 1.2 2004/05/12 15:29:36 brianp Exp $
|
||||
* $Date: 2005/10/28 13:09:23 $ $Revision: 1.3 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/intersect.cc,v 1.3 2005/10/28 13:09:23 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "glimports.h"
|
||||
@@ -53,7 +53,9 @@
|
||||
enum i_result { INTERSECT_VERTEX, INTERSECT_EDGE };
|
||||
|
||||
/* local functions */
|
||||
#ifndef NDEBUG // for asserts only
|
||||
static int arc_classify( Arc_ptr, int, REAL );
|
||||
#endif
|
||||
static enum i_result pwlarc_intersect( PwlArc *, int, REAL, int, int[3] );
|
||||
|
||||
|
||||
@@ -400,6 +402,7 @@ pwlarc_intersect(
|
||||
*----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef NDEBUG // for asserts only
|
||||
static int
|
||||
arc_classify( Arc_ptr jarc, int param, REAL value )
|
||||
{
|
||||
@@ -438,6 +441,7 @@ arc_classify( Arc_ptr jarc, int param, REAL value )
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Subdivider::classify_tailonleft_s( Bin& bin, Bin& in, Bin& out, REAL val )
|
||||
|
||||
@@ -129,11 +129,11 @@ int Knotvector::validate( void )
|
||||
void Knotvector::show( char *msg )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "%s\n", msg );
|
||||
dprintf( "order = %ld, count = %ld\n", order, knotcount );
|
||||
_glu_dprintf( "%s\n", msg );
|
||||
_glu_dprintf( "order = %ld, count = %ld\n", order, knotcount );
|
||||
|
||||
for( int i=0; i<knotcount; i++ )
|
||||
dprintf( "knot[%d] = %g\n", i, knotlist[i] );
|
||||
_glu_dprintf( "knot[%d] = %g\n", i, knotlist[i] );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* maplist.c++
|
||||
*
|
||||
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/maplist.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
|
||||
* $Date: 2005/10/28 13:09:23 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/maplist.cc,v 1.2 2005/10/28 13:09:23 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "glimports.h"
|
||||
@@ -73,8 +73,10 @@ Maplist::add( long type, int israt, int ncoords )
|
||||
void
|
||||
Maplist::define( long type, int israt, int ncoords )
|
||||
{
|
||||
#ifndef NDEBUG // to avoid warning
|
||||
Mapdesc *m = locate( type );
|
||||
assert( m == NULL || ( m->isrational == israt && m->ncoords == ncoords ) );
|
||||
#endif
|
||||
add( type, israt, ncoords );
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
** $Date: 2004/05/12 15:29:36 $ $Revision: 1.2 $
|
||||
** $Date: 2005/10/28 13:09:23 $ $Revision: 1.3 $
|
||||
*/
|
||||
/*
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc,v 1.2 2004/05/12 15:29:36 brianp Exp $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/monoTriangulationBackend.cc,v 1.3 2005/10/28 13:09:23 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "monoTriangulation.h"
|
||||
@@ -86,7 +86,7 @@ void reflexChain::processNewVertex(Real v[2], Backend* backend)
|
||||
{
|
||||
Int i,j,k;
|
||||
Int isReflex;
|
||||
TrimVertex trimVert;
|
||||
/*TrimVertex trimVert;*/
|
||||
/*if there are at most one vertex in the queue, then simply insert
|
||||
*/
|
||||
if(index_queue <=1){
|
||||
|
||||
@@ -1,19 +1,41 @@
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Copyright (C) 1999, Silicon Graphics, Inc. *
|
||||
* *
|
||||
* These coded instructions, statements, and computer programs contain *
|
||||
* unpublished proprietary information of Silicon Graphics, Inc., and *
|
||||
* are protected by Federal copyright law. They may not be disclosed *
|
||||
* to third parties or copied or duplicated in any form, in whole or *
|
||||
* in part, without the prior written consent of Silicon Graphics, Inc. *
|
||||
* *
|
||||
**************************************************************************/
|
||||
/*
|
||||
** License Applicability. Except to the extent portions of this file are
|
||||
** made subject to an alternative license as permitted in the SGI Free
|
||||
** Software License B, Version 1.1 (the "License"), the contents of this
|
||||
** file are subject only to the provisions of the License. You may not use
|
||||
** this file except in compliance with the License. You may obtain a copy
|
||||
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
|
||||
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
|
||||
**
|
||||
** http://oss.sgi.com/projects/FreeB
|
||||
**
|
||||
** Note that, as provided in the License, the Software is distributed on an
|
||||
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
|
||||
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
|
||||
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
|
||||
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
||||
**
|
||||
** Original Code. The Original Code is: OpenGL Sample Implementation,
|
||||
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
|
||||
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
|
||||
** Copyright in any portions created by third parties is as indicated
|
||||
** elsewhere herein. All Rights Reserved.
|
||||
**
|
||||
** Additional Notice Provisions: The application programming interfaces
|
||||
** established by SGI in conjunction with the Original Code are The
|
||||
** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
|
||||
** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
|
||||
** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
|
||||
** Window System(R) (Version 1.3), released October 19, 1998. This software
|
||||
** was created using the OpenGL(R) version 1.2.1 Sample Implementation
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
*/
|
||||
|
||||
/*
|
||||
* monotonizer.h
|
||||
*
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/monotonizer.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/monotonizer.h,v 1.2 2006/04/03 22:23:52 ajax Exp $
|
||||
*/
|
||||
|
||||
#ifndef __glumonotonizer_h_
|
||||
|
||||
@@ -232,7 +232,7 @@ NurbsTessellator::pwlcurve( long count, INREAL array[], long byte_stride, long t
|
||||
}
|
||||
if( i != count ) {
|
||||
do_nurbserror( 37 );
|
||||
dprintf( "point %d (%f,%f)\n", i, x, y );
|
||||
_glu_dprintf( "point %d (%f,%f)\n", i, x, y );
|
||||
isDataValid = 0;
|
||||
return;
|
||||
}
|
||||
@@ -247,7 +247,7 @@ NurbsTessellator::pwlcurve( long count, INREAL array[], long byte_stride, long t
|
||||
}
|
||||
if( i != count ) {
|
||||
do_nurbserror( 37 );
|
||||
dprintf( "point %d (%f,%f)\n", i, x, y );
|
||||
_glu_dprintf( "point %d (%f,%f)\n", i, x, y );
|
||||
isDataValid = 0;
|
||||
return;
|
||||
}
|
||||
@@ -460,7 +460,7 @@ NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat )
|
||||
mapdesc->setBboxsize( mat );
|
||||
} else {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "ERRORRORRORR!!!\n");
|
||||
_glu_dprintf( "ERRORRORRORR!!!\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -488,7 +488,7 @@ NurbsTessellator::setnurbsproperty( long type, long purpose, INREAL *mat,
|
||||
mapdesc->setBmat( mat, rstride, cstride );
|
||||
} else {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "ERRORRORRORR!!!\n");
|
||||
_glu_dprintf( "ERRORRORRORR!!!\n");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* nurbstess.c++
|
||||
*
|
||||
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
|
||||
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/nurbstess.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "glimports.h"
|
||||
@@ -79,7 +79,7 @@ void
|
||||
NurbsTessellator::makeobj( int )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "makeobj\n" );
|
||||
_glu_dprintf( "makeobj\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ void
|
||||
NurbsTessellator::closeobj( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "closeobj\n" );
|
||||
_glu_dprintf( "closeobj\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ void
|
||||
NurbsTessellator::bgnrender( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "bgnrender\n" );
|
||||
_glu_dprintf( "bgnrender\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ void
|
||||
NurbsTessellator::endrender( void )
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
dprintf( "endrender\n" );
|
||||
_glu_dprintf( "endrender\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* patch.c++
|
||||
*
|
||||
* $Date: 2002/11/01 23:35:07 $ $Revision: 1.3 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.3 2002/11/01 23:35:07 brianp Exp $
|
||||
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/patch.cc,v 1.4 2006/03/14 15:08:52 brianp Exp $
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -439,7 +439,7 @@ Patch::getstepsize( void )
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
dprintf( "sidesteps %g %g %g %g, stepsize %g %g\n",
|
||||
_glu_dprintf( "sidesteps %g %g %g %g, stepsize %g %g\n",
|
||||
pspec[0].sidestep[0], pspec[0].sidestep[1],
|
||||
pspec[1].sidestep[0], pspec[1].sidestep[1],
|
||||
pspec[0].stepsize, pspec[1].stepsize );
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* quilt.c++
|
||||
*
|
||||
* $Date: 2002/11/01 23:35:07 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/quilt.cc,v 1.2 2002/11/01 23:35:07 brianp Exp $
|
||||
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/quilt.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "glimports.h"
|
||||
@@ -91,12 +91,12 @@ Quilt::show( void )
|
||||
for( int i=0; i!= qspec[0].order * qspec[0].width; i++ ) {
|
||||
for( int j = 0; j!= qspec[1].order * qspec[1].width; j++ ) {
|
||||
for( int k=0; k < nc; k++ )
|
||||
dprintf( "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] );
|
||||
dprintf( "\n" );
|
||||
_glu_dprintf( "%g ", ps[i*qspec[0].stride + j*qspec[1].stride + k] );
|
||||
_glu_dprintf( "\n" );
|
||||
}
|
||||
dprintf( "\n" );
|
||||
_glu_dprintf( "\n" );
|
||||
}
|
||||
dprintf( "\n" );
|
||||
_glu_dprintf( "\n" );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* slicer.c++
|
||||
*
|
||||
* $Date: 2002/11/01 23:35:07 $ $Revision: 1.4 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/slicer.cc,v 1.4 2002/11/01 23:35:07 brianp Exp $
|
||||
* $Date: 2005/10/28 13:09:23 $ $Revision: 1.5 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/slicer.cc,v 1.5 2005/10/28 13:09:23 brianp Exp $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -84,6 +84,7 @@ Int num_quads = 0;
|
||||
#define ZERO 0.00001 /*determing whether a loop is a rectngle or not*/
|
||||
#define equalRect(a,b) ((glu_abs(a-b) <= ZERO)? 1:0) //only used in tessellating a rectangle
|
||||
|
||||
#if 0 // UNUSED
|
||||
static Int is_Convex(Arc_ptr loop)
|
||||
{
|
||||
if(area(loop->tail(), loop->head(), loop->next->head()) <0 )
|
||||
@@ -95,9 +96,11 @@ static Int is_Convex(Arc_ptr loop)
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/******triangulate a monotone polygon**************/
|
||||
#include "monoTriangulation.h"
|
||||
#if 0 // UNUSED
|
||||
static int is_U_monotone(Arc_ptr loop)
|
||||
{
|
||||
int n_changes=0;
|
||||
@@ -126,6 +129,7 @@ static int is_U_monotone(Arc_ptr loop)
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline int compInY(REAL a[2], REAL b[2])
|
||||
{
|
||||
@@ -259,6 +263,7 @@ if(loop->next->tail()[1] == loop->next->head()[1])
|
||||
|
||||
|
||||
//a line with the same u for opt
|
||||
#ifdef USE_OPTTT
|
||||
static void evalLineNOGE_BU(TrimVertex *verts, int n, Backend& backend)
|
||||
{
|
||||
int i;
|
||||
@@ -266,8 +271,10 @@ static void evalLineNOGE_BU(TrimVertex *verts, int n, Backend& backend)
|
||||
for(i=0; i<n; i++)
|
||||
backend.tmeshvertNOGE_BU(&verts[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
//a line with the same v for opt
|
||||
#ifdef USE_OPTTT
|
||||
static void evalLineNOGE_BV(TrimVertex *verts, int n, Backend& backend)
|
||||
{
|
||||
int i;
|
||||
@@ -276,6 +283,9 @@ static void evalLineNOGE_BV(TrimVertex *verts, int n, Backend& backend)
|
||||
for(i=0; i<n; i++)
|
||||
backend.tmeshvertNOGE_BV(&verts[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_OPTTT
|
||||
static void evalLineNOGE(TrimVertex *verts, int n, Backend& backend)
|
||||
{
|
||||
|
||||
@@ -290,7 +300,7 @@ static void evalLineNOGE(TrimVertex *verts, int n, Backend& backend)
|
||||
backend.tmeshvertNOGE(&verts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
inline void OPT_OUTVERT(TrimVertex& vv, Backend& backend)
|
||||
{
|
||||
@@ -861,6 +871,7 @@ return;
|
||||
|
||||
|
||||
/**********for reading newtess_flag from a file**********/
|
||||
#ifdef USE_READ_FLAG
|
||||
static Int read_flag(char* name)
|
||||
{
|
||||
Int ret;
|
||||
@@ -874,7 +885,7 @@ static Int read_flag(char* name)
|
||||
fclose(fp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/***********nextgen tess****************/
|
||||
#include "sampleMonoPoly.h"
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* sorter.c++
|
||||
*
|
||||
* $Date: 2001/11/29 16:16:55 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/sorter.cc,v 1.2 2001/11/29 16:16:55 kschultz Exp $
|
||||
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.3 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/sorter.cc,v 1.3 2006/03/14 15:08:52 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "glimports.h"
|
||||
@@ -57,7 +57,7 @@ Sorter::qsort( void *a, int n )
|
||||
int
|
||||
Sorter::qscmp( char *, char * )
|
||||
{
|
||||
dprintf( "Sorter::qscmp: pure virtual called\n" );
|
||||
_glu_dprintf( "Sorter::qscmp: pure virtual called\n" );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -65,14 +65,14 @@ Sorter::qscmp( char *, char * )
|
||||
void
|
||||
Sorter::qsexc( char *, char * )
|
||||
{
|
||||
dprintf( "Sorter::qsexc: pure virtual called\n" );
|
||||
_glu_dprintf( "Sorter::qsexc: pure virtual called\n" );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Sorter::qstexc( char *, char *, char * )
|
||||
{
|
||||
dprintf( "Sorter::qstexc: pure virtual called\n" );
|
||||
_glu_dprintf( "Sorter::qstexc: pure virtual called\n" );
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
|
||||
** $Date: 2006/03/29 18:54:00 $ $Revision: 1.2 $
|
||||
*/
|
||||
/*
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/sorter.h,v 1.1 2001/03/17 00:25:41 brianp Exp $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/sorter.h,v 1.2 2006/03/29 18:54:00 brianp Exp $
|
||||
*/
|
||||
|
||||
#ifndef __glusorter_h_
|
||||
@@ -43,6 +43,7 @@
|
||||
class Sorter {
|
||||
public:
|
||||
Sorter( int es );
|
||||
virtual ~Sorter() { /* silence warning*/ }
|
||||
void qsort( void *a, int n );
|
||||
|
||||
protected:
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* splitarcs.c++
|
||||
*
|
||||
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/splitarcs.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
|
||||
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/splitarcs.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "glimports.h"
|
||||
@@ -133,14 +133,14 @@ Subdivider::check_s( Arc_ptr jarc1, Arc_ptr jarc2 )
|
||||
undersampling */
|
||||
if( ! ( jarc1->tail()[0] < (jarc1)->head()[0] ) ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "s difference %f\n", (jarc1)->tail()[0] - (jarc1)->head()[0] );
|
||||
_glu_dprintf( "s difference %f\n", (jarc1)->tail()[0] - (jarc1)->head()[0] );
|
||||
#endif
|
||||
::mylongjmp( jumpbuffer, 28 );
|
||||
}
|
||||
|
||||
if( ! ( jarc2->tail()[0] > (jarc2)->head()[0] ) ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "s difference %f\n", (jarc2)->tail()[0] - (jarc2)->head()[0] );
|
||||
_glu_dprintf( "s difference %f\n", (jarc2)->tail()[0] - (jarc2)->head()[0] );
|
||||
#endif
|
||||
::mylongjmp( jumpbuffer, 28 );
|
||||
}
|
||||
@@ -232,14 +232,14 @@ Subdivider::check_t( Arc_ptr jarc1, Arc_ptr jarc2 )
|
||||
undersampling */
|
||||
if( ! ( jarc1->tail()[1] < (jarc1)->head()[1] ) ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "t difference %f\n", jarc1->tail()[1] - (jarc1)->head()[1] );
|
||||
_glu_dprintf( "t difference %f\n", jarc1->tail()[1] - (jarc1)->head()[1] );
|
||||
#endif
|
||||
::mylongjmp( jumpbuffer, 28 );
|
||||
}
|
||||
|
||||
if( ! ( jarc2->tail()[1] > (jarc2)->head()[1] ) ) {
|
||||
#ifndef NDEBUG
|
||||
dprintf( "t difference %f\n", jarc2->tail()[1] - (jarc2)->head()[1] );
|
||||
_glu_dprintf( "t difference %f\n", jarc2->tail()[1] - (jarc2)->head()[1] );
|
||||
#endif
|
||||
::mylongjmp( jumpbuffer, 28 );
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* tobezier.c++
|
||||
*
|
||||
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/tobezier.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
|
||||
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/tobezier.cc,v 1.2 2006/03/14 15:08:52 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "glimports.h"
|
||||
@@ -360,7 +360,7 @@ Knotspec::showpts( REAL *outpt )
|
||||
next->showpts( outpt );
|
||||
} else {
|
||||
for( REAL *lpt=outpt+prewidth; outpt != lpt; outpt += poststride )
|
||||
dprintf( "show %g %g %g\n", outpt[0], outpt[1], outpt[2] );
|
||||
_glu_dprintf( "show %g %g %g\n", outpt[0], outpt[1], outpt[2] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
* trimline.c++
|
||||
*
|
||||
* $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/trimline.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
|
||||
* $Date: 2005/10/28 13:09:23 $ $Revision: 1.2 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/internals/trimline.cc,v 1.2 2005/10/28 13:09:23 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "glimports.h"
|
||||
@@ -162,10 +162,11 @@ Trimline::getNextPts( Arc_ptr botarc )
|
||||
{
|
||||
reset(); swap(); append( tinterp );
|
||||
|
||||
#ifndef NDEBUG
|
||||
PwlArc *lastpwl = botarc->prev->pwlArc;
|
||||
TrimVertex *lastpt1 = &lastpwl->pts[lastpwl->npts-1];
|
||||
#endif
|
||||
TrimVertex *lastpt2 = botarc->pwlArc->pts;
|
||||
|
||||
register TrimVertex *p = jarcl.getnextpt();
|
||||
for( append( p ); p != lastpt2; append( p ) ) {
|
||||
assert( p != lastpt1 );
|
||||
@@ -180,7 +181,9 @@ Trimline::getPrevPts( Arc_ptr botarc )
|
||||
|
||||
PwlArc *lastpwl = botarc->prev->pwlArc;
|
||||
TrimVertex *lastpt1 = &lastpwl->pts[lastpwl->npts-1];
|
||||
#ifndef NDEBUG
|
||||
TrimVertex *lastpt2 = botarc->pwlArc->pts;
|
||||
#endif
|
||||
|
||||
register TrimVertex *q = jarcl.getprevpt();
|
||||
for( append( q ); q != lastpt1; append( q ) ) {
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
** $Date: 2004/05/12 15:29:36 $ $Revision: 1.2 $
|
||||
** $Date: 2005/10/28 13:09:23 $ $Revision: 1.3 $
|
||||
*/
|
||||
/*
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.cc,v 1.2 2004/05/12 15:29:36 brianp Exp $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/monoChain.cc,v 1.3 2005/10/28 13:09:23 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "gluos.h"
|
||||
@@ -61,6 +61,7 @@ extern Int isCusp(directedLine *v);
|
||||
extern Int deleteRepeatDiagonals(Int num_diagonals, directedLine** diagonal_vertices, directedLine** new_vertices);
|
||||
|
||||
//for debug purpose only
|
||||
#if 0 // UNUSED
|
||||
static void drawDiagonals(Int num_diagonals, directedLine** diagonal_vertices)
|
||||
{
|
||||
Int i;
|
||||
@@ -72,6 +73,7 @@ static void drawDiagonals(Int num_diagonals, directedLine** diagonal_vertices)
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*given (x_1, y_1) and (x_2, y_2), and y
|
||||
*return x such that (x,y) is on the line
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
** $Date: 2004/05/12 15:29:36 $ $Revision: 1.3 $
|
||||
** $Date: 2006/03/29 18:46:46 $ $Revision: 1.5 $
|
||||
*/
|
||||
/*
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc,v 1.3 2004/05/12 15:29:36 brianp Exp $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/monoTriangulation.cc,v 1.5 2006/03/29 18:46:46 brianp Exp $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -619,8 +619,10 @@ void monoTriangulationFun(directedLine* monoPolygon, Int (*compFun)(Real*, Real*
|
||||
dec_chain.appendVertex(tempV->getVertex(i));
|
||||
}
|
||||
|
||||
monoTriangulationRecFun(topV->head(), botV->head(), &inc_chain, 0, &dec_chain, 0, compFun, pStream);
|
||||
|
||||
if (!(0 == inc_chain.getNumElements() && 0 == dec_chain.getNumElements())) {
|
||||
monoTriangulationRecFun(topV->head(), botV->head(), &inc_chain, 0,
|
||||
&dec_chain, 0, compFun, pStream);
|
||||
}
|
||||
}
|
||||
|
||||
void monoTriangulation(directedLine* monoPolygon, primStream* pStream)
|
||||
@@ -1037,8 +1039,8 @@ void monoTriangulationRec(directedLine* inc_chain, Int inc_index,
|
||||
primStream* pStream)
|
||||
{
|
||||
Int i;
|
||||
directedLine *temp, *oldtemp;
|
||||
Int tempIndex, oldtempIndex;
|
||||
directedLine *temp, *oldtemp = NULL;
|
||||
Int tempIndex, oldtempIndex = 0;
|
||||
|
||||
assert(inc_chain != NULL && dec_chain != NULL);
|
||||
|
||||
|
||||
@@ -35,28 +35,28 @@
|
||||
/*
|
||||
* mystdio.h
|
||||
*
|
||||
* $Date: 2001/03/19 17:52:03 $ $Revision: 1.3 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/mystdio.h,v 1.3 2001/03/19 17:52:03 pesco Exp $
|
||||
* $Date: 2006/03/14 15:08:52 $ $Revision: 1.4 $
|
||||
* $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/mystdio.h,v 1.4 2006/03/14 15:08:52 brianp Exp $
|
||||
*/
|
||||
|
||||
#ifndef __glumystdio_h_
|
||||
#define __glumystdio_h_
|
||||
|
||||
#ifdef STANDALONE
|
||||
inline void dprintf( char *, ... ) { }
|
||||
inline void _glu_dprintf( char *, ... ) { }
|
||||
#endif
|
||||
|
||||
#ifdef LIBRARYBUILD
|
||||
#ifndef NDEBUG
|
||||
#include <stdio.h>
|
||||
#define dprintf printf
|
||||
#define _glu_dprintf printf
|
||||
#else
|
||||
inline void dprintf( char *, ... ) { }
|
||||
inline void _glu_dprintf( char *, ... ) { }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef GLBUILD
|
||||
inline void dprintf( char *, ... ) { }
|
||||
inline void _glu_dprintf( char *, ... ) { }
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
|
||||
@@ -621,6 +621,7 @@ directedLine* DBG_cutIntersectionPoly(directedLine *polygon, int& cutOccur)
|
||||
//given a polygon, cut the edges off and finally obtain a
|
||||
//a polygon without intersections. The cut-off edges are
|
||||
//dealloated. The new polygon is returned.
|
||||
#if 0 // UNUSED
|
||||
static directedLine* DBG_cutIntersectionPoly_notwork(directedLine *polygon)
|
||||
{
|
||||
directedLine *crt;//current polygon
|
||||
@@ -673,6 +674,7 @@ static directedLine* DBG_cutIntersectionPoly_notwork(directedLine *polygon)
|
||||
find = 0; //go to next loop
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
directedLine* DBG_cutIntersectionAllPoly(directedLine* list)
|
||||
{
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
|
||||
** $Date: 2005/10/28 13:09:23 $ $Revision: 1.2 $
|
||||
*/
|
||||
/*
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.cc,v 1.1 2001/03/17 00:25:41 brianp Exp $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleComp.cc,v 1.2 2005/10/28 13:09:23 brianp Exp $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -159,7 +159,7 @@ void sampleCompLeft(Real* topVertex, Real* botVertex,
|
||||
*/
|
||||
Int midIndex1;
|
||||
Int midIndex2;
|
||||
Int gridMidIndex1, gridMidIndex2;
|
||||
Int gridMidIndex1 = 0, gridMidIndex2 = 0;
|
||||
//midIndex1: array[i] <= v, array[i-1] > v
|
||||
//midIndex2: array[i] >= v, array[i+1] < v
|
||||
// v(gridMidIndex1) >= v(midindex1) > v(gridMidIndex1+1)
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
** $Date: 2001/03/22 11:41:40 $ $Revision: 1.2 $
|
||||
** $Date: 2006/08/30 19:02:45 $ $Revision: 1.4 $
|
||||
*/
|
||||
/*
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc,v 1.2 2001/03/22 11:41:40 joukj Exp $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleCompRight.cc,v 1.4 2006/08/30 19:02:45 brianp Exp $
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -72,7 +72,7 @@ void sampleCompRight(Real* topVertex, Real* botVertex,
|
||||
*/
|
||||
Int midIndex1;
|
||||
Int midIndex2;
|
||||
Int gridMidIndex1, gridMidIndex2;
|
||||
Int gridMidIndex1 = 0, gridMidIndex2 = 0;
|
||||
//midIndex1: array[i] <= v, array[i+1] > v
|
||||
//midIndex2: array[i] >= v, array[i+1] < v
|
||||
midIndex1 = rightChain->findIndexBelowGen(rightGridChain->get_v_value(gridIndex1),
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
** $Date: 2004/05/12 15:29:36 $ $Revision: 1.4 $
|
||||
** $Date: 2005/10/28 13:09:23 $ $Revision: 1.5 $
|
||||
*/
|
||||
/*
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc,v 1.4 2004/05/12 15:29:36 brianp Exp $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc,v 1.5 2005/10/28 13:09:23 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "gluos.h"
|
||||
@@ -976,7 +976,7 @@ void findNeck(vertexArray *leftChain, Int botLeftIndex,
|
||||
void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGridIndex, gridWrap* grid, Int* ret_indices, Int* ret_innerIndices)
|
||||
{
|
||||
|
||||
Int i,k,isHoriz;
|
||||
Int i,k,isHoriz = 0;
|
||||
Int n_ulines = grid->get_n_ulines();
|
||||
Real uMin = grid->get_u_min();
|
||||
Real uMax = grid->get_u_max();
|
||||
@@ -984,7 +984,7 @@ void findLeftGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGrid
|
||||
Real vMin = grid->get_v_min();
|
||||
Real vMax = grid->get_v_max();
|
||||
*/
|
||||
Real slop, uinterc;
|
||||
Real slop = 0.0, uinterc;
|
||||
|
||||
#ifdef SHORTEN_GRID_LINE
|
||||
//uintercBuf stores all the interction u value for each grid line
|
||||
@@ -1102,7 +1102,7 @@ void findRightGridIndices(directedLine* topEdge, Int firstGridIndex, Int lastGri
|
||||
Real vMin = grid->get_v_min();
|
||||
Real vMax = grid->get_v_max();
|
||||
*/
|
||||
Real slop, uinterc;
|
||||
Real slop = 0.0, uinterc;
|
||||
|
||||
#ifdef SHORTEN_GRID_LINE
|
||||
//uintercBuf stores all the interction u value for each grid line
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
/*
|
||||
** Author: Eric Veach, July 1994.
|
||||
**
|
||||
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libtess/dict.c,v 1.1 2001/03/17 00:25:41 brianp Exp $
|
||||
** $Date: 2006/04/19 14:42:01 $ $Revision: 1.3 $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libtess/dict.c,v 1.3 2006/04/19 14:42:01 brianp Exp $
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
@@ -67,9 +67,10 @@ Dict *dictNewDict( void *frame,
|
||||
/* really __gl_dictListDeleteDict */
|
||||
void dictDeleteDict( Dict *dict )
|
||||
{
|
||||
DictNode *node;
|
||||
DictNode *node, *next;
|
||||
|
||||
for( node = dict->head.next; node != &dict->head; node = node->next ) {
|
||||
for( node = dict->head.next; node != &dict->head; node = next ) {
|
||||
next = node->next;
|
||||
memFree( node );
|
||||
}
|
||||
memFree( dict );
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
** $Date: 2001/03/17 00:25:41 $ $Revision: 1.1 $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libutil/error.c,v 1.1 2001/03/17 00:25:41 brianp Exp $
|
||||
** $Date: 2006/06/20 15:30:26 $ $Revision: 1.3 $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libutil/error.c,v 1.3 2006/06/20 15:30:26 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "gluos.h"
|
||||
@@ -41,47 +41,50 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static const char *glErrorStrings[GL_OUT_OF_MEMORY - GL_INVALID_ENUM + 1] = {
|
||||
"invalid enumerant",
|
||||
"invalid value",
|
||||
"invalid operation",
|
||||
"stack overflow",
|
||||
"stack underflow",
|
||||
"out of memory",
|
||||
|
||||
struct token_string
|
||||
{
|
||||
GLuint Token;
|
||||
const char *String;
|
||||
};
|
||||
|
||||
static const char *gluErrorStrings[GLU_INVALID_OPERATION - GLU_INVALID_ENUM + 1] = {
|
||||
"invalid enumerant",
|
||||
"invalid value",
|
||||
"out of memory",
|
||||
"", /* never used but need placeholder */
|
||||
"invalid operation",
|
||||
static const struct token_string Errors[] = {
|
||||
{ GL_NO_ERROR, "no error" },
|
||||
{ GL_INVALID_ENUM, "invalid enumerant" },
|
||||
{ GL_INVALID_VALUE, "invalid value" },
|
||||
{ GL_INVALID_OPERATION, "invalid operation" },
|
||||
{ GL_STACK_OVERFLOW, "stack overflow" },
|
||||
{ GL_STACK_UNDERFLOW, "stack underflow" },
|
||||
{ GL_OUT_OF_MEMORY, "out of memory" },
|
||||
{ GL_TABLE_TOO_LARGE, "table too large" },
|
||||
#ifdef GL_EXT_framebuffer_object
|
||||
{ GL_INVALID_FRAMEBUFFER_OPERATION_EXT, "invalid framebuffer operation" },
|
||||
#endif
|
||||
/* GLU */
|
||||
{ GLU_INVALID_ENUM, "invalid enumerant" },
|
||||
{ GLU_INVALID_VALUE, "invalid value" },
|
||||
{ GLU_OUT_OF_MEMORY, "out of memory" },
|
||||
{ GLU_INCOMPATIBLE_GL_VERSION, "incompatible gl version" },
|
||||
{ GLU_INVALID_OPERATION, "invalid operation" },
|
||||
{ ~0, NULL } /* end of list indicator */
|
||||
};
|
||||
|
||||
#define NERRORS (sizeof(errorStrings)/sizeof(errorStrings[0]))
|
||||
|
||||
|
||||
const GLubyte* GLAPIENTRY
|
||||
gluErrorString(GLenum errorCode)
|
||||
{
|
||||
if (errorCode == 0) {
|
||||
return (const unsigned char *) "no error";
|
||||
}
|
||||
if ((errorCode >= GL_INVALID_ENUM) && (errorCode <= GL_OUT_OF_MEMORY)) {
|
||||
return (const unsigned char *) glErrorStrings[errorCode - GL_INVALID_ENUM];
|
||||
}
|
||||
if (errorCode == GL_TABLE_TOO_LARGE) {
|
||||
return (const unsigned char *) "table too large";
|
||||
}
|
||||
if ((errorCode >= GLU_INVALID_ENUM) && (errorCode <= GLU_INVALID_OPERATION)) {
|
||||
return (const unsigned char *) gluErrorStrings[errorCode - GLU_INVALID_ENUM];
|
||||
int i;
|
||||
for (i = 0; Errors[i].String; i++) {
|
||||
if (Errors[i].Token == errorCode)
|
||||
return (const GLubyte *) Errors[i].String;
|
||||
}
|
||||
if ((errorCode >= GLU_NURBS_ERROR1) && (errorCode <= GLU_NURBS_ERROR37)) {
|
||||
return (const unsigned char *) __gluNURBSErrorString(errorCode - (GLU_NURBS_ERROR1 - 1));
|
||||
return (const GLubyte *) __gluNURBSErrorString(errorCode - (GLU_NURBS_ERROR1 - 1));
|
||||
}
|
||||
if ((errorCode >= GLU_TESS_ERROR1) && (errorCode <= GLU_TESS_ERROR8)) {
|
||||
return (const unsigned char *) __gluTessErrorString(errorCode - (GLU_TESS_ERROR1 - 1));
|
||||
return (const GLubyte *) __gluTessErrorString(errorCode - (GLU_TESS_ERROR1 - 1));
|
||||
}
|
||||
|
||||
return 0;
|
||||
return (const GLubyte *) 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -377,6 +377,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
|
||||
{
|
||||
int i, j, k;
|
||||
int newwidth, newheight;
|
||||
int padBytes;
|
||||
GLubyte *s;
|
||||
const char *t;
|
||||
|
||||
@@ -390,6 +391,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
|
||||
|
||||
newwidth = width / 2;
|
||||
newheight = height / 2;
|
||||
padBytes = ysize - (width*group_size);
|
||||
s = dataout;
|
||||
t = (const char *)datain;
|
||||
|
||||
@@ -405,6 +407,7 @@ static void halveImage_ubyte(GLint components, GLuint width, GLuint height,
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
}
|
||||
@@ -476,6 +479,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height,
|
||||
{
|
||||
int i, j, k;
|
||||
int newwidth, newheight;
|
||||
int padBytes;
|
||||
GLbyte *s;
|
||||
const char *t;
|
||||
|
||||
@@ -489,6 +493,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height,
|
||||
|
||||
newwidth = width / 2;
|
||||
newheight = height / 2;
|
||||
padBytes = ysize - (width*group_size);
|
||||
s = dataout;
|
||||
t = (const char *)datain;
|
||||
|
||||
@@ -504,6 +509,7 @@ static void halveImage_byte(GLint components, GLuint width, GLuint height,
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
}
|
||||
@@ -573,6 +579,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
|
||||
{
|
||||
int i, j, k;
|
||||
int newwidth, newheight;
|
||||
int padBytes;
|
||||
GLushort *s;
|
||||
const char *t;
|
||||
|
||||
@@ -586,6 +593,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
|
||||
|
||||
newwidth = width / 2;
|
||||
newheight = height / 2;
|
||||
padBytes = ysize - (width*group_size);
|
||||
s = dataout;
|
||||
t = (const char *)datain;
|
||||
|
||||
@@ -602,6 +610,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
else
|
||||
@@ -616,6 +625,7 @@ static void halveImage_ushort(GLint components, GLuint width, GLuint height,
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
}
|
||||
@@ -708,6 +718,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
|
||||
{
|
||||
int i, j, k;
|
||||
int newwidth, newheight;
|
||||
int padBytes;
|
||||
GLshort *s;
|
||||
const char *t;
|
||||
|
||||
@@ -721,6 +732,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
|
||||
|
||||
newwidth = width / 2;
|
||||
newheight = height / 2;
|
||||
padBytes = ysize - (width*group_size);
|
||||
s = dataout;
|
||||
t = (const char *)datain;
|
||||
|
||||
@@ -737,6 +749,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
else
|
||||
@@ -758,6 +771,7 @@ static void halveImage_short(GLint components, GLuint width, GLuint height,
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
}
|
||||
@@ -850,6 +864,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
|
||||
{
|
||||
int i, j, k;
|
||||
int newwidth, newheight;
|
||||
int padBytes;
|
||||
GLuint *s;
|
||||
const char *t;
|
||||
|
||||
@@ -863,6 +878,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
|
||||
|
||||
newwidth = width / 2;
|
||||
newheight = height / 2;
|
||||
padBytes = ysize - (width*group_size);
|
||||
s = dataout;
|
||||
t = (const char *)datain;
|
||||
|
||||
@@ -881,6 +897,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
else
|
||||
@@ -899,6 +916,7 @@ static void halveImage_uint(GLint components, GLuint width, GLuint height,
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
}
|
||||
@@ -990,6 +1008,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
|
||||
{
|
||||
int i, j, k;
|
||||
int newwidth, newheight;
|
||||
int padBytes;
|
||||
GLint *s;
|
||||
const char *t;
|
||||
|
||||
@@ -1003,6 +1022,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
|
||||
|
||||
newwidth = width / 2;
|
||||
newheight = height / 2;
|
||||
padBytes = ysize - (width*group_size);
|
||||
s = dataout;
|
||||
t = (const char *)datain;
|
||||
|
||||
@@ -1019,6 +1039,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
else
|
||||
@@ -1041,6 +1062,7 @@ static void halveImage_int(GLint components, GLuint width, GLuint height,
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
}
|
||||
@@ -1134,6 +1156,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
|
||||
{
|
||||
int i, j, k;
|
||||
int newwidth, newheight;
|
||||
int padBytes;
|
||||
GLfloat *s;
|
||||
const char *t;
|
||||
|
||||
@@ -1147,6 +1170,7 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
|
||||
|
||||
newwidth = width / 2;
|
||||
newheight = height / 2;
|
||||
padBytes = ysize - (width*group_size);
|
||||
s = dataout;
|
||||
t = (const char *)datain;
|
||||
|
||||
@@ -1163,26 +1187,28 @@ static void halveImage_float(GLint components, GLuint width, GLuint height,
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
else
|
||||
for (i = 0; i < newheight; i++) {
|
||||
for (j = 0; j < newwidth; j++) {
|
||||
for (k = 0; k < components; k++) {
|
||||
GLuint b;
|
||||
b = __GLU_SWAP_4_BYTES(t);
|
||||
s[0] = *(GLfloat*)&b;
|
||||
b = __GLU_SWAP_4_BYTES(t+group_size);
|
||||
s[0] += *(GLfloat*)&b;
|
||||
b = __GLU_SWAP_4_BYTES(t+ysize);
|
||||
s[0] += *(GLfloat*)&b;
|
||||
b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
|
||||
s[0] += *(GLfloat*)&b;
|
||||
union { GLuint b; GLfloat f; } swapbuf;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(t);
|
||||
s[0] = swapbuf.f;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(t+group_size);
|
||||
s[0] += swapbuf.f;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize);
|
||||
s[0] += swapbuf.f;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(t+ysize+group_size);
|
||||
s[0] += swapbuf.f;
|
||||
s[0] /= 4;
|
||||
s++; t += element_size;
|
||||
}
|
||||
t += group_size;
|
||||
}
|
||||
t += padBytes;
|
||||
t += ysize;
|
||||
}
|
||||
}
|
||||
@@ -1409,6 +1435,9 @@ static void scale_internal_ubyte(GLint components, GLint widthin,
|
||||
highy_float = convy_float;
|
||||
|
||||
for (i = 0; i < heightout; i++) {
|
||||
/* Clamp here to be sure we don't read beyond input buffer. */
|
||||
if (highy_int >= heightin)
|
||||
highy_int = heightin - 1;
|
||||
lowx_int = 0;
|
||||
lowx_float = 0;
|
||||
highx_int = convx_int;
|
||||
@@ -1450,7 +1479,7 @@ static void scale_internal_ubyte(GLint components, GLint widthin,
|
||||
totals[k] += (GLubyte)(*(temp_index)) * percent;
|
||||
}
|
||||
|
||||
/* calculate the value for pixels in the last row */
|
||||
/* calculate the value for pixels in the last row */
|
||||
y_percent = highy_float;
|
||||
percent = y_percent * (1-lowx_float);
|
||||
temp = (const char *)datain + xindex + highy_int * ysize;
|
||||
@@ -1623,6 +1652,9 @@ static void scale_internal_byte(GLint components, GLint widthin,
|
||||
highy_float = convy_float;
|
||||
|
||||
for (i = 0; i < heightout; i++) {
|
||||
/* Clamp here to be sure we don't read beyond input buffer. */
|
||||
if (highy_int >= heightin)
|
||||
highy_int = heightin - 1;
|
||||
lowx_int = 0;
|
||||
lowx_float = 0;
|
||||
highx_int = convx_int;
|
||||
@@ -1838,6 +1870,9 @@ static void scale_internal_ushort(GLint components, GLint widthin,
|
||||
highy_float = convy_float;
|
||||
|
||||
for (i = 0; i < heightout; i++) {
|
||||
/* Clamp here to be sure we don't read beyond input buffer. */
|
||||
if (highy_int >= heightin)
|
||||
highy_int = heightin - 1;
|
||||
lowx_int = 0;
|
||||
lowx_float = 0;
|
||||
highx_int = convx_int;
|
||||
@@ -2117,6 +2152,9 @@ static void scale_internal_short(GLint components, GLint widthin,
|
||||
highy_float = convy_float;
|
||||
|
||||
for (i = 0; i < heightout; i++) {
|
||||
/* Clamp here to be sure we don't read beyond input buffer. */
|
||||
if (highy_int >= heightin)
|
||||
highy_int = heightin - 1;
|
||||
lowx_int = 0;
|
||||
lowx_float = 0;
|
||||
highx_int = convx_int;
|
||||
@@ -2406,6 +2444,9 @@ static void scale_internal_uint(GLint components, GLint widthin,
|
||||
highy_float = convy_float;
|
||||
|
||||
for (i = 0; i < heightout; i++) {
|
||||
/* Clamp here to be sure we don't read beyond input buffer. */
|
||||
if (highy_int >= heightin)
|
||||
highy_int = heightin - 1;
|
||||
lowx_int = 0;
|
||||
lowx_float = 0;
|
||||
highx_int = convx_int;
|
||||
@@ -2692,6 +2733,9 @@ static void scale_internal_int(GLint components, GLint widthin,
|
||||
highy_float = convy_float;
|
||||
|
||||
for (i = 0; i < heightout; i++) {
|
||||
/* Clamp here to be sure we don't read beyond input buffer. */
|
||||
if (highy_int >= heightin)
|
||||
highy_int = heightin - 1;
|
||||
lowx_int = 0;
|
||||
lowx_float = 0;
|
||||
highx_int = convx_int;
|
||||
@@ -2962,7 +3006,7 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
int l, m;
|
||||
const char *left, *right;
|
||||
|
||||
GLuint swapbuf; /* unsigned buffer */
|
||||
union { GLuint b; GLfloat f; } swapbuf;
|
||||
|
||||
if (widthin == widthout*2 && heightin == heightout*2) {
|
||||
halveImage_float(components, widthin, heightin,
|
||||
@@ -2985,6 +3029,9 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
highy_float = convy_float;
|
||||
|
||||
for (i = 0; i < heightout; i++) {
|
||||
/* Clamp here to be sure we don't read beyond input buffer. */
|
||||
if (highy_int >= heightin)
|
||||
highy_int = heightin - 1;
|
||||
lowx_int = 0;
|
||||
lowx_float = 0;
|
||||
highx_int = convx_int;
|
||||
@@ -3008,8 +3055,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3020,8 +3067,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * y_percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * y_percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * y_percent;
|
||||
}
|
||||
@@ -3033,8 +3080,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3047,8 +3094,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3058,8 +3105,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * y_percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * y_percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * y_percent;
|
||||
}
|
||||
@@ -3070,8 +3117,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3084,10 +3131,10 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0; k < components;
|
||||
k++, left += element_size, right += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(left);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * (1-lowx_float);
|
||||
swapbuf = __GLU_SWAP_4_BYTES(right);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * highx_float;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(left);
|
||||
totals[k] += swapbuf.f * (1-lowx_float);
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(right);
|
||||
totals[k] += swapbuf.f * highx_float;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)left * (1-lowx_float)
|
||||
+ *(const GLfloat*)right * highx_float;
|
||||
@@ -3101,8 +3148,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3112,8 +3159,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * x_percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * x_percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * x_percent;
|
||||
}
|
||||
@@ -3124,8 +3171,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3138,8 +3185,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3149,8 +3196,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * y_percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * y_percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * y_percent;
|
||||
}
|
||||
@@ -3161,8 +3208,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3173,8 +3220,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf * percent;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f * percent;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index * percent;
|
||||
}
|
||||
@@ -3190,8 +3237,8 @@ static void scale_internal_float(GLint components, GLint widthin,
|
||||
for (k = 0, temp_index = temp; k < components;
|
||||
k++, temp_index += element_size) {
|
||||
if (myswap_bytes) {
|
||||
swapbuf = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += *(const GLfloat*)&swapbuf;
|
||||
swapbuf.b = __GLU_SWAP_4_BYTES(temp_index);
|
||||
totals[k] += swapbuf.f;
|
||||
} else {
|
||||
totals[k] += *(const GLfloat*)temp_index;
|
||||
}
|
||||
@@ -3824,10 +3871,12 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat,
|
||||
if (width == newwidth && height == newheight) {
|
||||
/* Use usersImage for level userLevel */
|
||||
if (baseLevel <= level && level <= maxLevel) {
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length);
|
||||
glTexImage2D(target, level, internalFormat, width,
|
||||
height, 0, format, type,
|
||||
usersImage);
|
||||
}
|
||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
if(levels == 0) { /* we're done. clean up and return */
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, psm.unpack_alignment);
|
||||
glPixelStorei(GL_UNPACK_SKIP_ROWS, psm.unpack_skip_rows);
|
||||
@@ -6569,16 +6618,16 @@ static void halve1DimagePackedPixel(int components,
|
||||
* Contributed by Gerk Huisma <gerk@five-d.demon.nl>.
|
||||
*/
|
||||
|
||||
typedef GLAPI void (GLAPIENTRY *TexImage3Dproc)( GLenum target, GLint level,
|
||||
typedef void (GLAPIENTRY *TexImage3Dproc)( GLenum target, GLint level,
|
||||
GLenum internalFormat,
|
||||
GLsizei width, GLsizei height,
|
||||
GLsizei depth, GLint border,
|
||||
GLenum format, GLenum type,
|
||||
const GLvoid *pixels );
|
||||
|
||||
static TexImage3Dproc pTexImage3D;
|
||||
static TexImage3Dproc pTexImage3D = 0;
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef _WIN32
|
||||
# include <dlfcn.h>
|
||||
# include <sys/types.h>
|
||||
#else
|
||||
@@ -6593,7 +6642,7 @@ static void gluTexImage3D( GLenum target, GLint level,
|
||||
const GLvoid *pixels )
|
||||
{
|
||||
if (!pTexImage3D) {
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3D");
|
||||
if (!pTexImage3D)
|
||||
pTexImage3D = (TexImage3Dproc) wglGetProcAddress("glTexImage3DEXT");
|
||||
@@ -7376,19 +7425,17 @@ static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth,
|
||||
GLint depthAtLevelOne= (depthPowerOf2 > 1) ?
|
||||
depthPowerOf2 >> 1 :
|
||||
depthPowerOf2;
|
||||
GLenum proxyTarget;
|
||||
GLenum proxyTarget = GL_PROXY_TEXTURE_3D;
|
||||
assert(widthAtLevelOne > 0);
|
||||
assert(heightAtLevelOne > 0);
|
||||
assert(depthAtLevelOne > 0);
|
||||
|
||||
/* does width x height x depth at level 1 & all their mipmaps fit? */
|
||||
if (target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D) {
|
||||
proxyTarget = GL_PROXY_TEXTURE_3D;
|
||||
gluTexImage3D(proxyTarget, 1, /* must be non-zero */
|
||||
internalFormat,
|
||||
widthAtLevelOne,heightAtLevelOne,depthAtLevelOne,
|
||||
0,format,type,NULL);
|
||||
}
|
||||
assert(target == GL_TEXTURE_3D || target == GL_PROXY_TEXTURE_3D);
|
||||
gluTexImage3D(proxyTarget, 1, /* must be non-zero */
|
||||
internalFormat,
|
||||
widthAtLevelOne,heightAtLevelOne,depthAtLevelOne,
|
||||
0,format,type,NULL);
|
||||
glGetTexLevelParameteriv(proxyTarget, 1,GL_TEXTURE_WIDTH,&proxyWidth);
|
||||
/* does it fit??? */
|
||||
if (proxyWidth == 0) { /* nope, so try again with these sizes */
|
||||
@@ -8624,7 +8671,8 @@ static void halveImageSlice(int components,
|
||||
int halfHeight= height / 2;
|
||||
int halfDepth= depth / 2;
|
||||
const char *src= (const char *)dataIn;
|
||||
int padBytes= rowSizeInBytes - (width * groupSizeInBytes);
|
||||
int rowPadBytes= rowSizeInBytes - (width * groupSizeInBytes);
|
||||
int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
|
||||
int outIndex= 0;
|
||||
|
||||
assert((width == 1 || height == 1) && depth >= 2);
|
||||
@@ -8708,7 +8756,7 @@ static void halveImageSlice(int components,
|
||||
/* skip over to next horizontal square of 4 */
|
||||
src+= groupSizeInBytes;
|
||||
} /* for jj */
|
||||
src+= padBytes;
|
||||
src+= rowPadBytes;
|
||||
|
||||
src+= rowSizeInBytes;
|
||||
} /* for ii */
|
||||
@@ -8753,11 +8801,12 @@ static void halveImageSlice(int components,
|
||||
|
||||
src+= elementSizeInBytes;
|
||||
} /* for cc */
|
||||
src+= padBytes;
|
||||
src+= rowPadBytes;
|
||||
|
||||
/* skip over to next vertical square of 4 */
|
||||
src+= rowSizeInBytes;
|
||||
} /* for jj */
|
||||
src+= imagePadBytes;
|
||||
|
||||
src+= imageSizeInBytes;
|
||||
} /* for ii */
|
||||
@@ -8797,7 +8846,8 @@ static void halveImage3D(int components,
|
||||
int halfHeight= height / 2;
|
||||
int halfDepth= depth / 2;
|
||||
const char *src= (const char *) dataIn;
|
||||
int padBytes= rowSizeInBytes - (width*groupSizeInBytes);
|
||||
int rowPadBytes= rowSizeInBytes - (width*groupSizeInBytes);
|
||||
int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
|
||||
int outIndex= 0;
|
||||
|
||||
for (dd= 0; dd < halfDepth; dd++) {
|
||||
@@ -8853,7 +8903,7 @@ static void halveImage3D(int components,
|
||||
src+= groupSizeInBytes;
|
||||
} /* for jj */
|
||||
/* skip past pad bytes, if any, to get to next row */
|
||||
src+= padBytes;
|
||||
src+= rowPadBytes;
|
||||
|
||||
/* src is at beginning of a row here, but it's the second row of
|
||||
* the square block of 4 pixels that we just worked on so we
|
||||
@@ -8868,6 +8918,9 @@ static void halveImage3D(int components,
|
||||
src+= rowSizeInBytes;
|
||||
} /* for ii */
|
||||
|
||||
/* skip past pad bytes, if any, to get to next image */
|
||||
src+= imagePadBytes;
|
||||
|
||||
src+= imageSizeInBytes;
|
||||
} /* for dd */
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
** published by SGI, but has not been independently verified as being
|
||||
** compliant with the OpenGL(R) version 1.2.1 Specification.
|
||||
**
|
||||
** $Date: 2002/11/01 23:45:31 $ $Revision: 1.5 $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libutil/project.c,v 1.5 2002/11/01 23:45:31 brianp Exp $
|
||||
** $Date: 2006/05/01 16:01:17 $ $Revision: 1.6 $
|
||||
** $Header: /cvs/mesa/Mesa/src/glu/sgi/libutil/project.c,v 1.6 2006/05/01 16:01:17 brianp Exp $
|
||||
*/
|
||||
|
||||
#include "gluos.h"
|
||||
@@ -169,70 +169,73 @@ static void __gluMultMatrixVecd(const GLdouble matrix[16], const GLdouble in[4],
|
||||
|
||||
/*
|
||||
** inverse = invert(src)
|
||||
** New, faster implementation by Shan Hao Bo, April 2006.
|
||||
*/
|
||||
static int __gluInvertMatrixd(const GLdouble src[16], GLdouble inverse[16])
|
||||
{
|
||||
int i, j, k, swap;
|
||||
double t;
|
||||
GLdouble temp[4][4];
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
for (j=0; j<4; j++) {
|
||||
temp[i][j] = src[i*4+j];
|
||||
}
|
||||
}
|
||||
__gluMakeIdentityd(inverse);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
/*
|
||||
** Look for largest element in column
|
||||
*/
|
||||
swap = i;
|
||||
for (j = i + 1; j < 4; j++) {
|
||||
if (fabs(temp[j][i]) > fabs(temp[i][i])) {
|
||||
swap = j;
|
||||
}
|
||||
}
|
||||
|
||||
if (swap != i) {
|
||||
/*
|
||||
** Swap rows.
|
||||
*/
|
||||
for (k = 0; k < 4; k++) {
|
||||
t = temp[i][k];
|
||||
temp[i][k] = temp[swap][k];
|
||||
temp[swap][k] = t;
|
||||
|
||||
t = inverse[i*4+k];
|
||||
inverse[i*4+k] = inverse[swap*4+k];
|
||||
inverse[swap*4+k] = t;
|
||||
}
|
||||
}
|
||||
|
||||
if (temp[i][i] == 0) {
|
||||
/*
|
||||
** No non-zero pivot. The matrix is singular, which shouldn't
|
||||
** happen. This means the user gave us a bad matrix.
|
||||
*/
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
t = temp[i][i];
|
||||
for (k = 0; k < 4; k++) {
|
||||
temp[i][k] /= t;
|
||||
inverse[i*4+k] /= t;
|
||||
}
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (j != i) {
|
||||
t = temp[j][i];
|
||||
for (k = 0; k < 4; k++) {
|
||||
temp[j][k] -= temp[i][k]*t;
|
||||
inverse[j*4+k] -= inverse[i*4+k]*t;
|
||||
int i, j, k;
|
||||
double t;
|
||||
GLdouble temp[4][4];
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
for (j=0; j<4; j++) {
|
||||
temp[i][j] = src[i*4+j];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return GL_TRUE;
|
||||
__gluMakeIdentityd(inverse);
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (temp[i][i] == 0.0f) {
|
||||
/*
|
||||
** Look for non-zero element in column
|
||||
*/
|
||||
for (j = i + 1; j < 4; j++) {
|
||||
if (temp[j][i] != 0.0f) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (j != 4) {
|
||||
/*
|
||||
** Swap rows.
|
||||
*/
|
||||
for (k = 0; k < 4; k++) {
|
||||
t = temp[i][k];
|
||||
temp[i][k] = temp[j][k];
|
||||
temp[j][k] = t;
|
||||
|
||||
t = inverse[i*4+k];
|
||||
inverse[i*4+k] = inverse[j*4+k];
|
||||
inverse[j*4+k] = t;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*
|
||||
** No non-zero pivot. The matrix is singular,
|
||||
which shouldn't
|
||||
** happen. This means the user gave us a bad
|
||||
matrix.
|
||||
*/
|
||||
return GL_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
t = 1.0f / temp[i][i];
|
||||
for (k = 0; k < 4; k++) {
|
||||
temp[i][k] *= t;
|
||||
inverse[i*4+k] *= t;
|
||||
}
|
||||
for (j = 0; j < 4; j++) {
|
||||
if (j != i) {
|
||||
t = temp[j][i];
|
||||
for (k = 0; k < 4; k++) {
|
||||
temp[j][k] -= temp[i][k]*t;
|
||||
inverse[j*4+k] -= inverse[i*4+k]*t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
static void __gluMultMatricesd(const GLdouble a[16], const GLdouble b[16],
|
||||
|
||||
@@ -444,7 +444,7 @@ gluPartialDisk(GLUquadric *qobj, GLdouble innerRadius,
|
||||
GLfloat sintemp, costemp;
|
||||
GLfloat deltaRadius;
|
||||
GLfloat radiusLow, radiusHigh;
|
||||
GLfloat texLow, texHigh;
|
||||
GLfloat texLow = 0.0, texHigh = 0.0;
|
||||
GLfloat angleOffset;
|
||||
GLint slices2;
|
||||
GLint finish;
|
||||
@@ -713,8 +713,8 @@ gluSphere(GLUquadric *qobj, GLdouble radius, GLint slices, GLint stacks)
|
||||
GLfloat cosCache3b[CACHE_SIZE];
|
||||
GLfloat angle;
|
||||
GLfloat zLow, zHigh;
|
||||
GLfloat sintemp1, sintemp2, sintemp3, sintemp4;
|
||||
GLfloat costemp1, costemp2, costemp3, costemp4;
|
||||
GLfloat sintemp1, sintemp2, sintemp3 = 0.0, sintemp4 = 0.0;
|
||||
GLfloat costemp1, costemp2 = 0.0, costemp3 = 0.0, costemp4 = 0.0;
|
||||
GLboolean needCache2, needCache3;
|
||||
GLint start, finish;
|
||||
|
||||
|
||||
@@ -37,24 +37,12 @@ glutKeyboardFunc(GLUTkeyboardCB keyboardFunc)
|
||||
gState.currentWindow->keyboard = keyboardFunc;
|
||||
}
|
||||
|
||||
void APIENTRY
|
||||
glutKeyboardUpFunc(GLUTkeyboardCB keyboardUpFunc)
|
||||
{
|
||||
gState.currentWindow->keyboardUp = keyboardUpFunc;
|
||||
}
|
||||
|
||||
void APIENTRY
|
||||
glutSpecialFunc(GLUTspecialCB specialFunc)
|
||||
{
|
||||
gState.currentWindow->special = specialFunc;
|
||||
}
|
||||
|
||||
void APIENTRY
|
||||
glutSpecialUpFunc(GLUTspecialCB specialUpFunc)
|
||||
{
|
||||
gState.currentWindow->specialUp = specialUpFunc;
|
||||
}
|
||||
|
||||
void APIENTRY
|
||||
glutMouseFunc(GLUTmouseCB mouseFunc)
|
||||
{
|
||||
@@ -147,11 +135,6 @@ glutOverlayDisplayFunc(GLUTdisplayCB displayFunc)
|
||||
{
|
||||
}
|
||||
|
||||
void APIENTRY
|
||||
glutJoystickFunc(GLUTjoystickCB joystickFunc, int pollInterval)
|
||||
{
|
||||
}
|
||||
|
||||
void APIENTRY
|
||||
glutSpaceballMotionFunc(GLUTspaceMotionCB spaceMotionFunc)
|
||||
{
|
||||
|
||||
@@ -63,10 +63,8 @@ public:
|
||||
GLUTpassiveCB passive; /* passive motion (x,y) */
|
||||
GLUTentryCB entry; /* window entry/exit (state) */
|
||||
GLUTkeyboardCB keyboard; /* keyboard (ASCII,x,y) */
|
||||
GLUTkeyboardCB keyboardUp; /* keyboard up (ASCII,x,y) */
|
||||
GLUTvisibilityCB visibility; /* visibility */
|
||||
GLUTspecialCB special; /* special key */
|
||||
GLUTspecialCB specialUp; /* special key up */
|
||||
GLUTwindowStatusCB windowStatus; /* window status */
|
||||
|
||||
bool anyevents; // were any events received?
|
||||
|
||||
@@ -17,6 +17,8 @@ UseHeaders [ FDirName $(SUBDIR) glapi ] ;
|
||||
UseHeaders [ FDirName $(SUBDIR) math ] ;
|
||||
UseHeaders [ FDirName $(SUBDIR) tnl ] ;
|
||||
UseHeaders [ FDirName $(SUBDIR) shader ] ;
|
||||
UseHeaders [ FDirName $(SUBDIR) shader grammar ] ;
|
||||
UseHeaders [ FDirName $(SUBDIR) shader slang ] ;
|
||||
UseHeaders [ FDirName $(SUBDIR) swrast ] ;
|
||||
UseHeaders [ FDirName $(SUBDIR) swrast_setup ] ;
|
||||
|
||||
@@ -26,6 +28,8 @@ SEARCH_SOURCE += [ FDirName $(SUBDIR) glapi ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(SUBDIR) main ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(SUBDIR) math ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(SUBDIR) shader ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(SUBDIR) shader grammar ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(SUBDIR) shader slang ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(SUBDIR) swrast ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(SUBDIR) swrast_setup ] ;
|
||||
SEARCH_SOURCE += [ FDirName $(SUBDIR) tnl ] ;
|
||||
@@ -78,9 +82,18 @@ if $(TARGET_ARCH) = x86 {
|
||||
sse_normal.S
|
||||
read_rgba_span_x86.S
|
||||
|
||||
t_vertex_sse.c
|
||||
t_vb_arbprogram_sse.c
|
||||
t_vtx_x86.c
|
||||
t_vtx_x86_gcc.S
|
||||
|
||||
slang_execute_x86.c
|
||||
|
||||
x86sse.c
|
||||
;
|
||||
|
||||
SEARCH_SOURCE += [ FDirName $(SUBDIR) x86 rtasm ] ;
|
||||
|
||||
} else if $(TARGET_ARCH) = ppc {
|
||||
|
||||
arch_sources =
|
||||
@@ -110,6 +123,7 @@ StaticLibrary libmesa.a :
|
||||
api_noop.c
|
||||
api_validate.c
|
||||
accum.c
|
||||
arrayobj.c
|
||||
attrib.c
|
||||
blend.c
|
||||
bufferobj.c
|
||||
@@ -120,16 +134,21 @@ StaticLibrary libmesa.a :
|
||||
convolve.c
|
||||
debug.c
|
||||
depth.c
|
||||
depthstencil.c
|
||||
dlist.c
|
||||
drawpix.c
|
||||
driverfuncs.c
|
||||
enable.c
|
||||
enums.c
|
||||
eval.c
|
||||
execmem.c
|
||||
extensions.c
|
||||
fbobject.c
|
||||
feedback.c
|
||||
fog.c
|
||||
framebuffer.c
|
||||
get.c
|
||||
getstring.c
|
||||
hash.c
|
||||
hint.c
|
||||
histogram.c
|
||||
@@ -138,19 +157,23 @@ StaticLibrary libmesa.a :
|
||||
light.c
|
||||
lines.c
|
||||
matrix.c
|
||||
mipmap.c
|
||||
occlude.c
|
||||
pixel.c
|
||||
points.c
|
||||
polygon.c
|
||||
rastpos.c
|
||||
renderbuffer.c
|
||||
state.c
|
||||
stencil.c
|
||||
texcompress.c
|
||||
texcompress_s3tc.c
|
||||
texcompress_fxt1.c
|
||||
texenvprogram.c
|
||||
texformat.c
|
||||
teximage.c
|
||||
texobj.c
|
||||
texrender.c
|
||||
texstate.c
|
||||
texstore.c
|
||||
varray.c
|
||||
@@ -178,6 +201,8 @@ StaticLibrary libmesa.a :
|
||||
t_save_api.c
|
||||
t_save_loopback.c
|
||||
t_save_playback.c
|
||||
t_vb_arbprogram.c
|
||||
t_vb_arbshader.c
|
||||
t_vb_cull.c
|
||||
t_vb_fog.c
|
||||
t_vb_light.c
|
||||
@@ -188,26 +213,24 @@ StaticLibrary libmesa.a :
|
||||
t_vb_texgen.c
|
||||
t_vb_texmat.c
|
||||
t_vb_vertex.c
|
||||
t_vp_build.c
|
||||
t_vertex.c
|
||||
t_vertex_c.c
|
||||
t_vertex_codegen.c
|
||||
t_vertex_generic.c
|
||||
t_vtx_api.c
|
||||
t_vtx_generic.c
|
||||
t_vtx_x86.c
|
||||
t_vtx_eval.c
|
||||
t_vtx_exec.c
|
||||
|
||||
# swrast
|
||||
s_fragprog_to_c.c
|
||||
s_aaline.c
|
||||
s_aatriangle.c
|
||||
s_accum.c
|
||||
s_alpha.c
|
||||
s_alphabuf.c
|
||||
s_arbshader.c
|
||||
s_atifragshader.c
|
||||
s_auxbuffer.c
|
||||
s_bitmap.c
|
||||
s_blend.c
|
||||
s_blit.c
|
||||
s_buffers.c
|
||||
s_copypix.c
|
||||
s_context.c
|
||||
@@ -220,13 +243,12 @@ StaticLibrary libmesa.a :
|
||||
s_logic.c
|
||||
s_masking.c
|
||||
s_nvfragprog.c
|
||||
s_pixeltex.c
|
||||
s_points.c
|
||||
s_readpix.c
|
||||
s_span.c
|
||||
s_stencil.c
|
||||
s_tcc.c
|
||||
s_texture.c
|
||||
s_texcombine.c
|
||||
s_texfilter.c
|
||||
s_texstore.c
|
||||
s_triangle.c
|
||||
s_zoom.c
|
||||
@@ -236,18 +258,40 @@ StaticLibrary libmesa.a :
|
||||
ss_triangle.c
|
||||
|
||||
# shader
|
||||
arbfragparse.c
|
||||
arbprogparse.c
|
||||
arbprogram.c
|
||||
arbvertparse.c
|
||||
atifragshader.c
|
||||
grammar_mesa.c
|
||||
nvfragparse.c
|
||||
nvprogram.c
|
||||
nvvertexec.c
|
||||
nvvertparse.c
|
||||
program.c
|
||||
shaderobjects.c
|
||||
shaderobjects_3dlabs.c
|
||||
|
||||
# shader/grammar
|
||||
grammar_mesa.c
|
||||
|
||||
# shader/slang
|
||||
slang_analyse.c
|
||||
slang_assemble.c
|
||||
slang_assemble_assignment.c
|
||||
slang_assemble_conditional.c
|
||||
slang_assemble_constructor.c
|
||||
slang_assemble_typeinfo.c
|
||||
slang_compile.c
|
||||
slang_compile_function.c
|
||||
slang_compile_operation.c
|
||||
slang_compile_struct.c
|
||||
slang_compile_variable.c
|
||||
slang_execute.c
|
||||
slang_export.c
|
||||
slang_library_noise.c
|
||||
slang_library_texsample.c
|
||||
slang_link.c
|
||||
slang_preprocess.c
|
||||
slang_storage.c
|
||||
slang_utility.c
|
||||
|
||||
$(arch_sources)
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ static void _ac_fallbacks_init( GLcontext *ctx )
|
||||
cl->Type = GL_FLOAT;
|
||||
cl->Stride = 0;
|
||||
cl->StrideB = 0;
|
||||
cl->Ptr = (GLubyte *) &ctx->Current.Index;
|
||||
cl->Ptr = (GLubyte *) &ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX];
|
||||
cl->Enabled = 1;
|
||||
cl->Flags = CA_CLIENT_DATA; /* hack */
|
||||
#if FEATURE_ARB_vertex_buffer_object
|
||||
@@ -292,7 +292,7 @@ static void _ac_raw_init( GLcontext *ctx )
|
||||
ac->Raw.Index = ac->Fallback.Index;
|
||||
ac->Raw.Normal = ac->Fallback.Normal;
|
||||
ac->Raw.SecondaryColor = ac->Fallback.SecondaryColor;
|
||||
ac->Raw.Vertex = ctx->Array.Vertex;
|
||||
ac->Raw.Vertex = ctx->Array.ArrayObj->Vertex;
|
||||
|
||||
ac->IsCached.Color = GL_FALSE;
|
||||
ac->IsCached.EdgeFlag = GL_FALSE;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.1
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -50,8 +50,8 @@ reset_texcoord( GLcontext *ctx, GLuint unit )
|
||||
{
|
||||
ACcontext *ac = AC_CONTEXT(ctx);
|
||||
|
||||
if (ctx->Array.TexCoord[unit].Enabled) {
|
||||
ac->Raw.TexCoord[unit] = ctx->Array.TexCoord[unit];
|
||||
if (ctx->Array.ArrayObj->TexCoord[unit].Enabled) {
|
||||
ac->Raw.TexCoord[unit] = ctx->Array.ArrayObj->TexCoord[unit];
|
||||
STRIDE_ARRAY(ac->Raw.TexCoord[unit], ac->start);
|
||||
}
|
||||
else {
|
||||
@@ -73,9 +73,9 @@ static void
|
||||
reset_vertex( GLcontext *ctx )
|
||||
{
|
||||
ACcontext *ac = AC_CONTEXT(ctx);
|
||||
ASSERT(ctx->Array.Vertex.Enabled
|
||||
|| (ctx->VertexProgram._Enabled && ctx->Array.VertexAttrib[0].Enabled));
|
||||
ac->Raw.Vertex = ctx->Array.Vertex;
|
||||
ASSERT(ctx->Array.ArrayObj->Vertex.Enabled
|
||||
|| (ctx->VertexProgram._Enabled && ctx->Array.ArrayObj->VertexAttrib[0].Enabled));
|
||||
ac->Raw.Vertex = ctx->Array.ArrayObj->Vertex;
|
||||
STRIDE_ARRAY(ac->Raw.Vertex, ac->start);
|
||||
ac->IsCached.Vertex = GL_FALSE;
|
||||
ac->NewArrayState &= ~_NEW_ARRAY_VERTEX;
|
||||
@@ -87,8 +87,8 @@ reset_normal( GLcontext *ctx )
|
||||
{
|
||||
ACcontext *ac = AC_CONTEXT(ctx);
|
||||
|
||||
if (ctx->Array.Normal.Enabled) {
|
||||
ac->Raw.Normal = ctx->Array.Normal;
|
||||
if (ctx->Array.ArrayObj->Normal.Enabled) {
|
||||
ac->Raw.Normal = ctx->Array.ArrayObj->Normal;
|
||||
STRIDE_ARRAY(ac->Raw.Normal, ac->start);
|
||||
}
|
||||
else {
|
||||
@@ -105,8 +105,8 @@ reset_color( GLcontext *ctx )
|
||||
{
|
||||
ACcontext *ac = AC_CONTEXT(ctx);
|
||||
|
||||
if (ctx->Array.Color.Enabled) {
|
||||
ac->Raw.Color = ctx->Array.Color;
|
||||
if (ctx->Array.ArrayObj->Color.Enabled) {
|
||||
ac->Raw.Color = ctx->Array.ArrayObj->Color;
|
||||
STRIDE_ARRAY(ac->Raw.Color, ac->start);
|
||||
}
|
||||
else
|
||||
@@ -122,8 +122,8 @@ reset_secondarycolor( GLcontext *ctx )
|
||||
{
|
||||
ACcontext *ac = AC_CONTEXT(ctx);
|
||||
|
||||
if (ctx->Array.SecondaryColor.Enabled) {
|
||||
ac->Raw.SecondaryColor = ctx->Array.SecondaryColor;
|
||||
if (ctx->Array.ArrayObj->SecondaryColor.Enabled) {
|
||||
ac->Raw.SecondaryColor = ctx->Array.ArrayObj->SecondaryColor;
|
||||
STRIDE_ARRAY(ac->Raw.SecondaryColor, ac->start);
|
||||
}
|
||||
else
|
||||
@@ -139,8 +139,8 @@ reset_index( GLcontext *ctx )
|
||||
{
|
||||
ACcontext *ac = AC_CONTEXT(ctx);
|
||||
|
||||
if (ctx->Array.Index.Enabled) {
|
||||
ac->Raw.Index = ctx->Array.Index;
|
||||
if (ctx->Array.ArrayObj->Index.Enabled) {
|
||||
ac->Raw.Index = ctx->Array.ArrayObj->Index;
|
||||
STRIDE_ARRAY(ac->Raw.Index, ac->start);
|
||||
}
|
||||
else
|
||||
@@ -156,8 +156,8 @@ reset_fogcoord( GLcontext *ctx )
|
||||
{
|
||||
ACcontext *ac = AC_CONTEXT(ctx);
|
||||
|
||||
if (ctx->Array.FogCoord.Enabled) {
|
||||
ac->Raw.FogCoord = ctx->Array.FogCoord;
|
||||
if (ctx->Array.ArrayObj->FogCoord.Enabled) {
|
||||
ac->Raw.FogCoord = ctx->Array.ArrayObj->FogCoord;
|
||||
STRIDE_ARRAY(ac->Raw.FogCoord, ac->start);
|
||||
}
|
||||
else
|
||||
@@ -173,8 +173,8 @@ reset_edgeflag( GLcontext *ctx )
|
||||
{
|
||||
ACcontext *ac = AC_CONTEXT(ctx);
|
||||
|
||||
if (ctx->Array.EdgeFlag.Enabled) {
|
||||
ac->Raw.EdgeFlag = ctx->Array.EdgeFlag;
|
||||
if (ctx->Array.ArrayObj->EdgeFlag.Enabled) {
|
||||
ac->Raw.EdgeFlag = ctx->Array.ArrayObj->EdgeFlag;
|
||||
STRIDE_ARRAY(ac->Raw.EdgeFlag, ac->start);
|
||||
}
|
||||
else
|
||||
@@ -185,13 +185,16 @@ reset_edgeflag( GLcontext *ctx )
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \param index the generic vertex array number.
|
||||
*/
|
||||
static void
|
||||
reset_attrib( GLcontext *ctx, GLuint index )
|
||||
{
|
||||
ACcontext *ac = AC_CONTEXT(ctx);
|
||||
|
||||
if (ctx->Array.VertexAttrib[index].Enabled) {
|
||||
ac->Raw.Attrib[index] = ctx->Array.VertexAttrib[index];
|
||||
if (ctx->Array.ArrayObj->VertexAttrib[index].Enabled) {
|
||||
ac->Raw.Attrib[index] = ctx->Array.ArrayObj->VertexAttrib[index];
|
||||
STRIDE_ARRAY(ac->Raw.Attrib[index], ac->start);
|
||||
}
|
||||
else
|
||||
@@ -218,7 +221,7 @@ import( const GLcontext *ctx,
|
||||
|
||||
switch (destType) {
|
||||
case GL_FLOAT:
|
||||
_math_trans_4fc( (GLfloat (*)[4]) to->Ptr,
|
||||
_math_trans_4fn( (GLfloat (*)[4]) to->Ptr,
|
||||
from->Ptr,
|
||||
from->StrideB,
|
||||
from->Type,
|
||||
@@ -340,7 +343,7 @@ import_normal( GLcontext *ctx, GLenum type, GLuint stride )
|
||||
ASSERT(type == GL_FLOAT);
|
||||
ASSERT(stride == 3*sizeof(GLfloat) || stride == 0);
|
||||
|
||||
_math_trans_3f( (GLfloat (*)[3]) to->Ptr,
|
||||
_math_trans_3fn((GLfloat (*)[3]) to->Ptr,
|
||||
from->Ptr,
|
||||
from->StrideB,
|
||||
from->Type,
|
||||
@@ -453,6 +456,9 @@ import_edgeflag( GLcontext *ctx, GLenum type, GLuint stride )
|
||||
ac->IsCached.EdgeFlag = GL_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* \param index the generic vertex array number
|
||||
*/
|
||||
static void
|
||||
import_attrib( GLcontext *ctx, GLuint index, GLenum type, GLuint stride )
|
||||
{
|
||||
@@ -469,13 +475,24 @@ import_attrib( GLcontext *ctx, GLuint index, GLenum type, GLuint stride )
|
||||
ASSERT(stride == 4*sizeof(GLfloat) || stride == 0);
|
||||
ASSERT(ac->count - ac->start < ctx->Const.MaxArrayLockSize);
|
||||
|
||||
_math_trans_4f( (GLfloat (*)[4]) to->Ptr,
|
||||
from->Ptr,
|
||||
from->StrideB,
|
||||
from->Type,
|
||||
from->Size,
|
||||
0,
|
||||
ac->count - ac->start);
|
||||
if (from->Normalized) {
|
||||
_math_trans_4fn( (GLfloat (*)[4]) to->Ptr,
|
||||
from->Ptr,
|
||||
from->StrideB,
|
||||
from->Type,
|
||||
from->Size,
|
||||
0,
|
||||
ac->count - ac->start);
|
||||
}
|
||||
else {
|
||||
_math_trans_4f( (GLfloat (*)[4]) to->Ptr,
|
||||
from->Ptr,
|
||||
from->StrideB,
|
||||
from->Type,
|
||||
from->Size,
|
||||
0,
|
||||
ac->count - ac->start);
|
||||
}
|
||||
|
||||
to->Size = from->Size;
|
||||
to->StrideB = 4 * sizeof(GLfloat);
|
||||
@@ -501,7 +518,7 @@ _ac_import_texcoord( GLcontext *ctx,
|
||||
{
|
||||
ACcontext *ac = AC_CONTEXT(ctx);
|
||||
|
||||
ASSERT(unit < ctx->Const.MaxTextureCoordUnits);
|
||||
ASSERT(unit < MAX_TEXTURE_COORD_UNITS);
|
||||
|
||||
/* Can we keep the existing version?
|
||||
*/
|
||||
@@ -511,7 +528,7 @@ _ac_import_texcoord( GLcontext *ctx,
|
||||
/* Is the request impossible?
|
||||
*/
|
||||
if (reqsize != 0 && ac->Raw.TexCoord[unit].Size > (GLint) reqsize)
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
/* Do we need to pull in a copy of the client data:
|
||||
*/
|
||||
@@ -548,7 +565,7 @@ _ac_import_vertex( GLcontext *ctx,
|
||||
/* Is the request impossible?
|
||||
*/
|
||||
if (reqsize != 0 && ac->Raw.Vertex.Size > (GLint) reqsize)
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
/* Do we need to pull in a copy of the client data:
|
||||
*/
|
||||
@@ -616,7 +633,7 @@ _ac_import_color( GLcontext *ctx,
|
||||
/* Is the request impossible?
|
||||
*/
|
||||
if (reqsize != 0 && ac->Raw.Color.Size > (GLint) reqsize) {
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Do we need to pull in a copy of the client data:
|
||||
@@ -687,7 +704,7 @@ _ac_import_secondarycolor( GLcontext *ctx,
|
||||
/* Is the request impossible?
|
||||
*/
|
||||
if (reqsize != 0 && ac->Raw.SecondaryColor.Size > (GLint) reqsize)
|
||||
return 0;
|
||||
return NULL;
|
||||
|
||||
/* Do we need to pull in a copy of the client data:
|
||||
*/
|
||||
@@ -768,7 +785,10 @@ _ac_import_edgeflag( GLcontext *ctx,
|
||||
}
|
||||
}
|
||||
|
||||
/* GL_NV_vertex_program */
|
||||
/**
|
||||
* For GL_ARB/NV_vertex_program
|
||||
* \param index index of the vertex array, starting at zero.
|
||||
*/
|
||||
struct gl_client_array *
|
||||
_ac_import_attrib( GLcontext *ctx,
|
||||
GLuint index,
|
||||
@@ -831,7 +851,7 @@ _ac_import_range( GLcontext *ctx, GLuint start, GLuint count )
|
||||
* the whole locked range always be dealt with, otherwise hard to
|
||||
* maintain cached data in the face of clipping.
|
||||
*/
|
||||
ac->NewArrayState |= ~ctx->Array._Enabled;
|
||||
ac->NewArrayState |= ~ctx->Array.ArrayObj->_Enabled;
|
||||
ac->start = ctx->Array.LockFirst;
|
||||
ac->count = ctx->Array.LockCount;
|
||||
ASSERT(ac->start == start); /* hmm? */
|
||||
@@ -866,10 +886,10 @@ _ac_import_elements( GLcontext *ctx,
|
||||
switch (new_type) {
|
||||
case GL_UNSIGNED_BYTE:
|
||||
ASSERT(0);
|
||||
return 0;
|
||||
return NULL;
|
||||
case GL_UNSIGNED_SHORT:
|
||||
ASSERT(0);
|
||||
return 0;
|
||||
return NULL;
|
||||
case GL_UNSIGNED_INT: {
|
||||
GLuint *out = (GLuint *)ac->Elts;
|
||||
GLuint i;
|
||||
@@ -898,5 +918,5 @@ _ac_import_elements( GLcontext *ctx,
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.1
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -27,15 +27,26 @@
|
||||
#include "imports.h"
|
||||
#include "buffers.h"
|
||||
#include "context.h"
|
||||
#include "framebuffer.h"
|
||||
#include "occlude.h"
|
||||
#include "program.h"
|
||||
#include "renderbuffer.h"
|
||||
#include "texcompress.h"
|
||||
#include "texformat.h"
|
||||
#include "teximage.h"
|
||||
#include "texobj.h"
|
||||
#include "texstore.h"
|
||||
#if FEATURE_ARB_vertex_buffer_object
|
||||
#include "bufferobj.h"
|
||||
#endif
|
||||
#if FEATURE_EXT_framebuffer_object
|
||||
#include "fbobject.h"
|
||||
#include "texrender.h"
|
||||
#endif
|
||||
#include "arrayobj.h"
|
||||
|
||||
#include "driverfuncs.h"
|
||||
#include "tnl/tnl.h"
|
||||
#include "swrast/swrast.h"
|
||||
|
||||
|
||||
@@ -57,7 +68,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->GetString = NULL; /* REQUIRED! */
|
||||
driver->UpdateState = NULL; /* REQUIRED! */
|
||||
driver->GetBufferSize = NULL; /* REQUIRED! */
|
||||
driver->ResizeBuffers = _swrast_alloc_buffers;
|
||||
driver->ResizeBuffers = _mesa_resize_framebuffer;
|
||||
driver->Error = NULL;
|
||||
|
||||
driver->Finish = NULL;
|
||||
@@ -79,6 +90,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->TexSubImage1D = _mesa_store_texsubimage1d;
|
||||
driver->TexSubImage2D = _mesa_store_texsubimage2d;
|
||||
driver->TexSubImage3D = _mesa_store_texsubimage3d;
|
||||
driver->GetTexImage = _mesa_get_teximage;
|
||||
driver->CopyTexImage1D = _swrast_copy_teximage1d;
|
||||
driver->CopyTexImage2D = _swrast_copy_teximage2d;
|
||||
driver->CopyTexSubImage1D = _swrast_copy_texsubimage1d;
|
||||
@@ -91,11 +103,14 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d;
|
||||
driver->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d;
|
||||
driver->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d;
|
||||
driver->GetCompressedTexImage = _mesa_get_compressed_teximage;
|
||||
driver->CompressedTextureSize = _mesa_compressed_texture_size;
|
||||
driver->BindTexture = NULL;
|
||||
driver->NewTextureObject = _mesa_new_texture_object;
|
||||
driver->DeleteTexture = _mesa_delete_texture_object;
|
||||
driver->NewTextureImage = _mesa_new_texture_image;
|
||||
driver->FreeTexImageData = _mesa_free_texture_image_data;
|
||||
driver->TextureMemCpy = _mesa_memcpy;
|
||||
driver->IsTextureResident = NULL;
|
||||
driver->PrioritizeTexture = NULL;
|
||||
driver->ActiveTexture = NULL;
|
||||
@@ -111,6 +126,9 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->BindProgram = NULL;
|
||||
driver->NewProgram = _mesa_new_program;
|
||||
driver->DeleteProgram = _mesa_delete_program;
|
||||
#if FEATURE_MESA_program_debug
|
||||
driver->GetFragmentProgramRegister = _swrast_get_program_register;
|
||||
#endif /* FEATURE_MESA_program_debug */
|
||||
|
||||
/* simple state commands */
|
||||
driver->AlphaFunc = NULL;
|
||||
@@ -125,7 +143,8 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->ColorMask = NULL;
|
||||
driver->ColorMaterial = NULL;
|
||||
driver->CullFace = NULL;
|
||||
driver->DrawBuffer = _swrast_DrawBuffer;
|
||||
driver->DrawBuffer = NULL;
|
||||
driver->DrawBuffers = NULL;
|
||||
driver->FrontFace = NULL;
|
||||
driver->DepthFunc = NULL;
|
||||
driver->DepthMask = NULL;
|
||||
@@ -148,10 +167,9 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->RenderMode = NULL;
|
||||
driver->Scissor = NULL;
|
||||
driver->ShadeModel = NULL;
|
||||
driver->StencilFunc = NULL;
|
||||
driver->StencilMask = NULL;
|
||||
driver->StencilOp = NULL;
|
||||
driver->ActiveStencilFace = NULL;
|
||||
driver->StencilFuncSeparate = NULL;
|
||||
driver->StencilOpSeparate = NULL;
|
||||
driver->StencilMaskSeparate = NULL;
|
||||
driver->TexGen = NULL;
|
||||
driver->TexEnv = NULL;
|
||||
driver->TexParameter = NULL;
|
||||
@@ -186,9 +204,31 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->BufferSubData = _mesa_buffer_subdata;
|
||||
driver->GetBufferSubData = _mesa_buffer_get_subdata;
|
||||
driver->MapBuffer = _mesa_buffer_map;
|
||||
driver->UnmapBuffer = NULL;
|
||||
driver->UnmapBuffer = _mesa_buffer_unmap;
|
||||
#endif
|
||||
|
||||
#if FEATURE_EXT_framebuffer_object
|
||||
driver->NewFramebuffer = _mesa_new_framebuffer;
|
||||
driver->NewRenderbuffer = _mesa_new_soft_renderbuffer;
|
||||
driver->RenderTexture = _mesa_render_texture;
|
||||
driver->FinishRenderTexture = _mesa_finish_render_texture;
|
||||
driver->FramebufferRenderbuffer = _mesa_framebuffer_renderbuffer;
|
||||
#endif
|
||||
|
||||
#if FEATURE_EXT_framebuffer_blit
|
||||
driver->BlitFramebuffer = _swrast_BlitFramebuffer;
|
||||
#endif
|
||||
|
||||
/* query objects */
|
||||
driver->NewQueryObject = _mesa_new_query_object;
|
||||
driver->BeginQuery = NULL;
|
||||
driver->EndQuery = NULL;
|
||||
|
||||
/* APPLE_vertex_array_object */
|
||||
driver->NewArrayObject = _mesa_new_array_object;
|
||||
driver->DeleteArrayObject = _mesa_delete_array_object;
|
||||
driver->BindArrayObject = NULL;
|
||||
|
||||
/* T&L stuff */
|
||||
driver->NeedValidate = GL_FALSE;
|
||||
driver->ValidateTnlModule = NULL;
|
||||
@@ -197,11 +237,11 @@ _mesa_init_driver_functions(struct dd_function_table *driver)
|
||||
driver->NeedFlush = 0;
|
||||
driver->SaveNeedFlush = 0;
|
||||
|
||||
driver->ProgramStringNotify = _tnl_program_string;
|
||||
driver->FlushVertices = NULL;
|
||||
driver->SaveFlushVertices = NULL;
|
||||
driver->NotifySaveBegin = NULL;
|
||||
driver->LightingSpaceChange = NULL;
|
||||
driver->MakeCurrent = NULL;
|
||||
|
||||
/* display list */
|
||||
driver->NewList = NULL;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,476 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
# (C) Copyright IBM Corporation 2004
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
from xml.sax import saxutils
|
||||
from xml.sax import make_parser
|
||||
from xml.sax.handler import feature_namespaces
|
||||
|
||||
import gl_XML
|
||||
import license
|
||||
import sys, getopt
|
||||
|
||||
|
||||
def printPure():
|
||||
print """# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
|
||||
# define PURE __attribute__((pure))
|
||||
# else
|
||||
# define PURE
|
||||
# endif"""
|
||||
|
||||
def printFastcall():
|
||||
print """# if defined(__i386__) && defined(__GNUC__)
|
||||
# define FASTCALL __attribute__((fastcall))
|
||||
# else
|
||||
# define FASTCALL
|
||||
# endif"""
|
||||
|
||||
def printVisibility(S, s):
|
||||
print """# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
|
||||
# define %s __attribute__((visibility("%s")))
|
||||
# else
|
||||
# define %s
|
||||
# endif""" % (S, s, S)
|
||||
|
||||
def printNoinline():
|
||||
print """# if defined(__GNUC__)
|
||||
# define NOINLINE __attribute__((noinline))
|
||||
# else
|
||||
# define NOINLINE
|
||||
# endif"""
|
||||
|
||||
|
||||
class glXItemFactory(gl_XML.glItemFactory):
|
||||
"""Factory to create GLX protocol oriented objects derived from glItem."""
|
||||
|
||||
def create(self, context, name, attrs):
|
||||
if name == "function":
|
||||
return glXFunction(context, name, attrs)
|
||||
elif name == "enum":
|
||||
return glXEnum(context, name, attrs)
|
||||
elif name == "param":
|
||||
return glXParameter(context, name, attrs)
|
||||
else:
|
||||
return gl_XML.glItemFactory.create(self, context, name, attrs)
|
||||
|
||||
class glXEnumFunction:
|
||||
def __init__(self, name):
|
||||
self.name = name
|
||||
|
||||
# "enums" is a set of lists. The element in the set is the
|
||||
# value of the enum. The list is the list of names for that
|
||||
# value. For example, [0x8126] = {"POINT_SIZE_MIN",
|
||||
# "POINT_SIZE_MIN_ARB", "POINT_SIZE_MIN_EXT",
|
||||
# "POINT_SIZE_MIN_SGIS"}.
|
||||
|
||||
self.enums = {}
|
||||
|
||||
# "count" is indexed by count values. Each element of count
|
||||
# is a list of index to "enums" that have that number of
|
||||
# associated data elements. For example, [4] =
|
||||
# {GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION,
|
||||
# GL_AMBIENT_AND_DIFFUSE} (the enum names are used here,
|
||||
# but the actual hexadecimal values would be in the array).
|
||||
|
||||
self.count = {}
|
||||
|
||||
|
||||
def append(self, count, value, name):
|
||||
if self.enums.has_key( value ):
|
||||
self.enums[value].append(name)
|
||||
else:
|
||||
if not self.count.has_key(count):
|
||||
self.count[count] = []
|
||||
|
||||
self.enums[value] = []
|
||||
self.enums[value].append(name)
|
||||
self.count[count].append(value)
|
||||
|
||||
|
||||
def signature( self ):
|
||||
sig = ""
|
||||
for i in self.count:
|
||||
for e in self.count[i]:
|
||||
sig += "%04x,%u," % (e, i)
|
||||
|
||||
return sig;
|
||||
|
||||
|
||||
def PrintUsingTable(self):
|
||||
"""Emit the body of the __gl*_size function using a pair
|
||||
of look-up tables and a mask. The mask is calculated such
|
||||
that (e & mask) is unique for all the valid values of e for
|
||||
this function. The result of (e & mask) is used as an index
|
||||
into the first look-up table. If it matches e, then the
|
||||
same entry of the second table is returned. Otherwise zero
|
||||
is returned.
|
||||
|
||||
It seems like this should cause better code to be generated.
|
||||
However, on x86 at least, the resulting .o file is about 20%
|
||||
larger then the switch-statment version. I am leaving this
|
||||
code in because the results may be different on other
|
||||
platforms (e.g., PowerPC or x86-64)."""
|
||||
|
||||
return 0
|
||||
count = 0
|
||||
for a in self.enums:
|
||||
count += 1
|
||||
|
||||
# Determine if there is some mask M, such that M = (2^N) - 1,
|
||||
# that will generate unique values for all of the enums.
|
||||
|
||||
mask = 0
|
||||
for i in [1, 2, 3, 4, 5, 6, 7, 8]:
|
||||
mask = (1 << i) - 1
|
||||
|
||||
fail = 0;
|
||||
for a in self.enums:
|
||||
for b in self.enums:
|
||||
if a != b:
|
||||
if (a & mask) == (b & mask):
|
||||
fail = 1;
|
||||
|
||||
if not fail:
|
||||
break;
|
||||
else:
|
||||
mask = 0
|
||||
|
||||
if (mask != 0) and (mask < (2 * count)):
|
||||
masked_enums = {}
|
||||
masked_count = {}
|
||||
|
||||
for i in range(0, mask + 1):
|
||||
masked_enums[i] = "0";
|
||||
masked_count[i] = 0;
|
||||
|
||||
for c in self.count:
|
||||
for e in self.count[c]:
|
||||
i = e & mask
|
||||
masked_enums[i] = '0x%04x /* %s */' % (e, self.enums[e][0])
|
||||
masked_count[i] = c
|
||||
|
||||
|
||||
print ' static const GLushort a[%u] = {' % (mask + 1)
|
||||
for e in masked_enums:
|
||||
print ' %s, ' % (masked_enums[e])
|
||||
print ' };'
|
||||
|
||||
print ' static const GLubyte b[%u] = {' % (mask + 1)
|
||||
for c in masked_count:
|
||||
print ' %u, ' % (masked_count[c])
|
||||
print ' };'
|
||||
|
||||
print ' const unsigned idx = (e & 0x%02xU);' % (mask)
|
||||
print ''
|
||||
print ' return (e == a[idx]) ? (GLint) b[idx] : 0;'
|
||||
return 1;
|
||||
else:
|
||||
return 0;
|
||||
|
||||
def PrintUsingSwitch(self):
|
||||
"""Emit the body of the __gl*_size function using a
|
||||
switch-statement."""
|
||||
|
||||
print ' switch( e ) {'
|
||||
|
||||
for c in self.count:
|
||||
for e in self.count[c]:
|
||||
first = 1
|
||||
|
||||
# There may be multiple enums with the same
|
||||
# value. This happens has extensions are
|
||||
# promoted from vendor-specific or EXT to
|
||||
# ARB and to the core. Emit the first one as
|
||||
# a case label, and emit the others as
|
||||
# commented-out case labels.
|
||||
|
||||
for j in self.enums[e]:
|
||||
if first:
|
||||
print ' case %s:' % (j)
|
||||
first = 0
|
||||
else:
|
||||
print '/* case %s:*/' % (j)
|
||||
|
||||
print ' return %u;' % (c)
|
||||
|
||||
print ' default: return 0;'
|
||||
print ' }'
|
||||
|
||||
|
||||
def Print(self, name):
|
||||
print 'INTERNAL PURE FASTCALL GLint'
|
||||
print '__gl%s_size( GLenum e )' % (name)
|
||||
print '{'
|
||||
|
||||
if not self.PrintUsingTable():
|
||||
self.PrintUsingSwitch()
|
||||
|
||||
print '}'
|
||||
print ''
|
||||
|
||||
|
||||
|
||||
class glXEnum(gl_XML.glEnum):
|
||||
def __init__(self, context, name, attrs):
|
||||
gl_XML.glEnum.__init__(self, context, name, attrs)
|
||||
self.glx_functions = []
|
||||
|
||||
def startElement(self, name, attrs):
|
||||
if name == "size":
|
||||
n = attrs.get('name', None)
|
||||
if not self.context.glx_enum_functions.has_key( n ):
|
||||
f = glXEnumFunction( n )
|
||||
self.context.glx_enum_functions[ f.name ] = f
|
||||
|
||||
temp = attrs.get('count', None)
|
||||
try:
|
||||
c = int(temp)
|
||||
except Exception,e:
|
||||
raise RuntimeError('Invalid count value "%s" for enum "%s" in function "%s" when an integer was expected.' % (temp, self.name, n))
|
||||
|
||||
self.context.glx_enum_functions[ n ].append( c, self.value, self.name )
|
||||
else:
|
||||
gl_XML.glEnum.startElement(self, context, name, attrs)
|
||||
return
|
||||
|
||||
|
||||
class glXParameter(gl_XML.glParameter):
|
||||
def __init__(self, context, name, attrs):
|
||||
self.order = 1;
|
||||
gl_XML.glParameter.__init__(self, context, name, attrs);
|
||||
|
||||
|
||||
class glXFunction(gl_XML.glFunction):
|
||||
glx_rop = 0
|
||||
glx_sop = 0
|
||||
glx_vendorpriv = 0
|
||||
|
||||
# If this is set to true, it means that GLdouble parameters should be
|
||||
# written to the GLX protocol packet in the order they appear in the
|
||||
# prototype. This is different from the "classic" ordering. In the
|
||||
# classic ordering GLdoubles are written to the protocol packet first,
|
||||
# followed by non-doubles. NV_vertex_program was the first extension
|
||||
# to break with this tradition.
|
||||
|
||||
glx_doubles_in_order = 0
|
||||
|
||||
vectorequiv = None
|
||||
handcode = 0
|
||||
ignore = 0
|
||||
can_be_large = 0
|
||||
|
||||
def __init__(self, context, name, attrs):
|
||||
self.vectorequiv = attrs.get('vectorequiv', None)
|
||||
self.count_parameters = None
|
||||
self.counter = None
|
||||
self.output = None
|
||||
self.can_be_large = 0
|
||||
self.reply_always_array = 0
|
||||
|
||||
gl_XML.glFunction.__init__(self, context, name, attrs)
|
||||
return
|
||||
|
||||
def startElement(self, name, attrs):
|
||||
"""Process elements within a function that are specific to GLX."""
|
||||
|
||||
if name == "glx":
|
||||
self.glx_rop = int(attrs.get('rop', "0"))
|
||||
self.glx_sop = int(attrs.get('sop', "0"))
|
||||
self.glx_vendorpriv = int(attrs.get('vendorpriv', "0"))
|
||||
|
||||
if attrs.get('handcode', "false") == "true":
|
||||
self.handcode = 1
|
||||
else:
|
||||
self.handcode = 0
|
||||
|
||||
if attrs.get('ignore', "false") == "true":
|
||||
self.ignore = 1
|
||||
else:
|
||||
self.ignore = 0
|
||||
|
||||
if attrs.get('large', "false") == "true":
|
||||
self.can_be_large = 1
|
||||
else:
|
||||
self.can_be_large = 0
|
||||
|
||||
if attrs.get('doubles_in_order', "false") == "true":
|
||||
self.glx_doubles_in_order = 1
|
||||
else:
|
||||
self.glx_doubles_in_order = 0
|
||||
|
||||
if attrs.get('always_array', "false") == "true":
|
||||
self.reply_always_array = 1
|
||||
else:
|
||||
self.reply_always_array = 0
|
||||
|
||||
else:
|
||||
gl_XML.glFunction.startElement(self, name, attrs)
|
||||
|
||||
|
||||
def append(self, tag_name, p):
|
||||
gl_XML.glFunction.append(self, tag_name, p)
|
||||
|
||||
if p.is_variable_length_array():
|
||||
p.order = 2;
|
||||
elif not self.glx_doubles_in_order and p.p_type.size == 8:
|
||||
p.order = 0;
|
||||
|
||||
if p.p_count_parameters != None:
|
||||
self.count_parameters = p.p_count_parameters
|
||||
|
||||
if p.is_counter:
|
||||
self.counter = p.name
|
||||
|
||||
if p.is_output:
|
||||
self.output = p
|
||||
|
||||
return
|
||||
|
||||
def variable_length_parameter(self):
|
||||
for param in self.fn_parameters:
|
||||
if param.is_variable_length_array():
|
||||
return param
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def command_payload_length(self):
|
||||
size = 0
|
||||
size_string = ""
|
||||
for p in self:
|
||||
if p.is_output: continue
|
||||
temp = p.size_string()
|
||||
try:
|
||||
s = int(temp)
|
||||
size += s
|
||||
except Exception,e:
|
||||
size_string = size_string + " + __GLX_PAD(%s)" % (temp)
|
||||
|
||||
return [size, size_string]
|
||||
|
||||
def command_length(self):
|
||||
[size, size_string] = self.command_payload_length()
|
||||
|
||||
if self.glx_rop != 0:
|
||||
size += 4
|
||||
|
||||
size = ((size + 3) & ~3)
|
||||
return "%u%s" % (size, size_string)
|
||||
|
||||
|
||||
def opcode_real_value(self):
|
||||
if self.glx_vendorpriv != 0:
|
||||
if self.needs_reply():
|
||||
return 17
|
||||
else:
|
||||
return 16
|
||||
else:
|
||||
return self.opcode_value()
|
||||
|
||||
def opcode_value(self):
|
||||
if self.glx_rop != 0:
|
||||
return self.glx_rop
|
||||
elif self.glx_sop != 0:
|
||||
return self.glx_sop
|
||||
elif self.glx_vendorpriv != 0:
|
||||
return self.glx_vendorpriv
|
||||
else:
|
||||
return -1
|
||||
|
||||
def opcode_rop_basename(self):
|
||||
if self.vectorequiv == None:
|
||||
return self.name
|
||||
else:
|
||||
return self.vectorequiv
|
||||
|
||||
def opcode_name(self):
|
||||
if self.glx_rop != 0:
|
||||
return "X_GLrop_%s" % (self.opcode_rop_basename())
|
||||
elif self.glx_sop != 0:
|
||||
return "X_GLsop_%s" % (self.name)
|
||||
elif self.glx_vendorpriv != 0:
|
||||
return "X_GLvop_%s" % (self.name)
|
||||
else:
|
||||
return "ERROR"
|
||||
|
||||
def opcode_real_name(self):
|
||||
if self.glx_vendorpriv != 0:
|
||||
if self.needs_reply():
|
||||
return "X_GLXVendorPrivateWithReply"
|
||||
else:
|
||||
return "X_GLXVendorPrivate"
|
||||
else:
|
||||
return self.opcode_name()
|
||||
|
||||
|
||||
def return_string(self):
|
||||
if self.fn_return_type != 'void':
|
||||
return "return retval;"
|
||||
else:
|
||||
return "return;"
|
||||
|
||||
|
||||
def needs_reply(self):
|
||||
return self.fn_return_type != 'void' or self.output != None
|
||||
|
||||
|
||||
class GlxProto(gl_XML.FilterGLAPISpecBase):
|
||||
name = "glX_proto_send.py (from Mesa)"
|
||||
|
||||
def __init__(self):
|
||||
gl_XML.FilterGLAPISpecBase.__init__(self)
|
||||
self.factory = glXItemFactory()
|
||||
self.glx_enum_functions = {}
|
||||
|
||||
|
||||
def endElement(self, name):
|
||||
if name == 'O
|
||||
glx_program was the fir.odeWdeWdeWde TO
|
||||
g nmentr glx_progrWpeturn None
|
||||
|
||||
|
||||
d%O
|
||||
glxeWdeWdGLrop_%s" % ( prray = 0
|
||||
|
||||
_sop ! e_n):
|
||||
for pize getmEo1ry()
|
||||
self.glx_enum_funct,Lmand_pay = 0pnt(self, n,!= 0:
|
||||
sew_pay = 0pnt(self, n,!= 0:
|
||||
sew_pabX,!= 0:
|
||||
sew_pabX,!= 0:
|
||||
sew_pabX)' lf)
|
||||
)e != 'void'Pin "re%glx p.order = 0;
|
||||
|
||||
if p.p_count_parame self.output = pder =pder =.p_count_parame self.output = 0;cNA = 0
|
||||
|
||||
return [size, si2169
|
||||
#!/usr/bin/ retu g (C) Copyright IBM Corporize_st0:
|
||||
g All Rights Reserved s g Permispe !=selcode
|
||||
|
||||
|
||||
grmane4
|
||||
|
||||
free off.ga_fu,
|
||||
@@ -1,278 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
# (C) Copyright IBM Corporation 2004, 2005
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
from xml.sax import saxutils
|
||||
from xml.sax import make_parser
|
||||
from xml.sax.handler import feature_namespaces
|
||||
|
||||
import gl_XML
|
||||
import glX_XML
|
||||
import license
|
||||
import sys, getopt
|
||||
|
||||
|
||||
class glXDocItemFactory(glX_XML.glXItemFactory):
|
||||
"""Factory to create GLX protocol documentation oriented objects derived from glItem."""
|
||||
|
||||
def create(self, context, name, attrs):
|
||||
if name == "param":
|
||||
return glXDocParameter(context, name, attrs)
|
||||
else:
|
||||
return glX_XML.glXItemFactory.create(self, context, name, attrs)
|
||||
|
||||
class glXDocParameter(gl_XML.glParameter):
|
||||
def __init__(self, context, name, attrs):
|
||||
self.order = 1;
|
||||
gl_XML.glParameter.__init__(self, context, name, attrs);
|
||||
|
||||
|
||||
def packet_type(self):
|
||||
"""Get the type string for the packet header
|
||||
|
||||
GLX protocol documentation uses type names like CARD32,
|
||||
FLOAT64, LISTofCARD8, and ENUM. This function converts the
|
||||
type of the parameter to one of these names."""
|
||||
|
||||
list_of = ""
|
||||
if self.is_array():
|
||||
list_of = "LISTof"
|
||||
|
||||
if self.p_type.glx_name == "":
|
||||
type_name = "CARD8"
|
||||
else:
|
||||
type_name = self.p_type.glx_name
|
||||
|
||||
return "%s%s" % (list_of, type_name)
|
||||
|
||||
def packet_size(self):
|
||||
p = None
|
||||
s = self.size()
|
||||
if s == 0:
|
||||
a_prod = "n"
|
||||
b_prod = self.p_type.size
|
||||
|
||||
if self.p_count_parameters == None and self.counter != None:
|
||||
a_prod = self.counter
|
||||
elif (self.p_count_parameters != None and self.counter == None) or (self.is_output):
|
||||
pass
|
||||
elif self.p_count_parameters != None and self.counter != None:
|
||||
b_prod = self.counter
|
||||
else:
|
||||
raise RuntimeError("Parameter '%s' to function '%s' has size 0." % (self.name, self.context.name))
|
||||
|
||||
ss = "%s*%s" % (a_prod, b_prod)
|
||||
|
||||
return [ss, p]
|
||||
else:
|
||||
if s % 4 != 0:
|
||||
p = "p"
|
||||
|
||||
return [str(s), p]
|
||||
|
||||
class PrintGlxProtoText(glX_XML.GlxProto):
|
||||
def __init__(self):
|
||||
glX_XML.GlxProto.__init__(self)
|
||||
self.factory = glXDocItemFactory()
|
||||
self.last_category = ""
|
||||
self.license = ""
|
||||
|
||||
def printHeader(self):
|
||||
return
|
||||
|
||||
def body_size(self, f):
|
||||
# At some point, refactor this function and
|
||||
# glXFunction::command_payload_length.
|
||||
|
||||
size = 0;
|
||||
size_str = ""
|
||||
pad_str = ""
|
||||
plus = ""
|
||||
for p in f.parameterIterator(1, 2):
|
||||
[s, pad] = p.packet_size()
|
||||
try:
|
||||
size += int(s)
|
||||
except Exception,e:
|
||||
size_str += "%s%s" % (plus, s)
|
||||
plus = "+"
|
||||
|
||||
if pad != None:
|
||||
pad_str = pad
|
||||
|
||||
return [size, size_str, pad_str]
|
||||
|
||||
def print_render_header(self, f):
|
||||
[size, size_str, pad_str] = self.body_size(f)
|
||||
size += 4;
|
||||
|
||||
if size_str == "":
|
||||
s = "%u" % ((size + 3) & ~3)
|
||||
elif pad_str != "":
|
||||
s = "%u+%s+%s" % (size, size_str, pad_str)
|
||||
else:
|
||||
s = "%u+%s" % (size, size_str)
|
||||
|
||||
print ' 2 %-15s rendering command length' % (s)
|
||||
print ' 2 %-4u rendering command opcode' % (f.glx_rop)
|
||||
return
|
||||
|
||||
|
||||
def print_single_header(self, f):
|
||||
[size, size_str, pad_str] = self.body_size(f)
|
||||
size = ((size + 3) / 4) + 2;
|
||||
|
||||
if f.glx_vendorpriv != 0:
|
||||
size += 1
|
||||
|
||||
print ' 1 CARD8 opcode (X assigned)'
|
||||
print ' 1 %-4u GLX opcode (%s)' % (f.opcode_real_value(), f.opcode_real_name())
|
||||
|
||||
if size_str == "":
|
||||
s = "%u" % (size)
|
||||
elif pad_str != "":
|
||||
s = "%u+((%s+%s)/4)" % (size, size_str, pad_str)
|
||||
else:
|
||||
s = "%u+((%s)/4)" % (size, size_str)
|
||||
|
||||
print ' 2 %-15s request length' % (s)
|
||||
|
||||
if f.glx_vendorpriv != 0:
|
||||
print ' 4 %-4u vendor specific opcode' % (f.opcode_value())
|
||||
|
||||
print ' 4 GLX_CONTEXT_TAG context tag'
|
||||
|
||||
return
|
||||
|
||||
def print_reply(self, f):
|
||||
print ' =>'
|
||||
print ' 1 1 reply'
|
||||
print ' 1 unused'
|
||||
print ' 2 CARD16 sequence number'
|
||||
|
||||
if f.output == None:
|
||||
print ' 4 0 reply length'
|
||||
elif f.reply_always_array:
|
||||
print ' 4 m reply length'
|
||||
else:
|
||||
print ' 4 m reply length, m = (n == 1 ? 0 : n)'
|
||||
|
||||
|
||||
unused = 24
|
||||
if f.fn_return_type != 'void':
|
||||
print ' 4 %-15s return value' % (f.fn_return_type)
|
||||
unused -= 4
|
||||
elif f.output != None:
|
||||
print ' 4 unused'
|
||||
unused -= 4
|
||||
|
||||
if f.output != None:
|
||||
print ' 4 CARD32 n'
|
||||
unused -= 4
|
||||
|
||||
if f.output != None:
|
||||
if not f.reply_always_array:
|
||||
print ''
|
||||
print ' if (n = 1) this follows:'
|
||||
print ''
|
||||
print ' 4 CARD32 %s' % (f.output.name)
|
||||
print ' %-2u unused' % (unused - 4)
|
||||
print ''
|
||||
print ' otherwise this follows:'
|
||||
print ''
|
||||
|
||||
print ' %-2u unused' % (unused)
|
||||
p = f.output
|
||||
[s, pad] = p.packet_size()
|
||||
print ' %-8s %-15s %s' % (s, p.packet_type(), p.name)
|
||||
if pad != None:
|
||||
try:
|
||||
bytes = int(s)
|
||||
bytes = 4 - (bytes & 3)
|
||||
print ' %-8u %-15s unused' % (bytes, "")
|
||||
except Exception,e:
|
||||
print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s)
|
||||
else:
|
||||
print ' %-2u unused' % (unused)
|
||||
|
||||
|
||||
def print_body(self, f):
|
||||
for p in f.parameterIterator(1, 2):
|
||||
[s, pad] = p.packet_size()
|
||||
print ' %-8s %-15s %s' % (s, p.packet_type(), p.name)
|
||||
if pad != None:
|
||||
try:
|
||||
bytes = int(s)
|
||||
bytes = 4 - (bytes & 3)
|
||||
print ' %-8u %-15s unused' % (bytes, "")
|
||||
except Exception,e:
|
||||
print ' %-8s %-15s unused, %s=pad(%s)' % (pad, "", pad, s)
|
||||
|
||||
def printFunction(self, f):
|
||||
# At some point this should be expanded to support pixel
|
||||
# functions, but I'm not going to lose any sleep over it now.
|
||||
|
||||
if f.fn_offset < 0 or f.handcode or f.ignore or f.vectorequiv or f.image:
|
||||
return
|
||||
|
||||
print ' %s' % (f.name)
|
||||
|
||||
if f.glx_rop != 0:
|
||||
self.print_render_header(f)
|
||||
else:
|
||||
self.print_single_header(f)
|
||||
|
||||
self.print_body(f)
|
||||
|
||||
if f.needs_reply():
|
||||
self.print_reply(f)
|
||||
|
||||
print ''
|
||||
return
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_name = "gl_API.xml"
|
||||
|
||||
try:
|
||||
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
|
||||
except Exception,e:
|
||||
show_usage()
|
||||
|
||||
for (arg,val) in args:
|
||||
if arg == "-f":
|
||||
file_name = val
|
||||
|
||||
dh = PrintGlxProtoText()
|
||||
|
||||
parser = make_parser()
|
||||
parser.setFeature(feature_namespaces, 0)
|
||||
parser.setContentHandler(dh)
|
||||
|
||||
f = open(file_name)
|
||||
|
||||
dh.printHeader()
|
||||
parser.parse(f)
|
||||
dh.printFooter()
|
||||
@@ -1,915 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
# (C) Copyright IBM Corporation 2004, 2005
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
from xml.sax import saxutils
|
||||
from xml.sax import make_parser
|
||||
from xml.sax.handler import feature_namespaces
|
||||
|
||||
import gl_XML
|
||||
import glX_XML
|
||||
import license
|
||||
import sys, getopt, copy
|
||||
|
||||
def hash_pixel_function(func):
|
||||
"""Generate a 'unique' key for a pixel function. The key is based on
|
||||
the parameters written in the command packet. This includes any
|
||||
padding that might be added for the original function and the 'NULL
|
||||
image' flag."""
|
||||
|
||||
[dim, junk, junk, junk, junk] = func.dimensions()
|
||||
|
||||
d = (dim + 1) & ~1
|
||||
h = "%uD%uD_" % (d - 1, d)
|
||||
|
||||
for p in func.parameterIterator(1, 1):
|
||||
h = "%s%u" % (h, p.size())
|
||||
|
||||
if func.pad_after(p):
|
||||
h += "4"
|
||||
|
||||
if func.image.img_null_flag:
|
||||
h += "_NF"
|
||||
|
||||
n = func.name.replace("%uD" % (dim), "")
|
||||
n = "__glx_%s_%uD%uD" % (n, d - 1, d)
|
||||
return [h, n]
|
||||
|
||||
|
||||
class glXPixelFunctionUtility(glX_XML.glXFunction):
|
||||
"""Dummy class used to generate pixel "utility" functions that are
|
||||
shared by multiple dimension image functions. For example, these
|
||||
objects are used to generate shared functions used to send GLX
|
||||
protocol for TexImage1D and TexImage2D, TexSubImage1D and
|
||||
TexSubImage2D, etc."""
|
||||
|
||||
def __init__(self, func, name):
|
||||
# The parameters to the utility function are the same as the
|
||||
# parameters to the real function except for the added "pad"
|
||||
# parameters.
|
||||
|
||||
self.name = name
|
||||
self.image = copy.copy(func.image)
|
||||
self.fn_parameters = []
|
||||
for p in gl_XML.glFunction.parameterIterator(func):
|
||||
self.fn_parameters.append(p)
|
||||
|
||||
pad_name = func.pad_after(p)
|
||||
if pad_name:
|
||||
pad = copy.copy(p)
|
||||
pad.name = pad_name
|
||||
self.fn_parameters.append(pad)
|
||||
|
||||
|
||||
if self.image.height == None:
|
||||
self.image.height = "height"
|
||||
|
||||
if self.image.img_yoff == None:
|
||||
self.image.img_yoff = "yoffset"
|
||||
|
||||
if func.image.depth:
|
||||
if self.image.extent == None:
|
||||
self.image.extent = "extent"
|
||||
|
||||
if self.image.img_woff == None:
|
||||
self.image.img_woff = "woffset"
|
||||
|
||||
|
||||
self.set_return_type( func.fn_return_type )
|
||||
self.glx_rop = ~0
|
||||
self.can_be_large = func.can_be_large
|
||||
self.count_parameters = func.count_parameters
|
||||
self.counter = func.counter
|
||||
return
|
||||
|
||||
|
||||
class PrintGlxProtoStubs(glX_XML.GlxProto):
|
||||
def __init__(self):
|
||||
glX_XML.GlxProto.__init__(self)
|
||||
self.last_category = ""
|
||||
self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004, 2005", "IBM")
|
||||
self.generic_sizes = [3, 4, 6, 8, 12, 16, 24, 32]
|
||||
self.pixel_stubs = {}
|
||||
return
|
||||
|
||||
def printRealHeader(self):
|
||||
print ''
|
||||
print '#include <GL/gl.h>'
|
||||
print '#include "indirect.h"'
|
||||
print '#include "glxclient.h"'
|
||||
print '#include "indirect_size.h"'
|
||||
print '#include <GL/glxproto.h>'
|
||||
print ''
|
||||
print '#define __GLX_PAD(n) (((n) + 3) & ~3)'
|
||||
print ''
|
||||
glX_XML.printFastcall()
|
||||
glX_XML.printNoinline()
|
||||
print ''
|
||||
print '#if !defined __GNUC__ || __GNUC__ < 3'
|
||||
print '# define __builtin_expect(x, y) x'
|
||||
print '#endif'
|
||||
print ''
|
||||
print '/* If the size and opcode values are known at compile-time, this will, on'
|
||||
print ' * x86 at least, emit them with a single instruction.'
|
||||
print ' */'
|
||||
print '#define emit_header(dest, op, size) \\'
|
||||
print ' do { union { short s[2]; int i; } temp; \\'
|
||||
print ' temp.s[0] = (size); temp.s[1] = (op); \\'
|
||||
print ' *((int *)(dest)) = temp.i; } while(0)'
|
||||
print ''
|
||||
print """static NOINLINE CARD32
|
||||
read_reply( Display *dpy, size_t size, void * dest, GLboolean reply_is_always_array )
|
||||
{
|
||||
xGLXSingleReply reply;
|
||||
|
||||
(void) _XReply(dpy, (xReply *) & reply, 0, False);
|
||||
if (size != 0) {
|
||||
if ((reply.length > 0) || reply_is_always_array) {
|
||||
const GLint bytes = (reply_is_always_array)
|
||||
? (4 * reply.length) : (reply.size * size);
|
||||
const GLint extra = 4 - (bytes & 3);
|
||||
|
||||
_XRead(dpy, dest, bytes);
|
||||
if ( extra < 4 ) {
|
||||
_XEatData(dpy, extra);
|
||||
}
|
||||
}
|
||||
else {
|
||||
(void) memcpy( dest, &(reply.pad3), size);
|
||||
}
|
||||
}
|
||||
|
||||
return reply.retval;
|
||||
}
|
||||
|
||||
#define X_GLXSingle 0
|
||||
|
||||
static NOINLINE FASTCALL GLubyte *
|
||||
setup_single_request( __GLXcontext * gc, GLint sop, GLint cmdlen )
|
||||
{
|
||||
xGLXSingleReq * req;
|
||||
Display * const dpy = gc->currentDpy;
|
||||
|
||||
(void) __glXFlushRenderBuffer(gc, gc->pc);
|
||||
LockDisplay(dpy);
|
||||
GetReqExtra(GLXSingle, cmdlen, req);
|
||||
req->reqType = gc->majorOpcode;
|
||||
req->contextTag = gc->currentContextTag;
|
||||
req->glxCode = sop;
|
||||
return (GLubyte *)(req) + sz_xGLXSingleReq;
|
||||
}
|
||||
|
||||
static NOINLINE FASTCALL GLubyte *
|
||||
setup_vendor_request( __GLXcontext * gc, GLint code, GLint vop, GLint cmdlen )
|
||||
{
|
||||
xGLXVendorPrivateReq * req;
|
||||
Display * const dpy = gc->currentDpy;
|
||||
|
||||
(void) __glXFlushRenderBuffer(gc, gc->pc);
|
||||
LockDisplay(dpy);
|
||||
GetReqExtra(GLXVendorPrivate, cmdlen, req);
|
||||
req->reqType = gc->majorOpcode;
|
||||
req->glxCode = code;
|
||||
req->vendorCode = vop;
|
||||
req->contextTag = gc->currentContextTag;
|
||||
return (GLubyte *)(req) + sz_xGLXVendorPrivateReq;
|
||||
}
|
||||
|
||||
const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
|
||||
|
||||
#define zero (__glXDefaultPixelStore+0)
|
||||
#define one (__glXDefaultPixelStore+8)
|
||||
#define default_pixel_store_1D (__glXDefaultPixelStore+4)
|
||||
#define default_pixel_store_1D_size 20
|
||||
#define default_pixel_store_2D (__glXDefaultPixelStore+4)
|
||||
#define default_pixel_store_2D_size 20
|
||||
#define default_pixel_store_3D (__glXDefaultPixelStore+0)
|
||||
#define default_pixel_store_3D_size 36
|
||||
#define default_pixel_store_4D (__glXDefaultPixelStore+0)
|
||||
#define default_pixel_store_4D_size 36
|
||||
"""
|
||||
|
||||
for size in self.generic_sizes:
|
||||
self.print_generic_function(size)
|
||||
return
|
||||
|
||||
def printFunction(self, f):
|
||||
if f.fn_offset < 0 or f.handcode or f.ignore: return
|
||||
|
||||
if f.glx_rop != 0 or f.vectorequiv != None:
|
||||
if f.image:
|
||||
self.printPixelFunction(f)
|
||||
else:
|
||||
self.printRenderFunction(f)
|
||||
elif f.glx_sop != 0 or f.glx_vendorpriv != 0:
|
||||
self.printSingleFunction(f)
|
||||
else:
|
||||
print "/* Missing GLX protocol for %s. */" % (f.name)
|
||||
|
||||
def print_generic_function(self, n):
|
||||
size = (n + 3) & ~3
|
||||
print """static FASTCALL NOINLINE void
|
||||
generic_%u_byte( GLint rop, const void * ptr )
|
||||
{
|
||||
__GLXcontext * const gc = __glXGetCurrentContext();
|
||||
const GLuint cmdlen = %u;
|
||||
|
||||
emit_header(gc->pc, rop, cmdlen);
|
||||
(void) memcpy((void *)(gc->pc + 4), ptr, %u);
|
||||
gc->pc += cmdlen;
|
||||
if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }
|
||||
}
|
||||
""" % (n, size + 4, size)
|
||||
|
||||
|
||||
def common_emit_one_arg(self, p, offset, pc, indent, adjust):
|
||||
t = p.p_type
|
||||
if p.is_array():
|
||||
src_ptr = p.name
|
||||
else:
|
||||
src_ptr = "&" + p.name
|
||||
|
||||
print '%s (void) memcpy((void *)(%s + %u), (void *)(%s), %s);' \
|
||||
% (indent, pc, offset + adjust, src_ptr, p.size_string() )
|
||||
|
||||
def common_emit_args(self, f, pc, indent, adjust, skip_vla):
|
||||
offset = 0
|
||||
|
||||
if skip_vla:
|
||||
r = 1
|
||||
else:
|
||||
r = 2
|
||||
|
||||
for p in f.parameterIterator(1, r):
|
||||
self.common_emit_one_arg(p, offset, pc, indent, adjust)
|
||||
offset += p.size()
|
||||
|
||||
return offset
|
||||
|
||||
|
||||
def pixel_emit_args(self, f, pc, indent, adjust, dim, large):
|
||||
"""Emit the arguments for a pixel function. This differs from
|
||||
common_emit_args in that pixel functions may require padding
|
||||
be inserted (i.e., for the missing width field for
|
||||
TexImage1D), and they may also require a 'NULL image' flag
|
||||
be inserted before the image data."""
|
||||
|
||||
offset = 0
|
||||
for p in f.parameterIterator(1, 1):
|
||||
self.common_emit_one_arg(p, offset, pc, indent, adjust)
|
||||
offset += p.size()
|
||||
|
||||
if f.pad_after(p):
|
||||
print '%s (void) memcpy((void *)(%s + %u), zero, 4);' % (indent, pc, offset + adjust)
|
||||
offset += 4
|
||||
|
||||
if f.image.img_null_flag:
|
||||
if large:
|
||||
print '%s (void) memcpy((void *)(%s + %u), zero, 4);' % (indent, pc, offset + adjust)
|
||||
else:
|
||||
print '%s (void) memcpy((void *)(%s + %u), (void *)((%s == NULL) ? one : zero), 4);' % (indent, pc, offset + adjust, f.image.name)
|
||||
|
||||
offset += 4
|
||||
|
||||
return offset
|
||||
|
||||
|
||||
def large_emit_begin(self, indent, f, op_name = None):
|
||||
if not op_name:
|
||||
op_name = f.opcode_real_name()
|
||||
|
||||
print '%s const GLint op = %s;' % (indent, op_name)
|
||||
print '%s const GLuint cmdlenLarge = cmdlen + 4;' % (indent)
|
||||
print '%s GLubyte * const pc = __glXFlushRenderBuffer(gc, gc->pc);' % (indent)
|
||||
print '%s (void) memcpy((void *)(pc + 0), (void *)(&cmdlenLarge), 4);' % (indent)
|
||||
print '%s (void) memcpy((void *)(pc + 4), (void *)(&op), 4);' % (indent)
|
||||
return
|
||||
|
||||
|
||||
def common_func_print_just_header(self, f):
|
||||
print '#define %s %d' % (f.opcode_name(), f.opcode_value())
|
||||
|
||||
print '%s' % (f.fn_return_type)
|
||||
print '__indirect_gl%s(%s)' % (f.name, f.get_parameter_string())
|
||||
print '{'
|
||||
|
||||
|
||||
def common_func_print_just_start(self, f):
|
||||
print ' __GLXcontext * const gc = __glXGetCurrentContext();'
|
||||
|
||||
# The only reason that single and vendor private commands need
|
||||
# a variable called 'dpy' is becuase they use the SyncHandle
|
||||
# macro. For whatever brain-dead reason, that macro is hard-
|
||||
# coded to use a variable called 'dpy' instead of taking a
|
||||
# parameter.
|
||||
|
||||
if not f.glx_rop:
|
||||
print ' Display * const dpy = gc->currentDpy;'
|
||||
skip_condition = "dpy != NULL"
|
||||
elif f.can_be_large:
|
||||
skip_condition = "gc->currentDpy != NULL"
|
||||
else:
|
||||
skip_condition = None
|
||||
|
||||
|
||||
if f.fn_return_type != 'void':
|
||||
print ' %s retval = (%s) 0;' % (f.fn_return_type, f.fn_return_type)
|
||||
|
||||
if f.count_parameters != None:
|
||||
print ' const GLuint compsize = __gl%s_size(%s);' % (f.name, f.count_parameters)
|
||||
elif f.image:
|
||||
[dim, w, h, d, junk] = f.dimensions()
|
||||
|
||||
compsize = '__glImageSize(%s, %s, %s, %s, %s, %s)' % (w, h, d, f.image.img_format, f.image.img_type, f.image.img_target)
|
||||
if not f.image.img_send_null:
|
||||
compsize = '(%s != NULL) ? %s : 0' % (f.image.name, compsize)
|
||||
|
||||
print ' const GLuint compsize = %s;' % (compsize)
|
||||
|
||||
|
||||
print ' const GLuint cmdlen = %s;' % (f.command_length())
|
||||
|
||||
if f.counter:
|
||||
if skip_condition:
|
||||
skip_condition = "(%s >= 0) && (%s)" % (f.counter, skip_condition)
|
||||
else:
|
||||
skip_condition = "%s >= 0" % (f.counter)
|
||||
|
||||
|
||||
if skip_condition:
|
||||
print ' if (__builtin_expect(%s, 1)) {' % (skip_condition)
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
||||
def common_func_print_header(self, f):
|
||||
self.common_func_print_just_header(f)
|
||||
return self.common_func_print_just_start(f)
|
||||
|
||||
|
||||
|
||||
def printSingleFunction(self, f):
|
||||
self.common_func_print_header(f)
|
||||
|
||||
if f.fn_parameters != []:
|
||||
pc_decl = "GLubyte const * pc ="
|
||||
else:
|
||||
pc_decl = "(void)"
|
||||
|
||||
if f.glx_vendorpriv != 0:
|
||||
print ' %s setup_vendor_request(gc, %s, %s, cmdlen);' % (pc_decl, f.opcode_real_name(), f.opcode_name())
|
||||
else:
|
||||
print ' %s setup_single_request(gc, %s, cmdlen);' % (pc_decl, f.opcode_name())
|
||||
|
||||
self.common_emit_args(f, "pc", " ", 0, 0)
|
||||
|
||||
if f.needs_reply():
|
||||
if f.output != None:
|
||||
output_size = f.output.p_type.size
|
||||
output_str = f.output.name
|
||||
else:
|
||||
output_size = 0
|
||||
output_str = "NULL"
|
||||
|
||||
if f.fn_return_type != 'void':
|
||||
return_str = " retval = (%s)" % (f.fn_return_type)
|
||||
else:
|
||||
return_str = " (void)"
|
||||
|
||||
if f.reply_always_array:
|
||||
aa = "GL_TRUE"
|
||||
else:
|
||||
aa = "GL_FALSE"
|
||||
|
||||
print " %s read_reply(dpy, %s, %s, %s);" % (return_str, output_size, output_str, aa)
|
||||
|
||||
print ' UnlockDisplay(dpy); SyncHandle();'
|
||||
print ' }'
|
||||
print ' %s' % f.return_string()
|
||||
print '}'
|
||||
print ''
|
||||
return
|
||||
|
||||
|
||||
def printPixelFunction(self, f):
|
||||
"""This function could use some major refactoring. :("""
|
||||
|
||||
# There is a code-space optimization that we can do here.
|
||||
# Functions that are marked img_pad_dimensions have a version
|
||||
# with an odd number of dimensions and an even number of
|
||||
# dimensions. TexSubImage1D and TexSubImage2D are examples.
|
||||
# We can emit a single function that does both, and have the
|
||||
# real functions call the utility function with the correct
|
||||
# parameters.
|
||||
#
|
||||
# The only quirk to this is that utility funcitons will be
|
||||
# generated for 3D and 4D functions, but 4D (e.g.,
|
||||
# GL_SGIS_texture4D) isn't typically supported. This is
|
||||
# probably not an issue. However, it would be possible to
|
||||
# look at the total set of functions and determine if there
|
||||
# is another function that would actually use the utility
|
||||
# function. If not, then fallback to the normal way of
|
||||
# generating code.
|
||||
|
||||
if f.image.img_pad_dimensions:
|
||||
# Determine the hash key and the name for the utility
|
||||
# function that is used to implement the real
|
||||
# function.
|
||||
|
||||
[h, n] = hash_pixel_function(f)
|
||||
|
||||
|
||||
# If the utility function is not yet known, generate
|
||||
# it.
|
||||
|
||||
if not self.pixel_stubs.has_key(h):
|
||||
self.pixel_stubs[h] = n
|
||||
pixel_func = glXPixelFunctionUtility(f, n)
|
||||
|
||||
print 'static void'
|
||||
print '%s( unsigned opcode, unsigned dim, %s )' % (n, pixel_func.get_parameter_string())
|
||||
print '{'
|
||||
|
||||
if self.common_func_print_just_start(pixel_func):
|
||||
indent = " "
|
||||
trailer = " }"
|
||||
else:
|
||||
indent = ""
|
||||
trailer = None
|
||||
|
||||
|
||||
if pixel_func.can_be_large:
|
||||
print '%s if (cmdlen <= gc->maxSmallRenderCommandSize) {' % (indent)
|
||||
print '%s if ( (gc->pc + cmdlen) > gc->bufEnd ) {' % (indent)
|
||||
print '%s (void) __glXFlushRenderBuffer(gc, gc->pc);' % (indent)
|
||||
print '%s }' % (indent)
|
||||
indent += " "
|
||||
|
||||
[dim, width, height, depth, extent] = pixel_func.dimensions()
|
||||
|
||||
if dim < 3:
|
||||
adjust = 20 + 4
|
||||
else:
|
||||
adjust = 36 + 4
|
||||
|
||||
|
||||
print '%s emit_header(gc->pc, opcode, cmdlen);' % (indent)
|
||||
|
||||
offset = self.pixel_emit_args(pixel_func, "gc->pc", indent, adjust, dim, 0)
|
||||
|
||||
[s, junk] = pixel_func.command_payload_length()
|
||||
|
||||
pixHeaderPtr = "gc->pc + 4"
|
||||
pcPtr = "gc->pc + %u" % (s + 4)
|
||||
|
||||
if pixel_func.image.img_send_null:
|
||||
condition = '(compsize > 0) && (%s != NULL)' % (pixel_func.image.name)
|
||||
else:
|
||||
condition = 'compsize > 0'
|
||||
|
||||
print '%s if (%s) {' % (indent, condition)
|
||||
print '%s (*gc->fillImage)(gc, dim, %s, %s, %s, %s, %s, %s, %s, %s);' % (indent, width, height, depth, pixel_func.image.img_format, pixel_func.image.img_type, pixel_func.image.name, pcPtr, pixHeaderPtr)
|
||||
print '%s }' % (indent)
|
||||
print '%s else {' % (indent)
|
||||
print '%s (void) memcpy( %s, default_pixel_store_%uD, default_pixel_store_%uD_size );' % (indent, pixHeaderPtr, dim, dim)
|
||||
print '%s }' % (indent)
|
||||
|
||||
print '%s gc->pc += cmdlen;' % (indent)
|
||||
print '%s if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' % (indent)
|
||||
|
||||
if f.can_be_large:
|
||||
adjust += 4
|
||||
|
||||
print '%s}' % (indent)
|
||||
print '%selse {' % (indent)
|
||||
|
||||
self.large_emit_begin(indent, pixel_func, "opcode")
|
||||
offset = self.pixel_emit_args(pixel_func, "pc", indent, adjust, dim, 1)
|
||||
|
||||
pixHeaderPtr = "pc + 8"
|
||||
pcPtr = "pc + %u" % (s + 8)
|
||||
|
||||
print '%s __glXSendLargeImage(gc, compsize, dim, %s, %s, %s, %s, %s, %s, %s, %s);' % (indent, width, height, depth, f.image.img_format, f.image.img_type, f.image.name, pcPtr, pixHeaderPtr)
|
||||
|
||||
print '%s}' % (indent)
|
||||
|
||||
if trailer: print trailer
|
||||
print '}'
|
||||
print ''
|
||||
|
||||
|
||||
|
||||
# Generate the real function as a call to the
|
||||
# utility function.
|
||||
|
||||
self.common_func_print_just_header(f)
|
||||
|
||||
[dim, junk, junk, junk, junk] = f.dimensions()
|
||||
|
||||
p_string = ""
|
||||
for p in gl_XML.glFunction.parameterIterator(f):
|
||||
p_string += ", " + p.name
|
||||
|
||||
if f.pad_after(p):
|
||||
p_string += ", 1"
|
||||
|
||||
print ' %s(%s, %u%s );' % (n, f.opcode_name(), dim, p_string)
|
||||
print '}'
|
||||
print ''
|
||||
return
|
||||
|
||||
|
||||
if self.common_func_print_header(f):
|
||||
indent = " "
|
||||
trailer = " }"
|
||||
else:
|
||||
indent = ""
|
||||
trailer = None
|
||||
|
||||
|
||||
if f.can_be_large:
|
||||
print '%s if (cmdlen <= gc->maxSmallRenderCommandSize) {' % (indent)
|
||||
print '%s if ( (gc->pc + cmdlen) > gc->bufEnd ) {' % (indent)
|
||||
print '%s (void) __glXFlushRenderBuffer(gc, gc->pc);' % (indent)
|
||||
print '%s }' % (indent)
|
||||
indent += " "
|
||||
|
||||
[dim, width, height, depth, extent] = f.dimensions()
|
||||
|
||||
if dim < 3:
|
||||
adjust = 20 + 4
|
||||
else:
|
||||
adjust = 36 + 4
|
||||
|
||||
|
||||
print '%s emit_header(gc->pc, %s, cmdlen);' % (indent, f.opcode_real_name())
|
||||
|
||||
offset = self.pixel_emit_args(f, "gc->pc", indent, adjust, dim, 0)
|
||||
|
||||
[s, junk] = f.command_payload_length()
|
||||
|
||||
pixHeaderPtr = "gc->pc + 4"
|
||||
pcPtr = "gc->pc + %u" % (s + 4)
|
||||
|
||||
if f.image.img_send_null:
|
||||
condition = '(compsize > 0) && (%s != NULL)' % (f.image.name)
|
||||
else:
|
||||
condition = 'compsize > 0'
|
||||
|
||||
print '%s if (%s) {' % (indent, condition)
|
||||
print '%s (*gc->fillImage)(gc, %u, %s, %s, %s, %s, %s, %s, %s, %s);' % (indent, dim, width, height, depth, f.image.img_format, f.image.img_type, f.image.name, pcPtr, pixHeaderPtr)
|
||||
print '%s }' % (indent)
|
||||
print '%s else {' % (indent)
|
||||
print '%s (void) memcpy( %s, default_pixel_store_%uD, default_pixel_store_%uD_size );' % (indent, pixHeaderPtr, dim, dim)
|
||||
print '%s }' % (indent)
|
||||
|
||||
print '%s gc->pc += cmdlen;' % (indent)
|
||||
print '%s if (gc->pc > gc->limit) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' % (indent)
|
||||
|
||||
if f.can_be_large:
|
||||
adjust += 4
|
||||
|
||||
print '%s}' % (indent)
|
||||
print '%selse {' % (indent)
|
||||
|
||||
self.large_emit_begin(indent, f)
|
||||
offset = self.pixel_emit_args(f, "pc", indent, adjust, dim, 1)
|
||||
|
||||
pixHeaderPtr = "pc + 8"
|
||||
pcPtr = "pc + %u" % (s + 8)
|
||||
|
||||
print '%s __glXSendLargeImage(gc, compsize, %u, %s, %s, %s, %s, %s, %s, %s, %s);' % (indent, dim, width, height, depth, f.image.img_format, f.image.img_type, f.image.name, pcPtr, pixHeaderPtr)
|
||||
|
||||
print '%s}' % (indent)
|
||||
|
||||
if trailer: print trailer
|
||||
print '}'
|
||||
print ''
|
||||
return
|
||||
|
||||
|
||||
def printRenderFunction(self, f):
|
||||
# There is a class of GL functions that take a single pointer
|
||||
# as a parameter. This pointer points to a fixed-size chunk
|
||||
# of data, and the protocol for this functions is very
|
||||
# regular. Since they are so regular and there are so many
|
||||
# of them, special case them with generic functions. On
|
||||
# x86, this saves about 26KB in the libGL.so binary.
|
||||
|
||||
if f.variable_length_parameter() == None and len(f.fn_parameters) == 1:
|
||||
p = f.fn_parameters[0]
|
||||
if p.is_pointer:
|
||||
[cmdlen, size_string] = f.command_payload_length()
|
||||
if cmdlen in self.generic_sizes:
|
||||
self.common_func_print_just_header(f)
|
||||
print ' generic_%u_byte( %s, %s );' % (cmdlen, f.opcode_real_name(), p.name)
|
||||
print '}'
|
||||
print ''
|
||||
return
|
||||
|
||||
if self.common_func_print_header(f):
|
||||
indent = " "
|
||||
trailer = " }"
|
||||
else:
|
||||
indent = ""
|
||||
trailer = None
|
||||
|
||||
if f.can_be_large:
|
||||
print '%s if (cmdlen <= gc->maxSmallRenderCommandSize) {' % (indent)
|
||||
print '%s if ( (gc->pc + cmdlen) > gc->bufEnd ) {' % (indent)
|
||||
print '%s (void) __glXFlushRenderBuffer(gc, gc->pc);' % (indent)
|
||||
print '%s }' % (indent)
|
||||
indent += " "
|
||||
|
||||
print '%s emit_header(gc->pc, %s, cmdlen);' % (indent, f.opcode_real_name())
|
||||
|
||||
self.common_emit_args(f, "gc->pc", indent, 4, 0)
|
||||
print '%s gc->pc += cmdlen;' % (indent)
|
||||
print '%s if (__builtin_expect(gc->pc > gc->limit, 0)) { (void) __glXFlushRenderBuffer(gc, gc->pc); }' % (indent)
|
||||
|
||||
if f.can_be_large:
|
||||
print '%s}' % (indent)
|
||||
print '%selse {' % (indent)
|
||||
|
||||
self.large_emit_begin(indent, f)
|
||||
offset = self.common_emit_args(f, "pc", indent, 8, 1)
|
||||
|
||||
p = f.variable_length_parameter()
|
||||
print '%s __glXSendLargeCommand(gc, pc, %u, %s, %s);' % (indent, offset + 8, p.name, p.size_string())
|
||||
print '%s}' % (indent)
|
||||
|
||||
if trailer: print trailer
|
||||
print '}'
|
||||
print ''
|
||||
return
|
||||
|
||||
|
||||
class PrintGlxProtoInit_c(glX_XML.GlxProto):
|
||||
def __init__(self):
|
||||
glX_XML.GlxProto.__init__(self)
|
||||
self.last_category = ""
|
||||
self.license = license.bsd_license_template % ( \
|
||||
"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM")
|
||||
|
||||
|
||||
def printRealHeader(self):
|
||||
print """/**
|
||||
* \\file indirect_init.c
|
||||
* Initialize indirect rendering dispatch table.
|
||||
*
|
||||
* \\author Kevin E. Martin <kevin@precisioninsight.com>
|
||||
* \\author Brian Paul <brian@precisioninsight.com>
|
||||
* \\author Ian Romanick <idr@us.ibm.com>
|
||||
*/
|
||||
|
||||
#include "indirect_init.h"
|
||||
#include "indirect.h"
|
||||
#include "glapi.h"
|
||||
|
||||
|
||||
/**
|
||||
* No-op function used to initialize functions that have no GLX protocol
|
||||
* support.
|
||||
*/
|
||||
static int NoOp(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and initialize a new GL dispatch table. The table is initialized
|
||||
* with GLX indirect rendering protocol functions.
|
||||
*/
|
||||
__GLapi * __glXNewIndirectAPI( void )
|
||||
{
|
||||
__GLapi *glAPI;
|
||||
GLuint entries;
|
||||
|
||||
entries = _glapi_get_dispatch_table_size();
|
||||
glAPI = (__GLapi *) Xmalloc(entries * sizeof(void *));
|
||||
|
||||
/* first, set all entries to point to no-op functions */
|
||||
{
|
||||
int i;
|
||||
void **dispatch = (void **) glAPI;
|
||||
for (i = 0; i < entries; i++) {
|
||||
dispatch[i] = (void *) NoOp;
|
||||
}
|
||||
}
|
||||
|
||||
/* now, initialize the entries we understand */"""
|
||||
|
||||
def printRealFooter(self):
|
||||
print """
|
||||
return glAPI;
|
||||
}
|
||||
"""
|
||||
|
||||
def printFunction(self, f):
|
||||
if f.fn_offset < 0 or f.ignore: return
|
||||
|
||||
if f.category != self.last_category:
|
||||
self.last_category = f.category
|
||||
print ''
|
||||
print ' /* %s */' % (self.last_category)
|
||||
print ''
|
||||
|
||||
print ' glAPI->%s = __indirect_gl%s;' % (f.name, f.name)
|
||||
|
||||
|
||||
class PrintGlxProtoInit_h(glX_XML.GlxProto):
|
||||
def __init__(self):
|
||||
glX_XML.GlxProto.__init__(self)
|
||||
self.last_category = ""
|
||||
self.license = license.bsd_license_template % ( \
|
||||
"""Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
|
||||
(C) Copyright IBM Corporation 2004""", "PRECISION INSIGHT, IBM")
|
||||
|
||||
|
||||
def printRealHeader(self):
|
||||
print """
|
||||
/**
|
||||
* \\file
|
||||
* Prototypes for indirect rendering functions.
|
||||
*
|
||||
* \\author Kevin E. Martin <kevin@precisioninsight.com>
|
||||
* \\author Ian Romanick <idr@us.ibm.com>
|
||||
*/
|
||||
|
||||
#if !defined( _INDIRECT_H_ )
|
||||
# define _INDIRECT_H_
|
||||
|
||||
"""
|
||||
glX_XML.printVisibility( "HIDDEN", "hidden" )
|
||||
|
||||
|
||||
def printRealFooter(self):
|
||||
print "# undef HIDDEN"
|
||||
print "#endif /* !defined( _INDIRECT_H_ ) */"
|
||||
|
||||
def printFunction(self, f):
|
||||
if f.fn_offset < 0 or f.ignore: return
|
||||
print 'extern HIDDEN %s __indirect_gl%s(%s);' % (f.fn_return_type, f.name, f.get_parameter_string())
|
||||
|
||||
|
||||
class PrintGlxSizeStubs(glX_XML.GlxProto):
|
||||
def __init__(self):
|
||||
glX_XML.GlxProto.__init__(self)
|
||||
self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004", "IBM")
|
||||
self.aliases = []
|
||||
self.glx_enum_sigs = {}
|
||||
|
||||
def printRealHeader(self):
|
||||
print ''
|
||||
print '#include <GL/gl.h>'
|
||||
print '#include "indirect_size.h"'
|
||||
|
||||
print ''
|
||||
glX_XML.printPure()
|
||||
print ''
|
||||
glX_XML.printFastcall()
|
||||
print ''
|
||||
glX_XML.printVisibility( "INTERNAL", "internal" )
|
||||
print ''
|
||||
print ''
|
||||
print '#ifdef HAVE_ALIAS'
|
||||
print '# define ALIAS2(from,to) \\'
|
||||
print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\'
|
||||
print ' __attribute__ ((alias( # to )));'
|
||||
print '# define ALIAS(from,to) ALIAS2( from, __gl ## to ## _size )'
|
||||
print '#else'
|
||||
print '# define ALIAS(from,to) \\'
|
||||
print ' INTERNAL PURE FASTCALL GLint __gl ## from ## _size( GLenum e ) \\'
|
||||
print ' { return __gl ## to ## _size( e ); }'
|
||||
print '#endif'
|
||||
print ''
|
||||
print ''
|
||||
|
||||
def printRealFooter(self):
|
||||
for a in self.aliases:
|
||||
print a
|
||||
|
||||
def printFunction(self, f):
|
||||
if self.glx_enum_functions.has_key(f.name):
|
||||
ef = self.glx_enum_functions[f.name]
|
||||
|
||||
sig = ef.signature();
|
||||
if self.glx_enum_sigs.has_key(sig):
|
||||
n = self.glx_enum_sigs[sig];
|
||||
a = 'ALIAS( %s, %s )' % (f.name, n)
|
||||
self.aliases.append(a)
|
||||
else:
|
||||
ef.Print( f.name )
|
||||
self.glx_enum_sigs[sig] = f.name;
|
||||
|
||||
|
||||
|
||||
class PrintGlxSizeStubs_h(glX_XML.GlxProto):
|
||||
def __init__(self):
|
||||
glX_XML.GlxProto.__init__(self)
|
||||
self.license = license.bsd_license_template % ( "(C) Copyright IBM Corporation 2004", "IBM")
|
||||
self.aliases = []
|
||||
self.glx_enum_sigs = {}
|
||||
|
||||
def printRealHeader(self):
|
||||
print """
|
||||
/**
|
||||
* \\file
|
||||
* Prototypes for functions used to determine the number of data elements in
|
||||
* various GLX protocol messages.
|
||||
*
|
||||
* \\author Ian Romanick <idr@us.ibm.com>
|
||||
*/
|
||||
|
||||
#if !defined( _GLXSIZE_H_ )
|
||||
# define _GLXSIZE_H_
|
||||
|
||||
"""
|
||||
glX_XML.printPure();
|
||||
print ''
|
||||
glX_XML.printFastcall();
|
||||
print ''
|
||||
glX_XML.printVisibility( "INTERNAL", "internal" );
|
||||
print ''
|
||||
|
||||
def printRealFooter(self):
|
||||
print ''
|
||||
print "# undef INTERNAL"
|
||||
print "# undef PURE"
|
||||
print "# undef FASTCALL"
|
||||
print "#endif /* !defined( _GLXSIZE_H_ ) */"
|
||||
|
||||
|
||||
def printFunction(self, f):
|
||||
if self.glx_enum_functions.has_key(f.name):
|
||||
ef = self.glx_enum_functions[f.name]
|
||||
print 'extern INTERNAL PURE FASTCALL GLint __gl%s_size(GLenum);' % (f.name)
|
||||
|
||||
|
||||
def show_usage():
|
||||
print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_name = "gl_API.xml"
|
||||
|
||||
try:
|
||||
(args, trail) = getopt.getopt(sys.argv[1:], "f:m:")
|
||||
except Exception,e:
|
||||
show_usage()
|
||||
|
||||
mode = "proto"
|
||||
for (arg,val) in args:
|
||||
if arg == "-f":
|
||||
file_name = val
|
||||
elif arg == "-m":
|
||||
mode = val
|
||||
|
||||
if mode == "proto":
|
||||
dh = PrintGlxProtoStubs()
|
||||
elif mode == "init_c":
|
||||
dh = PrintGlxProtoInit_c()
|
||||
elif mode == "init_h":
|
||||
dh = PrintGlxProtoInit_h()
|
||||
elif mode == "size_c":
|
||||
dh = PrintGlxSizeStubs()
|
||||
elif mode == "size_h":
|
||||
dh = PrintGlxSizeStubs_h()
|
||||
else:
|
||||
show_usage()
|
||||
|
||||
parser = make_parser()
|
||||
parser.setFeature(feature_namespaces, 0)
|
||||
parser.setContentHandler(dh)
|
||||
|
||||
f = open(file_name)
|
||||
|
||||
dh.printHeader()
|
||||
parser.parse(f)
|
||||
dh.printFooter()
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,134 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
# (C) Copyright IBM Corporation 2004
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
from xml.sax import saxutils
|
||||
from xml.sax import make_parser
|
||||
from xml.sax.handler import feature_namespaces
|
||||
|
||||
import gl_XML
|
||||
import license
|
||||
import sys, getopt
|
||||
|
||||
class PrintGenericStubs(gl_XML.FilterGLAPISpecBase):
|
||||
name = "gl_SPARC_asm.py (from Mesa)"
|
||||
|
||||
def __init__(self):
|
||||
gl_XML.FilterGLAPISpecBase.__init__(self)
|
||||
self.license = license.bsd_license_template % ( \
|
||||
"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
||||
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
|
||||
|
||||
|
||||
def printRealHeader(self):
|
||||
print '#include "glapioffsets.h"'
|
||||
print ''
|
||||
print '#define GLOBL_FN(x) .globl x ; .type x,#function'
|
||||
print ''
|
||||
print '#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__)))'
|
||||
print '# define GL_STUB(fn,off)\t\t\t\t\\'
|
||||
print 'GLOBL_FN(fn) ; fn:\t\t\t\t\t\\'
|
||||
print '\tsethi\t%hi(0x00000000), %g4 ;\t\t\t\\'
|
||||
print '\tsethi\t%hi(0x00000000), %g1 ;\t\t\t\\'
|
||||
print '\tor\t%g4, %lo(0x00000000), %g4 ;\t\t\\'
|
||||
print '\tor\t%g1, %lo(0x00000000), %g1 ;\t\t\\'
|
||||
print '\tsllx\t%g4, 32, %g4 ;\t\t\t\t\\'
|
||||
print '\tldx\t[%g1 + %g4], %g1 ;\t\t\t\\'
|
||||
print '\tsethi\t%hi(8 * off), %g4 ;\t\t\t\\'
|
||||
print '\tor\t%g4, %lo(8 * off), %g4 ;\t\t\\'
|
||||
print '\tldx\t[%g1 + %g4], %g5 ;\t\t\t\\'
|
||||
print '\tjmpl\t%g5, %g0 ;\t\t\t\t\\'
|
||||
print '\tnop'
|
||||
print '#else'
|
||||
print '# define GL_STUB(fn,off)\t\t\t\t\\'
|
||||
print 'GLOBL_FN(fn) ; fn:\t\t\t\t\t\\'
|
||||
print '\tsethi\t%hi(0x00000000), %g1 ;\t\t\t\\'
|
||||
print '\tld\t[%g1 + %lo(0x00000000)], %g1 ;\t\t\\'
|
||||
print '\tld\t[%g1 + (4 * off)], %g5 ;\t\t\\'
|
||||
print '\tjmpl\t%g5, %g0 ;\t\t\t\t\\'
|
||||
print '\tnop'
|
||||
print '#endif'
|
||||
print ''
|
||||
print '.text'
|
||||
print '.align 32'
|
||||
print 'GLOBL_FN(__glapi_sparc_icache_flush)'
|
||||
print '__glapi_sparc_icache_flush: /* %o0 = insn_addr */'
|
||||
print '\tflush\t%o0'
|
||||
print '\tretl'
|
||||
print '\tnop'
|
||||
print ''
|
||||
print '.data'
|
||||
print '.align 64'
|
||||
print ''
|
||||
print 'GLOBL_FN(_mesa_sparc_glapi_begin)'
|
||||
print '_mesa_sparc_glapi_begin:'
|
||||
print ''
|
||||
return
|
||||
|
||||
def printRealFooter(self):
|
||||
print ''
|
||||
print 'GLOBL_FN(_mesa_sparc_glapi_end)'
|
||||
print '_mesa_sparc_glapi_end:'
|
||||
return
|
||||
|
||||
def printFunction(self, f):
|
||||
print '\tGL_STUB(gl%s, _gloffset_%s)' % (f.name, f.real_name)
|
||||
return
|
||||
|
||||
def show_usage():
|
||||
print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_name = "gl_API.xml"
|
||||
mode = "generic"
|
||||
|
||||
try:
|
||||
(args, trail) = getopt.getopt(sys.argv[1:], "m:f:")
|
||||
except Exception,e:
|
||||
show_usage()
|
||||
|
||||
for (arg,val) in args:
|
||||
if arg == '-m':
|
||||
mode = val
|
||||
elif arg == "-f":
|
||||
file_name = val
|
||||
|
||||
if mode == "generic":
|
||||
dh = PrintGenericStubs()
|
||||
else:
|
||||
print "ERROR: Invalid mode \"%s\" specified." % mode
|
||||
show_usage()
|
||||
|
||||
parser = make_parser()
|
||||
parser.setFeature(feature_namespaces, 0)
|
||||
parser.setContentHandler(dh)
|
||||
|
||||
f = open(file_name)
|
||||
|
||||
dh.printHeader()
|
||||
parser.parse(f)
|
||||
dh.printFooter()
|
||||
@@ -1,561 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
# (C) Copyright IBM Corporation 2004, 2005
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
from xml.sax import saxutils
|
||||
from xml.sax import make_parser
|
||||
from xml.sax.handler import feature_namespaces
|
||||
|
||||
import re
|
||||
|
||||
class glItem:
|
||||
"""Generic class on which all other API entity types are based."""
|
||||
|
||||
def __init__(self, tag_name, name, context):
|
||||
self.name = name
|
||||
self.category = context.get_category_define()
|
||||
self.context = context
|
||||
self.tag_name = tag_name
|
||||
|
||||
context.append(tag_name, self)
|
||||
return
|
||||
|
||||
def startElement(self, name, attrs):
|
||||
"""Generic startElement handler.
|
||||
|
||||
The startElement handler is called for all elements except
|
||||
the one that starts the object. For a foo element, the
|
||||
XML "<foo><bar/></foo>" would cause the startElement handler
|
||||
to be called once, but the endElement handler would be called
|
||||
twice."""
|
||||
return
|
||||
|
||||
def endElement(self, name):
|
||||
"""Generic endElement handler.
|
||||
|
||||
Generic endElement handler. Returns 1 if the tag containing
|
||||
the object is complete. Otherwise 0 is returned. All
|
||||
derived class endElement handlers should call this method. If
|
||||
the name of the ending tag is the same as the tag that
|
||||
started this object, the object is assumed to be complete.
|
||||
|
||||
This fails if a tag can contain another tag with the same
|
||||
name. The XML "<foo><foo/><bar/></foo>" would fail. The
|
||||
object would end before the bar tag was processed.
|
||||
|
||||
The endElement handler is called for every end element
|
||||
associated with an object, even the element that started the
|
||||
object. See the description of startElement an example."""
|
||||
|
||||
if name == self.tag_name:
|
||||
return 1
|
||||
else:
|
||||
return 0
|
||||
|
||||
def get_category_define(self):
|
||||
return self.category
|
||||
|
||||
|
||||
class glEnum( glItem ):
|
||||
"""Subclass of glItem for representing GL enumerants.
|
||||
|
||||
This class is not complete, and is not really used yet."""
|
||||
|
||||
def __init__(self, context, name, attrs):
|
||||
self.value = int(attrs.get('value', "0x0000"), 0)
|
||||
self.functions = {}
|
||||
|
||||
enum_name = "GL_" + attrs.get('name', None)
|
||||
glItem.__init__(self, name, enum_name, context)
|
||||
|
||||
def startElement(self, name, attrs):
|
||||
if name == "size":
|
||||
name = attrs.get('name', None)
|
||||
count = int(attrs.get('count', "0"), 0)
|
||||
self.functions[name] = count
|
||||
|
||||
return
|
||||
|
||||
|
||||
class glType( glItem ):
|
||||
"""Subclass of glItem for representing GL types."""
|
||||
|
||||
def __init__(self, context, name, attrs):
|
||||
self.size = int(attrs.get('size', "0"))
|
||||
self.glx_name = attrs.get('glx_name', "")
|
||||
|
||||
type_name = "GL" + attrs.get('name', None)
|
||||
glItem.__init__(self, name, type_name, context)
|
||||
|
||||
|
||||
class glParameter( glItem ):
|
||||
"""Parameter of a glFunction."""
|
||||
p_type = None
|
||||
p_type_string = ""
|
||||
p_count = 0
|
||||
p_count_parameters = None
|
||||
counter = None
|
||||
is_output = 0
|
||||
is_counter = 0
|
||||
is_pointer = 0
|
||||
|
||||
def __init__(self, context, name, attrs):
|
||||
p_name = attrs.get('name', None)
|
||||
self.p_type_string = attrs.get('type', None)
|
||||
self.p_count_parameters = attrs.get('variable_param', None)
|
||||
|
||||
self.p_type = context.context.find_type(self.p_type_string)
|
||||
if self.p_type == None:
|
||||
raise RuntimeError("Unknown type '%s' in function '%s'." % (self.p_type_string, context.name))
|
||||
|
||||
|
||||
# The count tag can be either a numeric string or the name of
|
||||
# a variable. If it is the name of a variable, the int(c)
|
||||
# statement will throw an exception, and the except block will
|
||||
# take over.
|
||||
|
||||
c = attrs.get('count', "0")
|
||||
try:
|
||||
self.p_count = int(c)
|
||||
self.counter = None
|
||||
except Exception,e:
|
||||
self.p_count = 0
|
||||
self.counter = c
|
||||
|
||||
if attrs.get('counter', "false") == "true":
|
||||
self.is_counter = 1
|
||||
else:
|
||||
self.is_counter = 0
|
||||
|
||||
if attrs.get('output', "false") == "true":
|
||||
self.is_output = 1
|
||||
else:
|
||||
self.is_output = 0
|
||||
|
||||
|
||||
# Pixel data has special parameters.
|
||||
|
||||
self.width = attrs.get('img_width', None)
|
||||
self.height = attrs.get('img_height', None)
|
||||
self.depth = attrs.get('img_depth', None)
|
||||
self.extent = attrs.get('img_extent', None)
|
||||
|
||||
self.img_xoff = attrs.get('img_xoff', None)
|
||||
self.img_yoff = attrs.get('img_yoff', None)
|
||||
self.img_zoff = attrs.get('img_zoff', None)
|
||||
self.img_woff = attrs.get('img_woff', None)
|
||||
|
||||
self.img_format = attrs.get('img_format', None)
|
||||
self.img_type = attrs.get('img_type', None)
|
||||
self.img_target = attrs.get('img_target', None)
|
||||
|
||||
pad = attrs.get('img_pad_dimensions', "false")
|
||||
if pad == "true":
|
||||
self.img_pad_dimensions = 1
|
||||
else:
|
||||
self.img_pad_dimensions = 0
|
||||
|
||||
|
||||
null_flag = attrs.get('img_null_flag', "false")
|
||||
if null_flag == "true":
|
||||
self.img_null_flag = 1
|
||||
else:
|
||||
self.img_null_flag = 0
|
||||
|
||||
send_null = attrs.get('img_send_null', "false")
|
||||
if send_null == "true":
|
||||
self.img_send_null = 1
|
||||
else:
|
||||
self.img_send_null = 0
|
||||
|
||||
|
||||
|
||||
if self.p_count > 0 or self.counter or self.p_count_parameters:
|
||||
has_count = 1
|
||||
else:
|
||||
has_count = 0
|
||||
|
||||
|
||||
# If there is a * anywhere in the parameter's type, then it
|
||||
# is a pointer.
|
||||
|
||||
if re.compile("[*]").search(self.p_type_string):
|
||||
# We could do some other validation here. For
|
||||
# example, an output parameter should not be const,
|
||||
# but every non-output parameter should.
|
||||
|
||||
self.is_pointer = 1;
|
||||
else:
|
||||
# If a parameter is not a pointer, then there cannot
|
||||
# be an associated count (either fixed size or
|
||||
# variable) and the parameter cannot be an output.
|
||||
|
||||
if has_count or self.is_output:
|
||||
raise RuntimeError("Non-pointer type has count or is output.")
|
||||
self.is_pointer = 0;
|
||||
|
||||
glItem.__init__(self, name, p_name, context)
|
||||
return
|
||||
|
||||
|
||||
def is_variable_length_array(self):
|
||||
"""Determine if a parameter is a variable length array.
|
||||
|
||||
A parameter is considered to be a variable length array if
|
||||
its size depends on the value of another parameter that is
|
||||
an enumerant. The params parameter to glTexEnviv is an
|
||||
example of a variable length array parameter. Arrays whose
|
||||
size depends on a count variable, such as the lists parameter
|
||||
to glCallLists, are not variable length arrays in this
|
||||
sense."""
|
||||
|
||||
return self.p_count_parameters or self.counter or self.width
|
||||
|
||||
|
||||
def is_array(self):
|
||||
return self.is_pointer
|
||||
|
||||
|
||||
def count_string(self):
|
||||
"""Return a string representing the number of items
|
||||
|
||||
Returns a string representing the number of items in a
|
||||
parameter. For scalar types this will always be "1". For
|
||||
vector types, it will depend on whether or not it is a
|
||||
fixed length vector (like the parameter of glVertex3fv),
|
||||
a counted length (like the vector parameter of
|
||||
glDeleteTextures), or a general variable length vector."""
|
||||
|
||||
if self.is_array():
|
||||
if self.p_count_parameters != None:
|
||||
return "compsize"
|
||||
elif self.counter != None:
|
||||
return self.counter
|
||||
else:
|
||||
return str(self.p_count)
|
||||
else:
|
||||
return "1"
|
||||
|
||||
|
||||
def size(self):
|
||||
if self.p_count_parameters or self.counter or self.width or self.is_output:
|
||||
return 0
|
||||
elif self.p_count == 0:
|
||||
return self.p_type.size
|
||||
else:
|
||||
return self.p_type.size * self.p_count
|
||||
|
||||
def size_string(self):
|
||||
s = self.size()
|
||||
if s == 0:
|
||||
a_prod = "compsize"
|
||||
b_prod = self.p_type.size
|
||||
|
||||
if self.p_count_parameters == None and self.counter != None:
|
||||
a_prod = self.counter
|
||||
elif self.p_count_parameters != None and self.counter == None:
|
||||
pass
|
||||
elif self.p_count_parameters != None and self.counter != None:
|
||||
b_prod = self.counter
|
||||
elif self.width:
|
||||
return "compsize"
|
||||
else:
|
||||
raise RuntimeError("Parameter '%s' to function '%s' has size 0." % (self.name, self.context.name))
|
||||
|
||||
return "(%s * %s)" % (a_prod, b_prod)
|
||||
else:
|
||||
return str(s)
|
||||
|
||||
|
||||
class glParameterIterator:
|
||||
"""Class to iterate over a list of glParameters.
|
||||
|
||||
Objects of this class are returned by the parameterIterator method of
|
||||
the glFunction class. They are used to iterate over the list of
|
||||
parameters to the function."""
|
||||
|
||||
def __init__(self, data):
|
||||
self.data = data
|
||||
self.index = 0
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
if self.index == len( self.data ):
|
||||
raise StopIteration
|
||||
i = self.index
|
||||
self.index += 1
|
||||
return self.data[i]
|
||||
|
||||
|
||||
class glFunction( glItem ):
|
||||
real_name = ""
|
||||
fn_alias = None
|
||||
fn_offset = -1
|
||||
fn_return_type = "void"
|
||||
fn_parameters = []
|
||||
|
||||
def __init__(self, context, name, attrs):
|
||||
self.fn_alias = attrs.get('alias', None)
|
||||
self.fn_parameters = []
|
||||
self.image = None
|
||||
|
||||
temp = attrs.get('offset', None)
|
||||
if temp == None or temp == "?":
|
||||
self.fn_offset = -1
|
||||
else:
|
||||
self.fn_offset = int(temp)
|
||||
|
||||
fn_name = attrs.get('name', None)
|
||||
if self.fn_alias != None:
|
||||
self.real_name = self.fn_alias
|
||||
else:
|
||||
self.real_name = fn_name
|
||||
|
||||
glItem.__init__(self, name, fn_name, context)
|
||||
return
|
||||
|
||||
|
||||
def parameterIterator(self):
|
||||
return glParameterIterator(self.fn_parameters)
|
||||
|
||||
|
||||
def startElement(self, name, attrs):
|
||||
if name == "param":
|
||||
try:
|
||||
self.context.factory.create(self, name, attrs)
|
||||
except RuntimeError:
|
||||
print "Error with parameter '%s' in function '%s'." \
|
||||
% (attrs.get('name','(unknown)'), self.name)
|
||||
raise
|
||||
elif name == "return":
|
||||
self.set_return_type(attrs.get('type', None))
|
||||
|
||||
|
||||
def append(self, tag_name, p):
|
||||
if tag_name != "param":
|
||||
raise RuntimeError("Trying to append '%s' to parameter list of function '%s'." % (tag_name, self.name))
|
||||
|
||||
if p.width:
|
||||
self.image = p
|
||||
|
||||
self.fn_parameters.append(p)
|
||||
|
||||
|
||||
def set_return_type(self, t):
|
||||
self.fn_return_type = t
|
||||
|
||||
|
||||
def get_parameter_string(self):
|
||||
arg_string = ""
|
||||
comma = ""
|
||||
for p in glFunction.parameterIterator(self):
|
||||
arg_string = arg_string + comma + p.p_type_string + " " + p.name
|
||||
comma = ", "
|
||||
|
||||
if arg_string == "":
|
||||
arg_string = "void"
|
||||
|
||||
return arg_string
|
||||
|
||||
|
||||
class glItemFactory:
|
||||
"""Factory to create objects derived from glItem."""
|
||||
|
||||
def create(self, context, name, attrs):
|
||||
if name == "function":
|
||||
return glFunction(context, name, attrs)
|
||||
elif name == "type":
|
||||
return glType(context, name, attrs)
|
||||
elif name == "enum":
|
||||
return glEnum(context, name, attrs)
|
||||
elif name == "param":
|
||||
return glParameter(context, name, attrs)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
class FilterGLAPISpecBase(saxutils.XMLFilterBase):
|
||||
name = "a"
|
||||
license = "The license for this file is unspecified."
|
||||
functions = {}
|
||||
next_alias = -2
|
||||
types = {}
|
||||
xref = {}
|
||||
current_object = None
|
||||
factory = None
|
||||
current_category = ""
|
||||
|
||||
def __init__(self):
|
||||
saxutils.XMLFilterBase.__init__(self)
|
||||
self.functions = {}
|
||||
self.types = {}
|
||||
self.xref = {}
|
||||
self.factory = glItemFactory()
|
||||
|
||||
|
||||
def find_type(self,type_name):
|
||||
for t in self.types:
|
||||
if re.compile(t).search(type_name):
|
||||
return self.types[t]
|
||||
print "Unable to find base type matching \"%s\"." % (type_name)
|
||||
return None
|
||||
|
||||
|
||||
def find_function(self,function_name):
|
||||
index = self.xref[function_name]
|
||||
return self.functions[index]
|
||||
|
||||
|
||||
def printFunctions(self):
|
||||
keys = self.functions.keys()
|
||||
keys.sort()
|
||||
prevk = -1
|
||||
for k in keys:
|
||||
if k < 0: continue
|
||||
|
||||
if self.functions[k].fn_alias == None:
|
||||
if k != prevk + 1:
|
||||
#print 'Missing offset %d' % (prevk)
|
||||
pass
|
||||
prevk = int(k)
|
||||
self.printFunction(self.functions[k])
|
||||
|
||||
keys.reverse()
|
||||
for k in keys:
|
||||
if self.functions[k].fn_alias != None:
|
||||
self.printFunction(self.functions[k])
|
||||
|
||||
return
|
||||
|
||||
|
||||
def printHeader(self):
|
||||
"""Print the header associated with all files and call the printRealHeader method."""
|
||||
|
||||
print '/* DO NOT EDIT - This file generated automatically by %s script */' \
|
||||
% (self.name)
|
||||
print ''
|
||||
print '/*'
|
||||
print ' * ' + self.license.replace('\n', '\n * ')
|
||||
print ' */'
|
||||
print ''
|
||||
self.printRealHeader();
|
||||
return
|
||||
|
||||
|
||||
def printFooter(self):
|
||||
"""Print the header associated with all files and call the printRealFooter method."""
|
||||
|
||||
self.printFunctions()
|
||||
self.printRealFooter()
|
||||
|
||||
|
||||
def get_category_define(self):
|
||||
"""Convert the category name to the #define that would be found in glext.h"""
|
||||
|
||||
if re.compile("[1-9][0-9]*[.][0-9]+").match(self.current_category):
|
||||
s = self.current_category
|
||||
return "GL_VERSION_" + s.replace(".", "_")
|
||||
else:
|
||||
return self.current_category
|
||||
|
||||
|
||||
def append(self, object_type, obj):
|
||||
if object_type == "function":
|
||||
# If the function is not an alias and has a negative
|
||||
# offset, then we do not need to track it. These are
|
||||
# functions that don't have an assigned offset
|
||||
|
||||
if obj.fn_offset >= 0 or obj.fn_alias != None:
|
||||
if obj.fn_offset >= 0:
|
||||
index = obj.fn_offset
|
||||
else:
|
||||
index = self.next_alias
|
||||
self.next_alias -= 1
|
||||
|
||||
self.functions[index] = obj
|
||||
self.xref[obj.name] = index
|
||||
elif object_type == "type":
|
||||
self.types[obj.name] = obj
|
||||
|
||||
return
|
||||
|
||||
|
||||
def startElement(self, name, attrs):
|
||||
"""Start a new element in the XML stream.
|
||||
|
||||
Starts a new element. There are three types of elements that
|
||||
are specially handled by this function. When a "category"
|
||||
element is encountered, the name of the category is saved.
|
||||
If an element is encountered and no API object is
|
||||
in-progress, a new object is created using the API factory.
|
||||
Any future elements, until that API object is closed, are
|
||||
passed to the current objects startElement method.
|
||||
|
||||
This paradigm was chosen becuase it allows subclasses of the
|
||||
basic API types (i.e., glFunction, glEnum, etc.) to handle
|
||||
additional XML data, GLX protocol information, that the base
|
||||
classes do not know about."""
|
||||
|
||||
if self.current_object != None:
|
||||
self.current_object.startElement(name, attrs)
|
||||
elif name == "category":
|
||||
self.current_category = attrs.get('name', "")
|
||||
else:
|
||||
self.current_object = self.factory.create(self, name, attrs)
|
||||
return
|
||||
|
||||
|
||||
def endElement(self, name):
|
||||
if self.current_object != None:
|
||||
if self.current_object.endElement(name):
|
||||
self.current_object = None
|
||||
return
|
||||
|
||||
|
||||
def printFunction(self,offset):
|
||||
"""Print a single function.
|
||||
|
||||
In the base class, this function is empty. All derived
|
||||
classes should over-ride this function."""
|
||||
return
|
||||
|
||||
|
||||
def printRealHeader(self):
|
||||
"""Print the "real" header for the created file.
|
||||
|
||||
In the base class, this function is empty. All derived
|
||||
classes should over-ride this function."""
|
||||
return
|
||||
|
||||
|
||||
def printRealFooter(self):
|
||||
"""Print the "real" footer for the created file.
|
||||
|
||||
In the base class, this function is empty. All derived
|
||||
classes should over-ride this function."""
|
||||
return
|
||||
@@ -1,235 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
# (C) Copyright IBM Corporation 2004
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
from xml.sax import saxutils
|
||||
from xml.sax import make_parser
|
||||
from xml.sax.handler import feature_namespaces
|
||||
|
||||
import gl_XML
|
||||
import license
|
||||
import sys, getopt
|
||||
|
||||
class PrintGlOffsets(gl_XML.FilterGLAPISpecBase):
|
||||
name = "gl_apitemp.py (from Mesa)"
|
||||
|
||||
def __init__(self):
|
||||
gl_XML.FilterGLAPISpecBase.__init__(self)
|
||||
self.license = license.bsd_license_template % ( \
|
||||
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
|
||||
|
||||
def printFunction(self, f):
|
||||
p_string = ""
|
||||
o_string = ""
|
||||
t_string = ""
|
||||
comma = ""
|
||||
|
||||
for p in f.parameterIterator():
|
||||
cast = ""
|
||||
|
||||
if p.is_pointer:
|
||||
t = "%p"
|
||||
cast = "(const void *) "
|
||||
elif p.p_type_string == 'GLenum':
|
||||
t = "0x%x"
|
||||
elif p.p_type_string in ['GLfloat', 'GLdouble', 'GLclampf', 'GLclampd']:
|
||||
t = "%f"
|
||||
else:
|
||||
t = "%d"
|
||||
|
||||
t_string = t_string + comma + t
|
||||
p_string = p_string + comma + p.name
|
||||
o_string = o_string + comma + cast + p.name
|
||||
comma = ", "
|
||||
|
||||
|
||||
if f.fn_return_type != 'void':
|
||||
dispatch = "RETURN_DISPATCH"
|
||||
else:
|
||||
dispatch = "DISPATCH"
|
||||
|
||||
print 'KEYWORD1 %s KEYWORD2 NAME(%s)(%s)' \
|
||||
% (f.fn_return_type, f.name, f.get_parameter_string())
|
||||
print '{'
|
||||
if p_string == "":
|
||||
print ' %s(%s, (), (F, "gl%s();\\n"));' \
|
||||
% (dispatch, f.real_name, f.name)
|
||||
else:
|
||||
print ' %s(%s, (%s), (F, "gl%s(%s);\\n", %s));' \
|
||||
% (dispatch, f.real_name, p_string, f.name, t_string, o_string)
|
||||
print '}'
|
||||
print ''
|
||||
return
|
||||
|
||||
def printRealHeader(self):
|
||||
print """
|
||||
/*
|
||||
* This file is a template which generates the OpenGL API entry point
|
||||
* functions. It should be included by a .c file which first defines
|
||||
* the following macros:
|
||||
* KEYWORD1 - usually nothing, but might be __declspec(dllexport) on Win32
|
||||
* KEYWORD2 - usually nothing, but might be __stdcall on Win32
|
||||
* NAME(n) - builds the final function name (usually add "gl" prefix)
|
||||
* DISPATCH(func, args, msg) - code to do dispatch of named function.
|
||||
* msg is a printf-style debug message.
|
||||
* RETURN_DISPATCH(func, args, msg) - code to do dispatch with a return value
|
||||
*
|
||||
* Here is an example which generates the usual OpenGL functions:
|
||||
* #define KEYWORD1
|
||||
* #define KEYWORD2
|
||||
* #define NAME(func) gl##func
|
||||
* #define DISPATCH(func, args, msg) \\
|
||||
* struct _glapi_table *dispatch = CurrentDispatch; \\
|
||||
* (*dispatch->func) args
|
||||
* #define RETURN DISPATCH(func, args, msg) \\
|
||||
* struct _glapi_table *dispatch = CurrentDispatch; \\
|
||||
* return (*dispatch->func) args
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#if defined( NAME )
|
||||
#ifndef KEYWORD1
|
||||
#define KEYWORD1
|
||||
#endif
|
||||
|
||||
#ifndef KEYWORD2
|
||||
#define KEYWORD2
|
||||
#endif
|
||||
|
||||
#ifndef DISPATCH
|
||||
#error DISPATCH must be defined
|
||||
#endif
|
||||
|
||||
#ifndef RETURN_DISPATCH
|
||||
#error RETURN_DISPATCH must be defined
|
||||
#endif
|
||||
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
|
||||
def printInitDispatch(self):
|
||||
print """
|
||||
#endif /* defined( NAME ) */
|
||||
|
||||
/*
|
||||
* This is how a dispatch table can be initialized with all the functions
|
||||
* we generated above.
|
||||
*/
|
||||
#ifdef DISPATCH_TABLE_NAME
|
||||
|
||||
#ifndef TABLE_ENTRY
|
||||
#error TABLE_ENTRY must be defined
|
||||
#endif
|
||||
|
||||
static _glapi_proc DISPATCH_TABLE_NAME[] = {"""
|
||||
keys = self.functions.keys()
|
||||
keys.sort()
|
||||
for k in keys:
|
||||
if k < 0: continue
|
||||
|
||||
print ' TABLE_ENTRY(%s),' % (self.functions[k].name)
|
||||
|
||||
print ' /* A whole bunch of no-op functions. These might be called'
|
||||
print ' * when someone tries to call a dynamically-registered'
|
||||
print ' * extension function without a current rendering context.'
|
||||
print ' */'
|
||||
for i in range(1, 100):
|
||||
print ' TABLE_ENTRY(Unused),'
|
||||
|
||||
print '};'
|
||||
print '#endif /* DISPATCH_TABLE_NAME */'
|
||||
print ''
|
||||
return
|
||||
|
||||
def printAliasedTable(self):
|
||||
print """
|
||||
/*
|
||||
* This is just used to silence compiler warnings.
|
||||
* We list the functions which are not otherwise used.
|
||||
*/
|
||||
#ifdef UNUSED_TABLE_NAME
|
||||
static _glapi_proc UNUSED_TABLE_NAME[] = {"""
|
||||
|
||||
keys = self.functions.keys()
|
||||
keys.sort()
|
||||
keys.reverse();
|
||||
for k in keys:
|
||||
f = self.functions[k]
|
||||
if f.fn_offset < 0:
|
||||
print ' TABLE_ENTRY(%s),' % (f.name)
|
||||
|
||||
print '};'
|
||||
print '#endif /*UNUSED_TABLE_NAME*/'
|
||||
print ''
|
||||
return
|
||||
|
||||
def printRealFooter(self):
|
||||
self.printInitDispatch()
|
||||
self.printAliasedTable()
|
||||
print"""
|
||||
#undef KEYWORD1
|
||||
#undef KEYWORD2
|
||||
#undef NAME
|
||||
#undef DISPATCH
|
||||
#undef RETURN_DISPATCH
|
||||
#undef DISPATCH_TABLE_NAME
|
||||
#undef UNUSED_TABLE_NAME
|
||||
#undef TABLE_ENTRY
|
||||
"""
|
||||
return
|
||||
|
||||
def show_usage():
|
||||
print "Usage: %s [-f input_file_name]" % sys.argv[0]
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_name = "gl_API.xml"
|
||||
|
||||
try:
|
||||
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
|
||||
except Exception,e:
|
||||
show_usage()
|
||||
|
||||
for (arg,val) in args:
|
||||
if arg == "-f":
|
||||
file_name = val
|
||||
|
||||
dh = PrintGlOffsets()
|
||||
|
||||
parser = make_parser()
|
||||
parser.setFeature(feature_namespaces, 0)
|
||||
parser.setContentHandler(dh)
|
||||
|
||||
f = open(file_name)
|
||||
|
||||
dh.printHeader()
|
||||
parser.parse(f)
|
||||
dh.printFooter()
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
# (C) Copyright IBM Corporation 2004
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
from xml.sax import saxutils
|
||||
from xml.sax import make_parser
|
||||
from xml.sax.handler import feature_namespaces
|
||||
|
||||
import gl_XML
|
||||
import license
|
||||
import sys, getopt
|
||||
|
||||
class PrintGlOffsets(gl_XML.FilterGLAPISpecBase):
|
||||
name = "gl_offsets.py (from Mesa)"
|
||||
|
||||
def __init__(self):
|
||||
gl_XML.FilterGLAPISpecBase.__init__(self)
|
||||
self.license = license.bsd_license_template % ( \
|
||||
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
|
||||
|
||||
def printFunction(self, f):
|
||||
if f.fn_offset < 0: return
|
||||
print '#define _gloffset_%s %d' % (f.name, f.fn_offset)
|
||||
|
||||
def printRealHeader(self):
|
||||
print '#ifndef _GLAPI_OFFSETS_H_'
|
||||
print '#define _GLAPI_OFFSETS_H_'
|
||||
print ''
|
||||
return
|
||||
|
||||
def printRealFooter(self):
|
||||
print ''
|
||||
print '#endif'
|
||||
return
|
||||
|
||||
def show_usage():
|
||||
print "Usage: %s [-f input_file_name]" % sys.argv[0]
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_name = "gl_API.xml"
|
||||
|
||||
try:
|
||||
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
|
||||
except Exception,e:
|
||||
show_usage()
|
||||
|
||||
for (arg,val) in args:
|
||||
if arg == "-f":
|
||||
file_name = val
|
||||
|
||||
dh = PrintGlOffsets()
|
||||
|
||||
parser = make_parser()
|
||||
parser.setFeature(feature_namespaces, 0)
|
||||
parser.setContentHandler(dh)
|
||||
|
||||
f = open(file_name)
|
||||
|
||||
dh.printHeader()
|
||||
parser.parse(f)
|
||||
dh.printFooter()
|
||||
@@ -1,179 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
# (C) Copyright IBM Corporation 2004
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
from xml.sax import saxutils
|
||||
from xml.sax import make_parser
|
||||
from xml.sax.handler import feature_namespaces
|
||||
|
||||
import license
|
||||
import gl_XML
|
||||
import sys, getopt
|
||||
|
||||
class PrintGlProcs(gl_XML.FilterGLAPISpecBase):
|
||||
name = "gl_procs.py (from Mesa)"
|
||||
|
||||
def __init__(self, long_strings):
|
||||
self.long_strings = long_strings
|
||||
gl_XML.FilterGLAPISpecBase.__init__(self)
|
||||
self.license = license.bsd_license_template % ( \
|
||||
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
|
||||
|
||||
|
||||
def printRealHeader(self):
|
||||
print '/* This file is only included by glapi.c and is used for'
|
||||
print ' * the GetProcAddress() function'
|
||||
print ' */'
|
||||
print ''
|
||||
print 'typedef struct {'
|
||||
print ' GLint Name_offset;'
|
||||
print '#ifdef NEED_FUNCTION_POINTER'
|
||||
print ' _glapi_proc Address;'
|
||||
print '#endif'
|
||||
print ' GLuint Offset;'
|
||||
print '} glprocs_table_t;'
|
||||
print ''
|
||||
print '#ifdef NEED_FUNCTION_POINTER'
|
||||
print '# define NAME_FUNC_OFFSET(n,f,o) { n , (_glapi_proc) f , o }'
|
||||
print '#else'
|
||||
print '# define NAME_FUNC_OFFSET(n,f,o) { n , o }'
|
||||
print '#endif'
|
||||
print ''
|
||||
return
|
||||
|
||||
def printRealFooter(self):
|
||||
print ''
|
||||
print '#undef NAME_FUNC_OFFSET'
|
||||
return
|
||||
|
||||
def printFunctionString(self, f):
|
||||
if self.long_strings:
|
||||
print ' "gl%s\\0"' % (f.name)
|
||||
else:
|
||||
print " 'g','l',",
|
||||
for c in f.name:
|
||||
print "'%s'," % (c),
|
||||
|
||||
print "'\\0',"
|
||||
|
||||
def printFunctionOffset(self, f, offset_of_name):
|
||||
print ' NAME_FUNC_OFFSET( % 5u, gl%s, _gloffset_%s ),' % (offset_of_name, f.name, f.real_name)
|
||||
|
||||
|
||||
def printFunctions(self):
|
||||
print ''
|
||||
if self.long_strings:
|
||||
print 'static const char gl_string_table[] ='
|
||||
else:
|
||||
print 'static const char gl_string_table[] = {'
|
||||
|
||||
keys = self.functions.keys()
|
||||
keys.sort()
|
||||
for k in keys:
|
||||
if k < 0: continue
|
||||
self.printFunctionString(self.functions[k])
|
||||
|
||||
keys.reverse()
|
||||
for k in keys:
|
||||
if k >= -1: continue
|
||||
self.printFunctionString(self.functions[k])
|
||||
|
||||
if self.long_strings:
|
||||
print ' ;'
|
||||
else:
|
||||
print '};'
|
||||
|
||||
print ''
|
||||
print 'static const glprocs_table_t static_functions[] = {'
|
||||
|
||||
keys = self.functions.keys()
|
||||
keys.sort()
|
||||
base_offset = 0
|
||||
for k in keys:
|
||||
if k < 0: continue
|
||||
self.printFunctionOffset(self.functions[k], base_offset)
|
||||
|
||||
# The length of the function's name, plus 2 for "gl",
|
||||
# plus 1 for the NUL.
|
||||
|
||||
base_offset += len(self.functions[k].name) + 3
|
||||
|
||||
keys.reverse()
|
||||
for k in keys:
|
||||
if k >= -1: continue
|
||||
self.printFunctionOffset(self.functions[k], base_offset)
|
||||
|
||||
# The length of the function's name, plus 2 for "gl",
|
||||
# plus 1 for the NUL.
|
||||
|
||||
base_offset += len(self.functions[k].name) + 3
|
||||
|
||||
print ' NAME_FUNC_OFFSET( -1, NULL, 0 )'
|
||||
print '};'
|
||||
return
|
||||
|
||||
|
||||
def show_usage():
|
||||
print "Usage: %s [-f input_file_name] [-m mode]" % sys.argv[0]
|
||||
print "mode can be one of:"
|
||||
print " long - Create code for compilers that can handle very "
|
||||
print " long string constants. (default)"
|
||||
print " short - Create code for compilers that can only handle "
|
||||
print " ANSI C89 string constants."
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_name = "gl_API.xml"
|
||||
|
||||
try:
|
||||
(args, trail) = getopt.getopt(sys.argv[1:], "f:m:")
|
||||
except Exception,e:
|
||||
show_usage()
|
||||
|
||||
long_string = 1
|
||||
for (arg,val) in args:
|
||||
if arg == "-f":
|
||||
file_name = val
|
||||
elif arg == "-m":
|
||||
if val == "short":
|
||||
long_string = 0
|
||||
elif val == "long":
|
||||
long_string = 1
|
||||
else:
|
||||
show_usage()
|
||||
|
||||
dh = PrintGlProcs( long_string )
|
||||
|
||||
parser = make_parser()
|
||||
parser.setFeature(feature_namespaces, 0)
|
||||
parser.setContentHandler(dh)
|
||||
|
||||
f = open(file_name)
|
||||
|
||||
dh.printHeader()
|
||||
parser.parse(f)
|
||||
dh.printFooter()
|
||||
@@ -1,98 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
# (C) Copyright IBM Corporation 2004
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
from xml.sax import saxutils
|
||||
from xml.sax import make_parser
|
||||
from xml.sax.handler import feature_namespaces
|
||||
|
||||
import gl_XML
|
||||
import license
|
||||
import sys, getopt
|
||||
|
||||
class PrintGlTable(gl_XML.FilterGLAPISpecBase):
|
||||
file_name = "gl_gen_table.xml (from Mesa)"
|
||||
|
||||
def __init__(self):
|
||||
gl_XML.FilterGLAPISpecBase.__init__(self)
|
||||
self.license = license.bsd_license_template % ( \
|
||||
"""Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
||||
(C) Copyright IBM Corporation 2004""", "BRIAN PAUL, IBM")
|
||||
|
||||
|
||||
def printFunction(self, f):
|
||||
if f.fn_offset < 0: return
|
||||
|
||||
arg_string = f.get_parameter_string()
|
||||
print ' %s (GLAPIENTRYP %s)(%s); /* %d */' % \
|
||||
(f.fn_return_type, f.name, arg_string, f.fn_offset)
|
||||
|
||||
def printRealHeader(self):
|
||||
print '#ifndef _GLAPI_TABLE_H_'
|
||||
print '#define _GLAPI_TABLE_H_'
|
||||
print ''
|
||||
print '#ifndef GLAPIENTRYP'
|
||||
print '#define GLAPIENTRYP'
|
||||
print '#endif'
|
||||
print ''
|
||||
print 'struct _glapi_table'
|
||||
print '{'
|
||||
return
|
||||
|
||||
def printRealFooter(self):
|
||||
print '};'
|
||||
print ''
|
||||
print '#endif'
|
||||
return
|
||||
|
||||
|
||||
def show_usage():
|
||||
print "Usage: %s [-f input_file_name]" % sys.argv[0]
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_name = "gl_API.xml"
|
||||
|
||||
try:
|
||||
(args, trail) = getopt.getopt(sys.argv[1:], "f:")
|
||||
except Exception,e:
|
||||
show_usage()
|
||||
|
||||
for (arg,val) in args:
|
||||
if arg == "-f":
|
||||
file_name = val
|
||||
|
||||
dh = PrintGlTable()
|
||||
|
||||
parser = make_parser()
|
||||
parser.setFeature(feature_namespaces, 0)
|
||||
parser.setContentHandler(dh)
|
||||
|
||||
f = open(file_name)
|
||||
|
||||
dh.printHeader()
|
||||
parser.parse(f)
|
||||
dh.printFooter()
|
||||
@@ -1,210 +0,0 @@
|
||||
#!/usr/bin/python2
|
||||
|
||||
# (C) Copyright IBM Corporation 2004, 2005
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
from xml.sax import saxutils
|
||||
from xml.sax import make_parser
|
||||
from xml.sax.handler import feature_namespaces
|
||||
|
||||
import gl_XML
|
||||
import license
|
||||
import sys, getopt
|
||||
|
||||
class PrintGenericStubs(gl_XML.FilterGLAPISpecBase):
|
||||
name = "gl_x86_asm.py (from Mesa)"
|
||||
|
||||
def __init__(self):
|
||||
gl_XML.FilterGLAPISpecBase.__init__(self)
|
||||
self.license = license.bsd_license_template % ( \
|
||||
"""Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
(C) Copyright IBM Corporation 2004, 2005""", "BRIAN PAUL, IBM")
|
||||
|
||||
|
||||
def get_stack_size(self, f):
|
||||
size = 0
|
||||
for p in f.parameterIterator():
|
||||
t = p.p_type
|
||||
|
||||
if p.is_array() or t.size != 8:
|
||||
size += 4
|
||||
else:
|
||||
size += 8
|
||||
|
||||
return size
|
||||
|
||||
def printRealHeader(self):
|
||||
print '#include "assyntax.h"'
|
||||
print '#include "glapioffsets.h"'
|
||||
print ''
|
||||
print "/* If we build with gcc's -fvisibility=hidden flag, we'll need to change"
|
||||
print "* the symbol visibility mode to 'default'."
|
||||
print '*/'
|
||||
print '#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303'
|
||||
print '#pragma GCC visibility push(default)'
|
||||
print '#endif'
|
||||
print ''
|
||||
print '#ifndef __WIN32__'
|
||||
print ''
|
||||
print '#if defined(STDCALL_API)'
|
||||
print '# if defined(USE_MGL_NAMESPACE)'
|
||||
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n2))'
|
||||
print '# else'
|
||||
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n2))'
|
||||
print '# endif'
|
||||
print '#else'
|
||||
print '# if defined(USE_MGL_NAMESPACE)'
|
||||
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(mgl,n))'
|
||||
print '# else'
|
||||
print '# define GL_PREFIX(n,n2) GLNAME(CONCAT(gl,n))'
|
||||
print '# endif'
|
||||
print '#endif'
|
||||
print ''
|
||||
print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))'
|
||||
print ''
|
||||
print '#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__)'
|
||||
print '#define GLOBL_FN(x) GLOBL x ; .type x, function'
|
||||
print '#else'
|
||||
print '#define GLOBL_FN(x) GLOBL x'
|
||||
print '#endif'
|
||||
print ''
|
||||
print '#if defined(PTHREADS) || defined(XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)'
|
||||
print '# define THREADS'
|
||||
print '#endif'
|
||||
print ''
|
||||
print '#if defined(PTHREADS)'
|
||||
print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\'
|
||||
print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
|
||||
print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
|
||||
print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
|
||||
print '\tMOV_L(CONTENT(GLNAME(_glapi_DispatchTSD)), EAX) ;\t\\'
|
||||
print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\'
|
||||
print '\tJE(1f) ;\t\t\t\t\t\\'
|
||||
print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\'
|
||||
print '1:\tCALL(_x86_get_dispatch) ;\t\t\t\\'
|
||||
print '\tJMP(GL_OFFSET(off))'
|
||||
print '#elif defined(THREADS)'
|
||||
print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\'
|
||||
print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
|
||||
print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
|
||||
print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
|
||||
print '\tMOV_L(CONTENT(GLNAME(_glapi_DispatchTSD)), EAX) ;\t\\'
|
||||
print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\'
|
||||
print '\tJE(1f) ;\t\t\t\t\t\\'
|
||||
print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\'
|
||||
print '1:\tCALL(_glapi_get_dispatch) ;\t\t\t\\'
|
||||
print '\tJMP(GL_OFFSET(off))'
|
||||
print '#else /* Non-threaded version. */'
|
||||
print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\'
|
||||
print 'ALIGNTEXT16;\t\t\t\t\t\t\\'
|
||||
print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\'
|
||||
print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\'
|
||||
print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\'
|
||||
print '\tJMP(GL_OFFSET(off))'
|
||||
print '#endif'
|
||||
print ''
|
||||
print '#ifdef HAVE_ALIAS'
|
||||
print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\'
|
||||
print '\t.globl\tGL_PREFIX(fn, fn_alt) ;\t\t\t\\'
|
||||
print '\t.set\tGL_PREFIX(fn, fn_alt), GL_PREFIX(alias, alias_alt)'
|
||||
print '#else'
|
||||
print '# define GL_STUB_ALIAS(fn,off,fn_alt,alias,alias_alt)\t\\'
|
||||
print ' GL_STUB(fn, off, fn_alt)'
|
||||
print '#endif'
|
||||
print ''
|
||||
print 'SEG_TEXT'
|
||||
print ''
|
||||
print '#ifdef PTHREADS'
|
||||
print 'EXTERN GLNAME(_glapi_Dispatch)'
|
||||
print 'EXTERN GLNAME(_gl_DispatchTSD)'
|
||||
print 'EXTERN GLNAME(pthread_getspecific)'
|
||||
print ''
|
||||
print 'ALIGNTEXT16'
|
||||
print 'GLNAME(_x86_get_dispatch):'
|
||||
print '\tSUB_L(CONST(24), ESP)'
|
||||
print '\tPUSH_L(GLNAME(_gl_DispatchTSD))'
|
||||
print '\tCALL(GLNAME(pthread_getspecific))'
|
||||
print '\tADD_L(CONST(28), ESP)'
|
||||
print '\tRET'
|
||||
print '#elif defined(THREADS)'
|
||||
print 'EXTERN GLNAME(_glapi_get_dispatch)'
|
||||
print '#endif'
|
||||
print ''
|
||||
print '\t\tALIGNTEXT16 ; GLOBL GLNAME(gl_dispatch_functions_start)'
|
||||
print 'GLNAME(gl_dispatch_functions_start):'
|
||||
print ''
|
||||
return
|
||||
|
||||
def printRealFooter(self):
|
||||
print ''
|
||||
print '#endif /* __WIN32__ */'
|
||||
return
|
||||
|
||||
def printFunction(self, f):
|
||||
stack = self.get_stack_size(f)
|
||||
|
||||
alt = "%s@%u" % (f.name, stack)
|
||||
if f.fn_alias == None:
|
||||
print '\tGL_STUB(%s, _gloffset_%s, %s)' % (f.name, f.real_name, alt)
|
||||
else:
|
||||
alias_alt = "%s@%u" % (f.real_name, stack)
|
||||
print '\tGL_STUB_ALIAS(%s, _gloffset_%s, %s, %s, %s)' % \
|
||||
(f.name, f.real_name, alt, f.real_name, alias_alt)
|
||||
return
|
||||
|
||||
def show_usage():
|
||||
print "Usage: %s [-f input_file_name] [-m output_mode]" % sys.argv[0]
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == '__main__':
|
||||
file_name = "gl_API.xml"
|
||||
mode = "generic"
|
||||
|
||||
try:
|
||||
(args, trail) = getopt.getopt(sys.argv[1:], "m:f:")
|
||||
except Exception,e:
|
||||
show_usage()
|
||||
|
||||
for (arg,val) in args:
|
||||
if arg == '-m':
|
||||
mode = val
|
||||
elif arg == "-f":
|
||||
file_name = val
|
||||
|
||||
if mode == "generic":
|
||||
dh = PrintGenericStubs()
|
||||
else:
|
||||
print "ERROR: Invalid mode \"%s\" specified." % mode
|
||||
show_usage()
|
||||
|
||||
parser = make_parser()
|
||||
parser.setFeature(feature_namespaces, 0)
|
||||
parser.setContentHandler(dh)
|
||||
|
||||
f = open(file_name)
|
||||
|
||||
dh.printHeader()
|
||||
parser.parse(f)
|
||||
dh.printFooter()
|
||||
+408
-388
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.3
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -46,18 +46,54 @@
|
||||
|
||||
|
||||
#include "GL/gl.h"
|
||||
#include "glapitable.h"
|
||||
#include "glthread.h"
|
||||
|
||||
struct _glapi_table;
|
||||
|
||||
typedef void (*_glapi_warning_func)(void *ctx, const char *str, ...);
|
||||
|
||||
typedef void (*_glapi_proc)(void); /* generic function pointer */
|
||||
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#define _glapi_set_dispatch _mglapi_set_dispatch
|
||||
#define _glapi_get_dispatch _mglapi_get_dispatch
|
||||
#define _glapi_set_context _mglapi_set_context
|
||||
#define _glapi_get_context _mglapi_get_context
|
||||
#define _glapi_Context _mglapi_Context
|
||||
#define _glapi_Dispatch _mglapi_Dispatch
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
** Define the GET_CURRENT_CONTEXT() macro.
|
||||
** \param C local variable which will hold the current context.
|
||||
**/
|
||||
#if defined (GLX_USE_TLS)
|
||||
|
||||
const extern void *_glapi_Context;
|
||||
const extern struct _glapi_table *_glapi_Dispatch;
|
||||
|
||||
extern __thread void * _glapi_tls_Context
|
||||
__attribute__((tls_model("initial-exec")));
|
||||
|
||||
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_tls_Context
|
||||
|
||||
#else
|
||||
|
||||
extern void *_glapi_Context;
|
||||
|
||||
extern struct _glapi_table *_glapi_Dispatch;
|
||||
|
||||
# ifdef THREADS
|
||||
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) (_glapi_Context ? _glapi_Context : _glapi_get_context())
|
||||
# else
|
||||
# define GET_CURRENT_CONTEXT(C) GLcontext *C = (GLcontext *) _glapi_Context
|
||||
# endif
|
||||
|
||||
#endif /* defined (GLX_USE_TLS) */
|
||||
|
||||
|
||||
/**
|
||||
** GL API public functions
|
||||
**/
|
||||
|
||||
extern void
|
||||
_glapi_noop_enable_warnings(GLboolean enable);
|
||||
@@ -101,17 +137,13 @@ extern GLuint
|
||||
_glapi_get_dispatch_table_size(void);
|
||||
|
||||
|
||||
extern const char *
|
||||
_glapi_get_version(void);
|
||||
|
||||
|
||||
extern void
|
||||
_glapi_check_table(const struct _glapi_table *table);
|
||||
|
||||
|
||||
extern GLboolean
|
||||
_glapi_add_entrypoint(const char *funcName, GLuint offset);
|
||||
|
||||
extern int
|
||||
_glapi_add_dispatch( const char * const * function_names,
|
||||
const char * parameter_signature );
|
||||
|
||||
extern GLint
|
||||
_glapi_get_proc_offset(const char *funcName);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
/* DO NOT EDIT - This file generated automatically by a script */
|
||||
/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
||||
@@ -26,13 +26,15 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _GLAPI_TABLE_H_
|
||||
#define _GLAPI_TABLE_H_
|
||||
#if !defined( _GLAPI_TABLE_H_ )
|
||||
# define _GLAPI_TABLE_H_
|
||||
|
||||
#ifndef GLAPIENTRYP
|
||||
#define GLAPIENTRYP
|
||||
#endif
|
||||
|
||||
typedef void (*_glapi_proc)(void); /* generic function pointer */
|
||||
|
||||
struct _glapi_table
|
||||
{
|
||||
void (GLAPIENTRYP NewList)(GLuint list, GLenum mode); /* 0 */
|
||||
@@ -443,394 +445,370 @@ struct _glapi_table
|
||||
void (GLAPIENTRYP MultiTexCoord4ivARB)(GLenum target, const GLint * v); /* 405 */
|
||||
void (GLAPIENTRYP MultiTexCoord4sARB)(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); /* 406 */
|
||||
void (GLAPIENTRYP MultiTexCoord4svARB)(GLenum target, const GLshort * v); /* 407 */
|
||||
void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 408 */
|
||||
void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 409 */
|
||||
void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 410 */
|
||||
void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 411 */
|
||||
void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 412 */
|
||||
void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 413 */
|
||||
void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 414 */
|
||||
void (GLAPIENTRYP GetTexFilterFuncSGIS)(GLenum target, GLenum filter, GLfloat * weights); /* 415 */
|
||||
void (GLAPIENTRYP TexFilterFuncSGIS)(GLenum target, GLenum filter, GLsizei n, const GLfloat * weights); /* 416 */
|
||||
void (GLAPIENTRYP GetHistogramEXT)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 417 */
|
||||
void (GLAPIENTRYP GetHistogramParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params); /* 418 */
|
||||
void (GLAPIENTRYP GetHistogramParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 419 */
|
||||
void (GLAPIENTRYP GetMinmaxEXT)(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values); /* 420 */
|
||||
void (GLAPIENTRYP GetMinmaxParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params); /* 421 */
|
||||
void (GLAPIENTRYP GetMinmaxParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 422 */
|
||||
void (GLAPIENTRYP GetConvolutionFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid * image); /* 423 */
|
||||
void (GLAPIENTRYP GetConvolutionParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params); /* 424 */
|
||||
void (GLAPIENTRYP GetConvolutionParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 425 */
|
||||
void (GLAPIENTRYP GetSeparableFilterEXT)(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span); /* 426 */
|
||||
void (GLAPIENTRYP GetColorTableSGI)(GLenum target, GLenum format, GLenum type, GLvoid * table); /* 427 */
|
||||
void (GLAPIENTRYP GetColorTableParameterfvSGI)(GLenum target, GLenum pname, GLfloat * params); /* 428 */
|
||||
void (GLAPIENTRYP GetColorTableParameterivSGI)(GLenum target, GLenum pname, GLint * params); /* 429 */
|
||||
void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 430 */
|
||||
void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 431 */
|
||||
void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 432 */
|
||||
void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 433 */
|
||||
void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 434 */
|
||||
void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 435 */
|
||||
void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 436 */
|
||||
void (GLAPIENTRYP TexImage4DSGIS)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid * pixels); /* 437 */
|
||||
void (GLAPIENTRYP TexSubImage4DSGIS)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid * pixels); /* 438 */
|
||||
GLboolean (GLAPIENTRYP AreTexturesResidentEXT)(GLsizei n, const GLuint * textures, GLboolean * residences); /* 439 */
|
||||
void (GLAPIENTRYP GenTexturesEXT)(GLsizei n, GLuint * textures); /* 440 */
|
||||
GLboolean (GLAPIENTRYP IsTextureEXT)(GLuint texture); /* 441 */
|
||||
void (GLAPIENTRYP DetailTexFuncSGIS)(GLenum target, GLsizei n, const GLfloat * points); /* 442 */
|
||||
void (GLAPIENTRYP GetDetailTexFuncSGIS)(GLenum target, GLfloat * points); /* 443 */
|
||||
void (GLAPIENTRYP SharpenTexFuncSGIS)(GLenum target, GLsizei n, const GLfloat * points); /* 444 */
|
||||
void (GLAPIENTRYP GetSharpenTexFuncSGIS)(GLenum target, GLfloat * points); /* 445 */
|
||||
void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 446 */
|
||||
void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 447 */
|
||||
void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 448 */
|
||||
void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 449 */
|
||||
void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 450 */
|
||||
void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 451 */
|
||||
void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 452 */
|
||||
void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 453 */
|
||||
void (GLAPIENTRYP SpriteParameterfSGIX)(GLenum pname, GLfloat param); /* 454 */
|
||||
void (GLAPIENTRYP SpriteParameterfvSGIX)(GLenum pname, const GLfloat * params); /* 455 */
|
||||
void (GLAPIENTRYP SpriteParameteriSGIX)(GLenum pname, GLint param); /* 456 */
|
||||
void (GLAPIENTRYP SpriteParameterivSGIX)(GLenum pname, const GLint * params); /* 457 */
|
||||
void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 458 */
|
||||
void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 459 */
|
||||
GLint (GLAPIENTRYP GetInstrumentsSGIX)(void); /* 460 */
|
||||
void (GLAPIENTRYP InstrumentsBufferSGIX)(GLsizei size, GLint * buffer); /* 461 */
|
||||
GLint (GLAPIENTRYP PollInstrumentsSGIX)(GLint * marker_p); /* 462 */
|
||||
void (GLAPIENTRYP ReadInstrumentsSGIX)(GLint marker); /* 463 */
|
||||
void (GLAPIENTRYP StartInstrumentsSGIX)(void); /* 464 */
|
||||
void (GLAPIENTRYP StopInstrumentsSGIX)(GLint marker); /* 465 */
|
||||
void (GLAPIENTRYP FrameZoomSGIX)(GLint factor); /* 466 */
|
||||
void (GLAPIENTRYP TagSampleBufferSGIX)(void); /* 467 */
|
||||
void (GLAPIENTRYP ReferencePlaneSGIX)(const GLdouble * equation); /* 468 */
|
||||
void (GLAPIENTRYP FlushRasterSGIX)(void); /* 469 */
|
||||
void (GLAPIENTRYP GetListParameterfvSGIX)(GLuint list, GLenum pname, GLfloat * params); /* 470 */
|
||||
void (GLAPIENTRYP GetListParameterivSGIX)(GLuint list, GLenum pname, GLint * params); /* 471 */
|
||||
void (GLAPIENTRYP ListParameterfSGIX)(GLuint list, GLenum pname, GLfloat param); /* 472 */
|
||||
void (GLAPIENTRYP ListParameterfvSGIX)(GLuint list, GLenum pname, const GLfloat * params); /* 473 */
|
||||
void (GLAPIENTRYP ListParameteriSGIX)(GLuint list, GLenum pname, GLint param); /* 474 */
|
||||
void (GLAPIENTRYP ListParameterivSGIX)(GLuint list, GLenum pname, const GLint * params); /* 475 */
|
||||
void (GLAPIENTRYP FragmentColorMaterialSGIX)(GLenum face, GLenum mode); /* 476 */
|
||||
void (GLAPIENTRYP FragmentLightfSGIX)(GLenum light, GLenum pname, GLfloat param); /* 477 */
|
||||
void (GLAPIENTRYP FragmentLightfvSGIX)(GLenum light, GLenum pname, const GLfloat * params); /* 478 */
|
||||
void (GLAPIENTRYP FragmentLightiSGIX)(GLenum light, GLenum pname, GLint param); /* 479 */
|
||||
void (GLAPIENTRYP FragmentLightivSGIX)(GLenum light, GLenum pname, const GLint * params); /* 480 */
|
||||
void (GLAPIENTRYP FragmentLightModelfSGIX)(GLenum pname, GLfloat param); /* 481 */
|
||||
void (GLAPIENTRYP FragmentLightModelfvSGIX)(GLenum pname, const GLfloat * params); /* 482 */
|
||||
void (GLAPIENTRYP FragmentLightModeliSGIX)(GLenum pname, GLint param); /* 483 */
|
||||
void (GLAPIENTRYP FragmentLightModelivSGIX)(GLenum pname, const GLint * params); /* 484 */
|
||||
void (GLAPIENTRYP FragmentMaterialfSGIX)(GLenum face, GLenum pname, GLfloat param); /* 485 */
|
||||
void (GLAPIENTRYP FragmentMaterialfvSGIX)(GLenum face, GLenum pname, const GLfloat * params); /* 486 */
|
||||
void (GLAPIENTRYP FragmentMaterialiSGIX)(GLenum face, GLenum pname, GLint param); /* 487 */
|
||||
void (GLAPIENTRYP FragmentMaterialivSGIX)(GLenum face, GLenum pname, const GLint * params); /* 488 */
|
||||
void (GLAPIENTRYP GetFragmentLightfvSGIX)(GLenum light, GLenum pname, GLfloat * params); /* 489 */
|
||||
void (GLAPIENTRYP GetFragmentLightivSGIX)(GLenum light, GLenum pname, GLint * params); /* 490 */
|
||||
void (GLAPIENTRYP GetFragmentMaterialfvSGIX)(GLenum face, GLenum pname, GLfloat * params); /* 491 */
|
||||
void (GLAPIENTRYP GetFragmentMaterialivSGIX)(GLenum face, GLenum pname, GLint * params); /* 492 */
|
||||
void (GLAPIENTRYP LightEnviSGIX)(GLenum pname, GLint param); /* 493 */
|
||||
void (GLAPIENTRYP VertexWeightfEXT)(GLfloat weight); /* 494 */
|
||||
void (GLAPIENTRYP VertexWeightfvEXT)(const GLfloat * weight); /* 495 */
|
||||
void (GLAPIENTRYP VertexWeightPointerEXT)(GLsizei size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 496 */
|
||||
void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 497 */
|
||||
void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 498 */
|
||||
void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 499 */
|
||||
void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 500 */
|
||||
void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 501 */
|
||||
void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 502 */
|
||||
void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 503 */
|
||||
void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 504 */
|
||||
void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 505 */
|
||||
void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 506 */
|
||||
void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 507 */
|
||||
void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 508 */
|
||||
void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 509 */
|
||||
void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 510 */
|
||||
void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 511 */
|
||||
void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 512 */
|
||||
void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 513 */
|
||||
void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 514 */
|
||||
void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 515 */
|
||||
void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 516 */
|
||||
void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 517 */
|
||||
void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 518 */
|
||||
void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 519 */
|
||||
void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 520 */
|
||||
void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 521 */
|
||||
void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 522 */
|
||||
void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 523 */
|
||||
void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 524 */
|
||||
void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 525 */
|
||||
void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 526 */
|
||||
void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 527 */
|
||||
void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 528 */
|
||||
void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 529 */
|
||||
void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 530 */
|
||||
void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 531 */
|
||||
void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 532 */
|
||||
void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 533 */
|
||||
void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 534 */
|
||||
void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 535 */
|
||||
void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 536 */
|
||||
void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 537 */
|
||||
void (GLAPIENTRYP IndexMaterialEXT)(GLenum face, GLenum mode); /* 538 */
|
||||
void (GLAPIENTRYP IndexFuncEXT)(GLenum func, GLclampf ref); /* 539 */
|
||||
void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 540 */
|
||||
void (GLAPIENTRYP UnlockArraysEXT)(void); /* 541 */
|
||||
void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 542 */
|
||||
void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 543 */
|
||||
void (GLAPIENTRYP HintPGI)(GLenum target, GLint mode); /* 544 */
|
||||
void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 545 */
|
||||
void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 546 */
|
||||
void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 547 */
|
||||
void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 548 */
|
||||
void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 549 */
|
||||
void (GLAPIENTRYP GetColorTableEXT)(GLenum target, GLenum format, GLenum type, GLvoid * data); /* 550 */
|
||||
void (GLAPIENTRYP GetColorTableParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 551 */
|
||||
void (GLAPIENTRYP GetColorTableParameterfvEXT)(GLenum target, GLenum pname, GLfloat * params); /* 552 */
|
||||
void (GLAPIENTRYP TbufferMask3DFX)(GLuint mask); /* 553 */
|
||||
void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 554 */
|
||||
void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 555 */
|
||||
void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 556 */
|
||||
void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 557 */
|
||||
void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 558 */
|
||||
void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 559 */
|
||||
void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 560 */
|
||||
void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 561 */
|
||||
void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 562 */
|
||||
void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 563 */
|
||||
void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 564 */
|
||||
void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 565 */
|
||||
void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 566 */
|
||||
void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 567 */
|
||||
void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 568 */
|
||||
void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 569 */
|
||||
void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 570 */
|
||||
void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 571 */
|
||||
void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 572 */
|
||||
void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 573 */
|
||||
void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 574 */
|
||||
void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 575 */
|
||||
void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 576 */
|
||||
void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 577 */
|
||||
GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 578 */
|
||||
void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint id); /* 579 */
|
||||
void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * ids); /* 580 */
|
||||
void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 581 */
|
||||
void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * ids); /* 582 */
|
||||
void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 583 */
|
||||
void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 584 */
|
||||
void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 585 */
|
||||
void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 586 */
|
||||
void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 587 */
|
||||
void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 588 */
|
||||
void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 589 */
|
||||
void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 590 */
|
||||
void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** pointer); /* 591 */
|
||||
GLboolean (GLAPIENTRYP IsProgramNV)(GLuint id); /* 592 */
|
||||
void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 593 */
|
||||
void (GLAPIENTRYP ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 594 */
|
||||
void (GLAPIENTRYP ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params); /* 595 */
|
||||
void (GLAPIENTRYP ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 596 */
|
||||
void (GLAPIENTRYP ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params); /* 597 */
|
||||
void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 598 */
|
||||
void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 599 */
|
||||
void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 600 */
|
||||
void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 601 */
|
||||
void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 602 */
|
||||
void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 603 */
|
||||
void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 604 */
|
||||
void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 605 */
|
||||
void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 606 */
|
||||
void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 607 */
|
||||
void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 608 */
|
||||
void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 609 */
|
||||
void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 610 */
|
||||
void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 611 */
|
||||
void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 612 */
|
||||
void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 613 */
|
||||
void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 614 */
|
||||
void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 615 */
|
||||
void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 616 */
|
||||
void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 617 */
|
||||
void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 618 */
|
||||
void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 619 */
|
||||
void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 620 */
|
||||
void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 621 */
|
||||
void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 622 */
|
||||
void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 623 */
|
||||
void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 624 */
|
||||
void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 625 */
|
||||
void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 626 */
|
||||
void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 627 */
|
||||
void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 628 */
|
||||
void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 629 */
|
||||
void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 630 */
|
||||
void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 631 */
|
||||
void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 632 */
|
||||
void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 633 */
|
||||
void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 634 */
|
||||
void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 635 */
|
||||
void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 636 */
|
||||
void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 637 */
|
||||
void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 638 */
|
||||
void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 639 */
|
||||
void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 640 */
|
||||
void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 641 */
|
||||
void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint params); /* 642 */
|
||||
void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 643 */
|
||||
void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 644 */
|
||||
void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 645 */
|
||||
void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 646 */
|
||||
void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 647 */
|
||||
void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 648 */
|
||||
GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 649 */
|
||||
GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 650 */
|
||||
void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 651 */
|
||||
void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 652 */
|
||||
void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 653 */
|
||||
void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 654 */
|
||||
void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 655 */
|
||||
void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 656 */
|
||||
void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 657 */
|
||||
void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 658 */
|
||||
void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 659 */
|
||||
void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 660 */
|
||||
void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 661 */
|
||||
void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 662 */
|
||||
void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 663 */
|
||||
void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 664 */
|
||||
void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 665 */
|
||||
void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 666 */
|
||||
void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 667 */
|
||||
void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 668 */
|
||||
void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 669 */
|
||||
void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 670 */
|
||||
void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 671 */
|
||||
void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 672 */
|
||||
void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 673 */
|
||||
void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 674 */
|
||||
void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 675 */
|
||||
void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 676 */
|
||||
void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 677 */
|
||||
void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 678 */
|
||||
void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 679 */
|
||||
void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 680 */
|
||||
void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 681 */
|
||||
void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 682 */
|
||||
void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 683 */
|
||||
void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 684 */
|
||||
void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 685 */
|
||||
void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 686 */
|
||||
void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 687 */
|
||||
void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 688 */
|
||||
void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 689 */
|
||||
void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 690 */
|
||||
void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 691 */
|
||||
void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 692 */
|
||||
void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 693 */
|
||||
void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 694 */
|
||||
void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 695 */
|
||||
GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 696 */
|
||||
GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 697 */
|
||||
GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 698 */
|
||||
void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 699 */
|
||||
void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 700 */
|
||||
void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 701 */
|
||||
GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 702 */
|
||||
void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 703 */
|
||||
void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 704 */
|
||||
void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 705 */
|
||||
void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 706 */
|
||||
void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 707 */
|
||||
void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 708 */
|
||||
void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 709 */
|
||||
void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 710 */
|
||||
void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 711 */
|
||||
GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 712 */
|
||||
void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 713 */
|
||||
GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 714 */
|
||||
void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint * length); /* 715 */
|
||||
void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shaderObj); /* 716 */
|
||||
GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 717 */
|
||||
void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 718 */
|
||||
void (GLAPIENTRYP LinkProgramARB)(GLhandleARB programObj); /* 719 */
|
||||
void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB programObj); /* 720 */
|
||||
void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB programObj); /* 721 */
|
||||
void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 722 */
|
||||
void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 723 */
|
||||
void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 724 */
|
||||
void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 725 */
|
||||
void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 726 */
|
||||
void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 727 */
|
||||
void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 728 */
|
||||
void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 729 */
|
||||
void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 730 */
|
||||
void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 731 */
|
||||
void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 732 */
|
||||
void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 733 */
|
||||
void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 734 */
|
||||
void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 735 */
|
||||
void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 736 */
|
||||
void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 737 */
|
||||
void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 738 */
|
||||
void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 739 */
|
||||
void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 740 */
|
||||
void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 741 */
|
||||
void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 742 */
|
||||
void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 743 */
|
||||
void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 744 */
|
||||
GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB programObj, const GLcharARB * name); /* 745 */
|
||||
void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 746 */
|
||||
void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB programObj, GLint location, GLfloat * params); /* 747 */
|
||||
void (GLAPIENTRYP GetUniformivARB)(GLhandleARB programObj, GLint location, GLint * params); /* 748 */
|
||||
void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source); /* 749 */
|
||||
void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB programObj, GLuint index, const GLcharARB * name); /* 750 */
|
||||
void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 751 */
|
||||
GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB programObj, const GLcharARB * name); /* 752 */
|
||||
void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 753 */
|
||||
void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 754 */
|
||||
void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 755 */
|
||||
void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 756 */
|
||||
void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 757 */
|
||||
void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 758 */
|
||||
void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 759 */
|
||||
void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 760 */
|
||||
void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 761 */
|
||||
void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 762 */
|
||||
void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 763 */
|
||||
void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 764 */
|
||||
void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 765 */
|
||||
void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 766 */
|
||||
void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 767 */
|
||||
void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 768 */
|
||||
void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 769 */
|
||||
void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 770 */
|
||||
void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 771 */
|
||||
void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 772 */
|
||||
void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 773 */
|
||||
void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 774 */
|
||||
void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 775 */
|
||||
void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 776 */
|
||||
void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 777 */
|
||||
void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 778 */
|
||||
void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 779 */
|
||||
void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 780 */
|
||||
void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 781 */
|
||||
GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 782 */
|
||||
void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 783 */
|
||||
void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 784 */
|
||||
void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 785 */
|
||||
void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 786 */
|
||||
void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 787 */
|
||||
void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 788 */
|
||||
void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 789 */
|
||||
void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 790 */
|
||||
void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 791 */
|
||||
void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 792 */
|
||||
void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 793 */
|
||||
void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 794 */
|
||||
void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 795 */
|
||||
void (GLAPIENTRYP AttachShader)(GLuint program, GLuint shader); /* 408 */
|
||||
GLuint (GLAPIENTRYP CreateProgram)(void); /* 409 */
|
||||
GLuint (GLAPIENTRYP CreateShader)(GLenum type); /* 410 */
|
||||
void (GLAPIENTRYP DeleteProgram)(GLuint program); /* 411 */
|
||||
void (GLAPIENTRYP DeleteShader)(GLuint program); /* 412 */
|
||||
void (GLAPIENTRYP DetachShader)(GLuint program, GLuint shader); /* 413 */
|
||||
void (GLAPIENTRYP GetAttachedShaders)(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj); /* 414 */
|
||||
void (GLAPIENTRYP GetProgramInfoLog)(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 415 */
|
||||
void (GLAPIENTRYP GetProgramiv)(GLuint program, GLenum pname, GLint * params); /* 416 */
|
||||
void (GLAPIENTRYP GetShaderInfoLog)(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog); /* 417 */
|
||||
void (GLAPIENTRYP GetShaderiv)(GLuint shader, GLenum pname, GLint * params); /* 418 */
|
||||
GLboolean (GLAPIENTRYP IsProgram)(GLuint program); /* 419 */
|
||||
GLboolean (GLAPIENTRYP IsShader)(GLuint shader); /* 420 */
|
||||
void (GLAPIENTRYP StencilFuncSeparate)(GLenum face, GLenum func, GLint ref, GLuint mask); /* 421 */
|
||||
void (GLAPIENTRYP StencilMaskSeparate)(GLenum face, GLuint mask); /* 422 */
|
||||
void (GLAPIENTRYP StencilOpSeparate)(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); /* 423 */
|
||||
void (GLAPIENTRYP UniformMatrix2x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 424 */
|
||||
void (GLAPIENTRYP UniformMatrix2x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 425 */
|
||||
void (GLAPIENTRYP UniformMatrix3x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 426 */
|
||||
void (GLAPIENTRYP UniformMatrix3x4fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 427 */
|
||||
void (GLAPIENTRYP UniformMatrix4x2fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 428 */
|
||||
void (GLAPIENTRYP UniformMatrix4x3fv)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 429 */
|
||||
void (GLAPIENTRYP LoadTransposeMatrixdARB)(const GLdouble * m); /* 430 */
|
||||
void (GLAPIENTRYP LoadTransposeMatrixfARB)(const GLfloat * m); /* 431 */
|
||||
void (GLAPIENTRYP MultTransposeMatrixdARB)(const GLdouble * m); /* 432 */
|
||||
void (GLAPIENTRYP MultTransposeMatrixfARB)(const GLfloat * m); /* 433 */
|
||||
void (GLAPIENTRYP SampleCoverageARB)(GLclampf value, GLboolean invert); /* 434 */
|
||||
void (GLAPIENTRYP CompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data); /* 435 */
|
||||
void (GLAPIENTRYP CompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data); /* 436 */
|
||||
void (GLAPIENTRYP CompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data); /* 437 */
|
||||
void (GLAPIENTRYP CompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data); /* 438 */
|
||||
void (GLAPIENTRYP CompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data); /* 439 */
|
||||
void (GLAPIENTRYP CompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data); /* 440 */
|
||||
void (GLAPIENTRYP GetCompressedTexImageARB)(GLenum target, GLint level, GLvoid * img); /* 441 */
|
||||
void (GLAPIENTRYP DisableVertexAttribArrayARB)(GLuint index); /* 442 */
|
||||
void (GLAPIENTRYP EnableVertexAttribArrayARB)(GLuint index); /* 443 */
|
||||
void (GLAPIENTRYP GetProgramEnvParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 444 */
|
||||
void (GLAPIENTRYP GetProgramEnvParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 445 */
|
||||
void (GLAPIENTRYP GetProgramLocalParameterdvARB)(GLenum target, GLuint index, GLdouble * params); /* 446 */
|
||||
void (GLAPIENTRYP GetProgramLocalParameterfvARB)(GLenum target, GLuint index, GLfloat * params); /* 447 */
|
||||
void (GLAPIENTRYP GetProgramStringARB)(GLenum target, GLenum pname, GLvoid * string); /* 448 */
|
||||
void (GLAPIENTRYP GetProgramivARB)(GLenum target, GLenum pname, GLint * params); /* 449 */
|
||||
void (GLAPIENTRYP GetVertexAttribdvARB)(GLuint index, GLenum pname, GLdouble * params); /* 450 */
|
||||
void (GLAPIENTRYP GetVertexAttribfvARB)(GLuint index, GLenum pname, GLfloat * params); /* 451 */
|
||||
void (GLAPIENTRYP GetVertexAttribivARB)(GLuint index, GLenum pname, GLint * params); /* 452 */
|
||||
void (GLAPIENTRYP ProgramEnvParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 453 */
|
||||
void (GLAPIENTRYP ProgramEnvParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 454 */
|
||||
void (GLAPIENTRYP ProgramEnvParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 455 */
|
||||
void (GLAPIENTRYP ProgramEnvParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 456 */
|
||||
void (GLAPIENTRYP ProgramLocalParameter4dARB)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 457 */
|
||||
void (GLAPIENTRYP ProgramLocalParameter4dvARB)(GLenum target, GLuint index, const GLdouble * params); /* 458 */
|
||||
void (GLAPIENTRYP ProgramLocalParameter4fARB)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 459 */
|
||||
void (GLAPIENTRYP ProgramLocalParameter4fvARB)(GLenum target, GLuint index, const GLfloat * params); /* 460 */
|
||||
void (GLAPIENTRYP ProgramStringARB)(GLenum target, GLenum format, GLsizei len, const GLvoid * string); /* 461 */
|
||||
void (GLAPIENTRYP VertexAttrib1dARB)(GLuint index, GLdouble x); /* 462 */
|
||||
void (GLAPIENTRYP VertexAttrib1dvARB)(GLuint index, const GLdouble * v); /* 463 */
|
||||
void (GLAPIENTRYP VertexAttrib1fARB)(GLuint index, GLfloat x); /* 464 */
|
||||
void (GLAPIENTRYP VertexAttrib1fvARB)(GLuint index, const GLfloat * v); /* 465 */
|
||||
void (GLAPIENTRYP VertexAttrib1sARB)(GLuint index, GLshort x); /* 466 */
|
||||
void (GLAPIENTRYP VertexAttrib1svARB)(GLuint index, const GLshort * v); /* 467 */
|
||||
void (GLAPIENTRYP VertexAttrib2dARB)(GLuint index, GLdouble x, GLdouble y); /* 468 */
|
||||
void (GLAPIENTRYP VertexAttrib2dvARB)(GLuint index, const GLdouble * v); /* 469 */
|
||||
void (GLAPIENTRYP VertexAttrib2fARB)(GLuint index, GLfloat x, GLfloat y); /* 470 */
|
||||
void (GLAPIENTRYP VertexAttrib2fvARB)(GLuint index, const GLfloat * v); /* 471 */
|
||||
void (GLAPIENTRYP VertexAttrib2sARB)(GLuint index, GLshort x, GLshort y); /* 472 */
|
||||
void (GLAPIENTRYP VertexAttrib2svARB)(GLuint index, const GLshort * v); /* 473 */
|
||||
void (GLAPIENTRYP VertexAttrib3dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 474 */
|
||||
void (GLAPIENTRYP VertexAttrib3dvARB)(GLuint index, const GLdouble * v); /* 475 */
|
||||
void (GLAPIENTRYP VertexAttrib3fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 476 */
|
||||
void (GLAPIENTRYP VertexAttrib3fvARB)(GLuint index, const GLfloat * v); /* 477 */
|
||||
void (GLAPIENTRYP VertexAttrib3sARB)(GLuint index, GLshort x, GLshort y, GLshort z); /* 478 */
|
||||
void (GLAPIENTRYP VertexAttrib3svARB)(GLuint index, const GLshort * v); /* 479 */
|
||||
void (GLAPIENTRYP VertexAttrib4NbvARB)(GLuint index, const GLbyte * v); /* 480 */
|
||||
void (GLAPIENTRYP VertexAttrib4NivARB)(GLuint index, const GLint * v); /* 481 */
|
||||
void (GLAPIENTRYP VertexAttrib4NsvARB)(GLuint index, const GLshort * v); /* 482 */
|
||||
void (GLAPIENTRYP VertexAttrib4NubARB)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 483 */
|
||||
void (GLAPIENTRYP VertexAttrib4NubvARB)(GLuint index, const GLubyte * v); /* 484 */
|
||||
void (GLAPIENTRYP VertexAttrib4NuivARB)(GLuint index, const GLuint * v); /* 485 */
|
||||
void (GLAPIENTRYP VertexAttrib4NusvARB)(GLuint index, const GLushort * v); /* 486 */
|
||||
void (GLAPIENTRYP VertexAttrib4bvARB)(GLuint index, const GLbyte * v); /* 487 */
|
||||
void (GLAPIENTRYP VertexAttrib4dARB)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 488 */
|
||||
void (GLAPIENTRYP VertexAttrib4dvARB)(GLuint index, const GLdouble * v); /* 489 */
|
||||
void (GLAPIENTRYP VertexAttrib4fARB)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 490 */
|
||||
void (GLAPIENTRYP VertexAttrib4fvARB)(GLuint index, const GLfloat * v); /* 491 */
|
||||
void (GLAPIENTRYP VertexAttrib4ivARB)(GLuint index, const GLint * v); /* 492 */
|
||||
void (GLAPIENTRYP VertexAttrib4sARB)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 493 */
|
||||
void (GLAPIENTRYP VertexAttrib4svARB)(GLuint index, const GLshort * v); /* 494 */
|
||||
void (GLAPIENTRYP VertexAttrib4ubvARB)(GLuint index, const GLubyte * v); /* 495 */
|
||||
void (GLAPIENTRYP VertexAttrib4uivARB)(GLuint index, const GLuint * v); /* 496 */
|
||||
void (GLAPIENTRYP VertexAttrib4usvARB)(GLuint index, const GLushort * v); /* 497 */
|
||||
void (GLAPIENTRYP VertexAttribPointerARB)(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer); /* 498 */
|
||||
void (GLAPIENTRYP BindBufferARB)(GLenum target, GLuint buffer); /* 499 */
|
||||
void (GLAPIENTRYP BufferDataARB)(GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); /* 500 */
|
||||
void (GLAPIENTRYP BufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); /* 501 */
|
||||
void (GLAPIENTRYP DeleteBuffersARB)(GLsizei n, const GLuint * buffer); /* 502 */
|
||||
void (GLAPIENTRYP GenBuffersARB)(GLsizei n, GLuint * buffer); /* 503 */
|
||||
void (GLAPIENTRYP GetBufferParameterivARB)(GLenum target, GLenum pname, GLint * params); /* 504 */
|
||||
void (GLAPIENTRYP GetBufferPointervARB)(GLenum target, GLenum pname, GLvoid ** params); /* 505 */
|
||||
void (GLAPIENTRYP GetBufferSubDataARB)(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); /* 506 */
|
||||
GLboolean (GLAPIENTRYP IsBufferARB)(GLuint buffer); /* 507 */
|
||||
GLvoid * (GLAPIENTRYP MapBufferARB)(GLenum target, GLenum access); /* 508 */
|
||||
GLboolean (GLAPIENTRYP UnmapBufferARB)(GLenum target); /* 509 */
|
||||
void (GLAPIENTRYP BeginQueryARB)(GLenum target, GLuint id); /* 510 */
|
||||
void (GLAPIENTRYP DeleteQueriesARB)(GLsizei n, const GLuint * ids); /* 511 */
|
||||
void (GLAPIENTRYP EndQueryARB)(GLenum target); /* 512 */
|
||||
void (GLAPIENTRYP GenQueriesARB)(GLsizei n, GLuint * ids); /* 513 */
|
||||
void (GLAPIENTRYP GetQueryObjectivARB)(GLuint id, GLenum pname, GLint * params); /* 514 */
|
||||
void (GLAPIENTRYP GetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint * params); /* 515 */
|
||||
void (GLAPIENTRYP GetQueryivARB)(GLenum target, GLenum pname, GLint * params); /* 516 */
|
||||
GLboolean (GLAPIENTRYP IsQueryARB)(GLuint id); /* 517 */
|
||||
void (GLAPIENTRYP AttachObjectARB)(GLhandleARB containerObj, GLhandleARB obj); /* 518 */
|
||||
void (GLAPIENTRYP CompileShaderARB)(GLhandleARB shader); /* 519 */
|
||||
GLhandleARB (GLAPIENTRYP CreateProgramObjectARB)(void); /* 520 */
|
||||
GLhandleARB (GLAPIENTRYP CreateShaderObjectARB)(GLenum shaderType); /* 521 */
|
||||
void (GLAPIENTRYP DeleteObjectARB)(GLhandleARB obj); /* 522 */
|
||||
void (GLAPIENTRYP DetachObjectARB)(GLhandleARB containerObj, GLhandleARB attachedObj); /* 523 */
|
||||
void (GLAPIENTRYP GetActiveUniformARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 524 */
|
||||
void (GLAPIENTRYP GetAttachedObjectsARB)(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog); /* 525 */
|
||||
GLhandleARB (GLAPIENTRYP GetHandleARB)(GLenum pname); /* 526 */
|
||||
void (GLAPIENTRYP GetInfoLogARB)(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); /* 527 */
|
||||
void (GLAPIENTRYP GetObjectParameterfvARB)(GLhandleARB obj, GLenum pname, GLfloat * params); /* 528 */
|
||||
void (GLAPIENTRYP GetObjectParameterivARB)(GLhandleARB obj, GLenum pname, GLint * params); /* 529 */
|
||||
void (GLAPIENTRYP GetShaderSourceARB)(GLhandleARB shader, GLsizei bufSize, GLsizei * length, GLcharARB * source); /* 530 */
|
||||
GLint (GLAPIENTRYP GetUniformLocationARB)(GLhandleARB program, const GLcharARB * name); /* 531 */
|
||||
void (GLAPIENTRYP GetUniformfvARB)(GLhandleARB program, GLint location, GLfloat * params); /* 532 */
|
||||
void (GLAPIENTRYP GetUniformivARB)(GLhandleARB program, GLint location, GLint * params); /* 533 */
|
||||
void (GLAPIENTRYP LinkProgramARB)(GLhandleARB program); /* 534 */
|
||||
void (GLAPIENTRYP ShaderSourceARB)(GLhandleARB shader, GLsizei count, const GLcharARB ** string, const GLint * length); /* 535 */
|
||||
void (GLAPIENTRYP Uniform1fARB)(GLint location, GLfloat v0); /* 536 */
|
||||
void (GLAPIENTRYP Uniform1fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 537 */
|
||||
void (GLAPIENTRYP Uniform1iARB)(GLint location, GLint v0); /* 538 */
|
||||
void (GLAPIENTRYP Uniform1ivARB)(GLint location, GLsizei count, const GLint * value); /* 539 */
|
||||
void (GLAPIENTRYP Uniform2fARB)(GLint location, GLfloat v0, GLfloat v1); /* 540 */
|
||||
void (GLAPIENTRYP Uniform2fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 541 */
|
||||
void (GLAPIENTRYP Uniform2iARB)(GLint location, GLint v0, GLint v1); /* 542 */
|
||||
void (GLAPIENTRYP Uniform2ivARB)(GLint location, GLsizei count, const GLint * value); /* 543 */
|
||||
void (GLAPIENTRYP Uniform3fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2); /* 544 */
|
||||
void (GLAPIENTRYP Uniform3fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 545 */
|
||||
void (GLAPIENTRYP Uniform3iARB)(GLint location, GLint v0, GLint v1, GLint v2); /* 546 */
|
||||
void (GLAPIENTRYP Uniform3ivARB)(GLint location, GLsizei count, const GLint * value); /* 547 */
|
||||
void (GLAPIENTRYP Uniform4fARB)(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); /* 548 */
|
||||
void (GLAPIENTRYP Uniform4fvARB)(GLint location, GLsizei count, const GLfloat * value); /* 549 */
|
||||
void (GLAPIENTRYP Uniform4iARB)(GLint location, GLint v0, GLint v1, GLint v2, GLint v3); /* 550 */
|
||||
void (GLAPIENTRYP Uniform4ivARB)(GLint location, GLsizei count, const GLint * value); /* 551 */
|
||||
void (GLAPIENTRYP UniformMatrix2fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 552 */
|
||||
void (GLAPIENTRYP UniformMatrix3fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 553 */
|
||||
void (GLAPIENTRYP UniformMatrix4fvARB)(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); /* 554 */
|
||||
void (GLAPIENTRYP UseProgramObjectARB)(GLhandleARB program); /* 555 */
|
||||
void (GLAPIENTRYP ValidateProgramARB)(GLhandleARB program); /* 556 */
|
||||
void (GLAPIENTRYP BindAttribLocationARB)(GLhandleARB program, GLuint index, const GLcharARB * name); /* 557 */
|
||||
void (GLAPIENTRYP GetActiveAttribARB)(GLhandleARB program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLcharARB * name); /* 558 */
|
||||
GLint (GLAPIENTRYP GetAttribLocationARB)(GLhandleARB program, const GLcharARB * name); /* 559 */
|
||||
void (GLAPIENTRYP DrawBuffersARB)(GLsizei n, const GLenum * bufs); /* 560 */
|
||||
void (GLAPIENTRYP PolygonOffsetEXT)(GLfloat factor, GLfloat bias); /* 561 */
|
||||
void (GLAPIENTRYP GetPixelTexGenParameterfvSGIS)(GLenum pname, GLfloat * params); /* 562 */
|
||||
void (GLAPIENTRYP GetPixelTexGenParameterivSGIS)(GLenum pname, GLint * params); /* 563 */
|
||||
void (GLAPIENTRYP PixelTexGenParameterfSGIS)(GLenum pname, GLfloat param); /* 564 */
|
||||
void (GLAPIENTRYP PixelTexGenParameterfvSGIS)(GLenum pname, const GLfloat * params); /* 565 */
|
||||
void (GLAPIENTRYP PixelTexGenParameteriSGIS)(GLenum pname, GLint param); /* 566 */
|
||||
void (GLAPIENTRYP PixelTexGenParameterivSGIS)(GLenum pname, const GLint * params); /* 567 */
|
||||
void (GLAPIENTRYP SampleMaskSGIS)(GLclampf value, GLboolean invert); /* 568 */
|
||||
void (GLAPIENTRYP SamplePatternSGIS)(GLenum pattern); /* 569 */
|
||||
void (GLAPIENTRYP ColorPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 570 */
|
||||
void (GLAPIENTRYP EdgeFlagPointerEXT)(GLsizei stride, GLsizei count, const GLboolean * pointer); /* 571 */
|
||||
void (GLAPIENTRYP IndexPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 572 */
|
||||
void (GLAPIENTRYP NormalPointerEXT)(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 573 */
|
||||
void (GLAPIENTRYP TexCoordPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 574 */
|
||||
void (GLAPIENTRYP VertexPointerEXT)(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer); /* 575 */
|
||||
void (GLAPIENTRYP PointParameterfEXT)(GLenum pname, GLfloat param); /* 576 */
|
||||
void (GLAPIENTRYP PointParameterfvEXT)(GLenum pname, const GLfloat * params); /* 577 */
|
||||
void (GLAPIENTRYP LockArraysEXT)(GLint first, GLsizei count); /* 578 */
|
||||
void (GLAPIENTRYP UnlockArraysEXT)(void); /* 579 */
|
||||
void (GLAPIENTRYP CullParameterdvEXT)(GLenum pname, GLdouble * params); /* 580 */
|
||||
void (GLAPIENTRYP CullParameterfvEXT)(GLenum pname, GLfloat * params); /* 581 */
|
||||
void (GLAPIENTRYP SecondaryColor3bEXT)(GLbyte red, GLbyte green, GLbyte blue); /* 582 */
|
||||
void (GLAPIENTRYP SecondaryColor3bvEXT)(const GLbyte * v); /* 583 */
|
||||
void (GLAPIENTRYP SecondaryColor3dEXT)(GLdouble red, GLdouble green, GLdouble blue); /* 584 */
|
||||
void (GLAPIENTRYP SecondaryColor3dvEXT)(const GLdouble * v); /* 585 */
|
||||
void (GLAPIENTRYP SecondaryColor3fEXT)(GLfloat red, GLfloat green, GLfloat blue); /* 586 */
|
||||
void (GLAPIENTRYP SecondaryColor3fvEXT)(const GLfloat * v); /* 587 */
|
||||
void (GLAPIENTRYP SecondaryColor3iEXT)(GLint red, GLint green, GLint blue); /* 588 */
|
||||
void (GLAPIENTRYP SecondaryColor3ivEXT)(const GLint * v); /* 589 */
|
||||
void (GLAPIENTRYP SecondaryColor3sEXT)(GLshort red, GLshort green, GLshort blue); /* 590 */
|
||||
void (GLAPIENTRYP SecondaryColor3svEXT)(const GLshort * v); /* 591 */
|
||||
void (GLAPIENTRYP SecondaryColor3ubEXT)(GLubyte red, GLubyte green, GLubyte blue); /* 592 */
|
||||
void (GLAPIENTRYP SecondaryColor3ubvEXT)(const GLubyte * v); /* 593 */
|
||||
void (GLAPIENTRYP SecondaryColor3uiEXT)(GLuint red, GLuint green, GLuint blue); /* 594 */
|
||||
void (GLAPIENTRYP SecondaryColor3uivEXT)(const GLuint * v); /* 595 */
|
||||
void (GLAPIENTRYP SecondaryColor3usEXT)(GLushort red, GLushort green, GLushort blue); /* 596 */
|
||||
void (GLAPIENTRYP SecondaryColor3usvEXT)(const GLushort * v); /* 597 */
|
||||
void (GLAPIENTRYP SecondaryColorPointerEXT)(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 598 */
|
||||
void (GLAPIENTRYP MultiDrawArraysEXT)(GLenum mode, GLint * first, GLsizei * count, GLsizei primcount); /* 599 */
|
||||
void (GLAPIENTRYP MultiDrawElementsEXT)(GLenum mode, const GLsizei * count, GLenum type, const GLvoid ** indices, GLsizei primcount); /* 600 */
|
||||
void (GLAPIENTRYP FogCoordPointerEXT)(GLenum type, GLsizei stride, const GLvoid * pointer); /* 601 */
|
||||
void (GLAPIENTRYP FogCoorddEXT)(GLdouble coord); /* 602 */
|
||||
void (GLAPIENTRYP FogCoorddvEXT)(const GLdouble * coord); /* 603 */
|
||||
void (GLAPIENTRYP FogCoordfEXT)(GLfloat coord); /* 604 */
|
||||
void (GLAPIENTRYP FogCoordfvEXT)(const GLfloat * coord); /* 605 */
|
||||
void (GLAPIENTRYP PixelTexGenSGIX)(GLenum mode); /* 606 */
|
||||
void (GLAPIENTRYP BlendFuncSeparateEXT)(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); /* 607 */
|
||||
void (GLAPIENTRYP FlushVertexArrayRangeNV)(void); /* 608 */
|
||||
void (GLAPIENTRYP VertexArrayRangeNV)(GLsizei length, const GLvoid * pointer); /* 609 */
|
||||
void (GLAPIENTRYP CombinerInputNV)(GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 610 */
|
||||
void (GLAPIENTRYP CombinerOutputNV)(GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); /* 611 */
|
||||
void (GLAPIENTRYP CombinerParameterfNV)(GLenum pname, GLfloat param); /* 612 */
|
||||
void (GLAPIENTRYP CombinerParameterfvNV)(GLenum pname, const GLfloat * params); /* 613 */
|
||||
void (GLAPIENTRYP CombinerParameteriNV)(GLenum pname, GLint param); /* 614 */
|
||||
void (GLAPIENTRYP CombinerParameterivNV)(GLenum pname, const GLint * params); /* 615 */
|
||||
void (GLAPIENTRYP FinalCombinerInputNV)(GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); /* 616 */
|
||||
void (GLAPIENTRYP GetCombinerInputParameterfvNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat * params); /* 617 */
|
||||
void (GLAPIENTRYP GetCombinerInputParameterivNV)(GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint * params); /* 618 */
|
||||
void (GLAPIENTRYP GetCombinerOutputParameterfvNV)(GLenum stage, GLenum portion, GLenum pname, GLfloat * params); /* 619 */
|
||||
void (GLAPIENTRYP GetCombinerOutputParameterivNV)(GLenum stage, GLenum portion, GLenum pname, GLint * params); /* 620 */
|
||||
void (GLAPIENTRYP GetFinalCombinerInputParameterfvNV)(GLenum variable, GLenum pname, GLfloat * params); /* 621 */
|
||||
void (GLAPIENTRYP GetFinalCombinerInputParameterivNV)(GLenum variable, GLenum pname, GLint * params); /* 622 */
|
||||
void (GLAPIENTRYP ResizeBuffersMESA)(void); /* 623 */
|
||||
void (GLAPIENTRYP WindowPos2dMESA)(GLdouble x, GLdouble y); /* 624 */
|
||||
void (GLAPIENTRYP WindowPos2dvMESA)(const GLdouble * v); /* 625 */
|
||||
void (GLAPIENTRYP WindowPos2fMESA)(GLfloat x, GLfloat y); /* 626 */
|
||||
void (GLAPIENTRYP WindowPos2fvMESA)(const GLfloat * v); /* 627 */
|
||||
void (GLAPIENTRYP WindowPos2iMESA)(GLint x, GLint y); /* 628 */
|
||||
void (GLAPIENTRYP WindowPos2ivMESA)(const GLint * v); /* 629 */
|
||||
void (GLAPIENTRYP WindowPos2sMESA)(GLshort x, GLshort y); /* 630 */
|
||||
void (GLAPIENTRYP WindowPos2svMESA)(const GLshort * v); /* 631 */
|
||||
void (GLAPIENTRYP WindowPos3dMESA)(GLdouble x, GLdouble y, GLdouble z); /* 632 */
|
||||
void (GLAPIENTRYP WindowPos3dvMESA)(const GLdouble * v); /* 633 */
|
||||
void (GLAPIENTRYP WindowPos3fMESA)(GLfloat x, GLfloat y, GLfloat z); /* 634 */
|
||||
void (GLAPIENTRYP WindowPos3fvMESA)(const GLfloat * v); /* 635 */
|
||||
void (GLAPIENTRYP WindowPos3iMESA)(GLint x, GLint y, GLint z); /* 636 */
|
||||
void (GLAPIENTRYP WindowPos3ivMESA)(const GLint * v); /* 637 */
|
||||
void (GLAPIENTRYP WindowPos3sMESA)(GLshort x, GLshort y, GLshort z); /* 638 */
|
||||
void (GLAPIENTRYP WindowPos3svMESA)(const GLshort * v); /* 639 */
|
||||
void (GLAPIENTRYP WindowPos4dMESA)(GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 640 */
|
||||
void (GLAPIENTRYP WindowPos4dvMESA)(const GLdouble * v); /* 641 */
|
||||
void (GLAPIENTRYP WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 642 */
|
||||
void (GLAPIENTRYP WindowPos4fvMESA)(const GLfloat * v); /* 643 */
|
||||
void (GLAPIENTRYP WindowPos4iMESA)(GLint x, GLint y, GLint z, GLint w); /* 644 */
|
||||
void (GLAPIENTRYP WindowPos4ivMESA)(const GLint * v); /* 645 */
|
||||
void (GLAPIENTRYP WindowPos4sMESA)(GLshort x, GLshort y, GLshort z, GLshort w); /* 646 */
|
||||
void (GLAPIENTRYP WindowPos4svMESA)(const GLshort * v); /* 647 */
|
||||
void (GLAPIENTRYP MultiModeDrawArraysIBM)(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride); /* 648 */
|
||||
void (GLAPIENTRYP MultiModeDrawElementsIBM)(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride); /* 649 */
|
||||
void (GLAPIENTRYP DeleteFencesNV)(GLsizei n, const GLuint * fences); /* 650 */
|
||||
void (GLAPIENTRYP FinishFenceNV)(GLuint fence); /* 651 */
|
||||
void (GLAPIENTRYP GenFencesNV)(GLsizei n, GLuint * fences); /* 652 */
|
||||
void (GLAPIENTRYP GetFenceivNV)(GLuint fence, GLenum pname, GLint * params); /* 653 */
|
||||
GLboolean (GLAPIENTRYP IsFenceNV)(GLuint fence); /* 654 */
|
||||
void (GLAPIENTRYP SetFenceNV)(GLuint fence, GLenum condition); /* 655 */
|
||||
GLboolean (GLAPIENTRYP TestFenceNV)(GLuint fence); /* 656 */
|
||||
GLboolean (GLAPIENTRYP AreProgramsResidentNV)(GLsizei n, const GLuint * ids, GLboolean * residences); /* 657 */
|
||||
void (GLAPIENTRYP BindProgramNV)(GLenum target, GLuint program); /* 658 */
|
||||
void (GLAPIENTRYP DeleteProgramsNV)(GLsizei n, const GLuint * programs); /* 659 */
|
||||
void (GLAPIENTRYP ExecuteProgramNV)(GLenum target, GLuint id, const GLfloat * params); /* 660 */
|
||||
void (GLAPIENTRYP GenProgramsNV)(GLsizei n, GLuint * programs); /* 661 */
|
||||
void (GLAPIENTRYP GetProgramParameterdvNV)(GLenum target, GLuint index, GLenum pname, GLdouble * params); /* 662 */
|
||||
void (GLAPIENTRYP GetProgramParameterfvNV)(GLenum target, GLuint index, GLenum pname, GLfloat * params); /* 663 */
|
||||
void (GLAPIENTRYP GetProgramStringNV)(GLuint id, GLenum pname, GLubyte * program); /* 664 */
|
||||
void (GLAPIENTRYP GetProgramivNV)(GLuint id, GLenum pname, GLint * params); /* 665 */
|
||||
void (GLAPIENTRYP GetTrackMatrixivNV)(GLenum target, GLuint address, GLenum pname, GLint * params); /* 666 */
|
||||
void (GLAPIENTRYP GetVertexAttribPointervNV)(GLuint index, GLenum pname, GLvoid ** params); /* 667 */
|
||||
void (GLAPIENTRYP GetVertexAttribdvNV)(GLuint index, GLenum pname, GLdouble * params); /* 668 */
|
||||
void (GLAPIENTRYP GetVertexAttribfvNV)(GLuint index, GLenum pname, GLfloat * params); /* 669 */
|
||||
void (GLAPIENTRYP GetVertexAttribivNV)(GLuint index, GLenum pname, GLint * params); /* 670 */
|
||||
GLboolean (GLAPIENTRYP IsProgramNV)(GLuint program); /* 671 */
|
||||
void (GLAPIENTRYP LoadProgramNV)(GLenum target, GLuint id, GLsizei len, const GLubyte * program); /* 672 */
|
||||
void (GLAPIENTRYP ProgramParameter4dNV)(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 673 */
|
||||
void (GLAPIENTRYP ProgramParameter4dvNV)(GLenum target, GLuint index, const GLdouble * params); /* 674 */
|
||||
void (GLAPIENTRYP ProgramParameter4fNV)(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 675 */
|
||||
void (GLAPIENTRYP ProgramParameter4fvNV)(GLenum target, GLuint index, const GLfloat * params); /* 676 */
|
||||
void (GLAPIENTRYP ProgramParameters4dvNV)(GLenum target, GLuint index, GLuint num, const GLdouble * params); /* 677 */
|
||||
void (GLAPIENTRYP ProgramParameters4fvNV)(GLenum target, GLuint index, GLuint num, const GLfloat * params); /* 678 */
|
||||
void (GLAPIENTRYP RequestResidentProgramsNV)(GLsizei n, const GLuint * ids); /* 679 */
|
||||
void (GLAPIENTRYP TrackMatrixNV)(GLenum target, GLuint address, GLenum matrix, GLenum transform); /* 680 */
|
||||
void (GLAPIENTRYP VertexAttrib1dNV)(GLuint index, GLdouble x); /* 681 */
|
||||
void (GLAPIENTRYP VertexAttrib1dvNV)(GLuint index, const GLdouble * v); /* 682 */
|
||||
void (GLAPIENTRYP VertexAttrib1fNV)(GLuint index, GLfloat x); /* 683 */
|
||||
void (GLAPIENTRYP VertexAttrib1fvNV)(GLuint index, const GLfloat * v); /* 684 */
|
||||
void (GLAPIENTRYP VertexAttrib1sNV)(GLuint index, GLshort x); /* 685 */
|
||||
void (GLAPIENTRYP VertexAttrib1svNV)(GLuint index, const GLshort * v); /* 686 */
|
||||
void (GLAPIENTRYP VertexAttrib2dNV)(GLuint index, GLdouble x, GLdouble y); /* 687 */
|
||||
void (GLAPIENTRYP VertexAttrib2dvNV)(GLuint index, const GLdouble * v); /* 688 */
|
||||
void (GLAPIENTRYP VertexAttrib2fNV)(GLuint index, GLfloat x, GLfloat y); /* 689 */
|
||||
void (GLAPIENTRYP VertexAttrib2fvNV)(GLuint index, const GLfloat * v); /* 690 */
|
||||
void (GLAPIENTRYP VertexAttrib2sNV)(GLuint index, GLshort x, GLshort y); /* 691 */
|
||||
void (GLAPIENTRYP VertexAttrib2svNV)(GLuint index, const GLshort * v); /* 692 */
|
||||
void (GLAPIENTRYP VertexAttrib3dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z); /* 693 */
|
||||
void (GLAPIENTRYP VertexAttrib3dvNV)(GLuint index, const GLdouble * v); /* 694 */
|
||||
void (GLAPIENTRYP VertexAttrib3fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z); /* 695 */
|
||||
void (GLAPIENTRYP VertexAttrib3fvNV)(GLuint index, const GLfloat * v); /* 696 */
|
||||
void (GLAPIENTRYP VertexAttrib3sNV)(GLuint index, GLshort x, GLshort y, GLshort z); /* 697 */
|
||||
void (GLAPIENTRYP VertexAttrib3svNV)(GLuint index, const GLshort * v); /* 698 */
|
||||
void (GLAPIENTRYP VertexAttrib4dNV)(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 699 */
|
||||
void (GLAPIENTRYP VertexAttrib4dvNV)(GLuint index, const GLdouble * v); /* 700 */
|
||||
void (GLAPIENTRYP VertexAttrib4fNV)(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 701 */
|
||||
void (GLAPIENTRYP VertexAttrib4fvNV)(GLuint index, const GLfloat * v); /* 702 */
|
||||
void (GLAPIENTRYP VertexAttrib4sNV)(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); /* 703 */
|
||||
void (GLAPIENTRYP VertexAttrib4svNV)(GLuint index, const GLshort * v); /* 704 */
|
||||
void (GLAPIENTRYP VertexAttrib4ubNV)(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); /* 705 */
|
||||
void (GLAPIENTRYP VertexAttrib4ubvNV)(GLuint index, const GLubyte * v); /* 706 */
|
||||
void (GLAPIENTRYP VertexAttribPointerNV)(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); /* 707 */
|
||||
void (GLAPIENTRYP VertexAttribs1dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 708 */
|
||||
void (GLAPIENTRYP VertexAttribs1fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 709 */
|
||||
void (GLAPIENTRYP VertexAttribs1svNV)(GLuint index, GLsizei n, const GLshort * v); /* 710 */
|
||||
void (GLAPIENTRYP VertexAttribs2dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 711 */
|
||||
void (GLAPIENTRYP VertexAttribs2fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 712 */
|
||||
void (GLAPIENTRYP VertexAttribs2svNV)(GLuint index, GLsizei n, const GLshort * v); /* 713 */
|
||||
void (GLAPIENTRYP VertexAttribs3dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 714 */
|
||||
void (GLAPIENTRYP VertexAttribs3fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 715 */
|
||||
void (GLAPIENTRYP VertexAttribs3svNV)(GLuint index, GLsizei n, const GLshort * v); /* 716 */
|
||||
void (GLAPIENTRYP VertexAttribs4dvNV)(GLuint index, GLsizei n, const GLdouble * v); /* 717 */
|
||||
void (GLAPIENTRYP VertexAttribs4fvNV)(GLuint index, GLsizei n, const GLfloat * v); /* 718 */
|
||||
void (GLAPIENTRYP VertexAttribs4svNV)(GLuint index, GLsizei n, const GLshort * v); /* 719 */
|
||||
void (GLAPIENTRYP VertexAttribs4ubvNV)(GLuint index, GLsizei n, const GLubyte * v); /* 720 */
|
||||
void (GLAPIENTRYP AlphaFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 721 */
|
||||
void (GLAPIENTRYP AlphaFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 722 */
|
||||
void (GLAPIENTRYP AlphaFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 723 */
|
||||
void (GLAPIENTRYP BeginFragmentShaderATI)(void); /* 724 */
|
||||
void (GLAPIENTRYP BindFragmentShaderATI)(GLuint id); /* 725 */
|
||||
void (GLAPIENTRYP ColorFragmentOp1ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); /* 726 */
|
||||
void (GLAPIENTRYP ColorFragmentOp2ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); /* 727 */
|
||||
void (GLAPIENTRYP ColorFragmentOp3ATI)(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); /* 728 */
|
||||
void (GLAPIENTRYP DeleteFragmentShaderATI)(GLuint id); /* 729 */
|
||||
void (GLAPIENTRYP EndFragmentShaderATI)(void); /* 730 */
|
||||
GLuint (GLAPIENTRYP GenFragmentShadersATI)(GLuint range); /* 731 */
|
||||
void (GLAPIENTRYP PassTexCoordATI)(GLuint dst, GLuint coord, GLenum swizzle); /* 732 */
|
||||
void (GLAPIENTRYP SampleMapATI)(GLuint dst, GLuint interp, GLenum swizzle); /* 733 */
|
||||
void (GLAPIENTRYP SetFragmentShaderConstantATI)(GLuint dst, const GLfloat * value); /* 734 */
|
||||
void (GLAPIENTRYP PointParameteriNV)(GLenum pname, GLint param); /* 735 */
|
||||
void (GLAPIENTRYP PointParameterivNV)(GLenum pname, const GLint * params); /* 736 */
|
||||
void (GLAPIENTRYP ActiveStencilFaceEXT)(GLenum face); /* 737 */
|
||||
void (GLAPIENTRYP BindVertexArrayAPPLE)(GLuint array); /* 738 */
|
||||
void (GLAPIENTRYP DeleteVertexArraysAPPLE)(GLsizei n, const GLuint * arrays); /* 739 */
|
||||
void (GLAPIENTRYP GenVertexArraysAPPLE)(GLsizei n, GLuint * arrays); /* 740 */
|
||||
GLboolean (GLAPIENTRYP IsVertexArrayAPPLE)(GLuint array); /* 741 */
|
||||
void (GLAPIENTRYP GetProgramNamedParameterdvNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble * params); /* 742 */
|
||||
void (GLAPIENTRYP GetProgramNamedParameterfvNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat * params); /* 743 */
|
||||
void (GLAPIENTRYP ProgramNamedParameter4dNV)(GLuint id, GLsizei len, const GLubyte * name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); /* 744 */
|
||||
void (GLAPIENTRYP ProgramNamedParameter4dvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLdouble * v); /* 745 */
|
||||
void (GLAPIENTRYP ProgramNamedParameter4fNV)(GLuint id, GLsizei len, const GLubyte * name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); /* 746 */
|
||||
void (GLAPIENTRYP ProgramNamedParameter4fvNV)(GLuint id, GLsizei len, const GLubyte * name, const GLfloat * v); /* 747 */
|
||||
void (GLAPIENTRYP DepthBoundsEXT)(GLclampd zmin, GLclampd zmax); /* 748 */
|
||||
void (GLAPIENTRYP BlendEquationSeparateEXT)(GLenum modeRGB, GLenum modeA); /* 749 */
|
||||
void (GLAPIENTRYP BindFramebufferEXT)(GLenum target, GLuint framebuffer); /* 750 */
|
||||
void (GLAPIENTRYP BindRenderbufferEXT)(GLenum target, GLuint renderbuffer); /* 751 */
|
||||
GLenum (GLAPIENTRYP CheckFramebufferStatusEXT)(GLenum target); /* 752 */
|
||||
void (GLAPIENTRYP DeleteFramebuffersEXT)(GLsizei n, const GLuint * framebuffers); /* 753 */
|
||||
void (GLAPIENTRYP DeleteRenderbuffersEXT)(GLsizei n, const GLuint * renderbuffers); /* 754 */
|
||||
void (GLAPIENTRYP FramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); /* 755 */
|
||||
void (GLAPIENTRYP FramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 756 */
|
||||
void (GLAPIENTRYP FramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); /* 757 */
|
||||
void (GLAPIENTRYP FramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); /* 758 */
|
||||
void (GLAPIENTRYP GenFramebuffersEXT)(GLsizei n, GLuint * framebuffers); /* 759 */
|
||||
void (GLAPIENTRYP GenRenderbuffersEXT)(GLsizei n, GLuint * renderbuffers); /* 760 */
|
||||
void (GLAPIENTRYP GenerateMipmapEXT)(GLenum target); /* 761 */
|
||||
void (GLAPIENTRYP GetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint * params); /* 762 */
|
||||
void (GLAPIENTRYP GetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint * params); /* 763 */
|
||||
GLboolean (GLAPIENTRYP IsFramebufferEXT)(GLuint framebuffer); /* 764 */
|
||||
GLboolean (GLAPIENTRYP IsRenderbufferEXT)(GLuint renderbuffer); /* 765 */
|
||||
void (GLAPIENTRYP RenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); /* 766 */
|
||||
void (GLAPIENTRYP BlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); /* 767 */
|
||||
void (GLAPIENTRYP ProgramEnvParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 768 */
|
||||
void (GLAPIENTRYP ProgramLocalParameters4fvEXT)(GLenum target, GLuint index, GLsizei count, const GLfloat * params); /* 769 */
|
||||
void (GLAPIENTRYP GetQueryObjecti64vEXT)(GLuint id, GLenum pname, GLint64EXT * params); /* 770 */
|
||||
void (GLAPIENTRYP GetQueryObjectui64vEXT)(GLuint id, GLenum pname, GLuint64EXT * params); /* 771 */
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif /* !defined( _GLAPI_TABLE_H_ ) */
|
||||
|
||||
+2937
-2395
File diff suppressed because it is too large
Load Diff
+1606
-1369
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,8 @@
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 4.1
|
||||
* Version: 6.5.1
|
||||
*
|
||||
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -186,11 +185,23 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
|
||||
*/
|
||||
#ifdef WIN32_THREADS
|
||||
|
||||
void FreeTSD(_glthread_TSD *p)
|
||||
{
|
||||
if (p->initMagic==INIT_MAGIC) {
|
||||
TlsFree(p->key);
|
||||
p->initMagic=0;
|
||||
}
|
||||
}
|
||||
|
||||
void InsteadOf_exit(int nCode)
|
||||
{
|
||||
DWORD dwErr=GetLastError();
|
||||
}
|
||||
|
||||
unsigned long
|
||||
_glthread_GetID(void)
|
||||
{
|
||||
abort(); /* XXX not implemented yet */
|
||||
return (unsigned long) 0;
|
||||
return GetCurrentThreadId();
|
||||
}
|
||||
|
||||
|
||||
@@ -198,11 +209,9 @@ void
|
||||
_glthread_InitTSD(_glthread_TSD *tsd)
|
||||
{
|
||||
tsd->key = TlsAlloc();
|
||||
if (tsd->key == 0xffffffff) {
|
||||
/* Can Windows handle stderr messages for non-console
|
||||
applications? Does Windows have perror? */
|
||||
/* perror(SET_INIT_ERROR);*/
|
||||
exit(-1);
|
||||
if (tsd->key == TLS_OUT_OF_INDEXES) {
|
||||
perror("Mesa:_glthread_InitTSD");
|
||||
InsteadOf_exit(-1);
|
||||
}
|
||||
tsd->initMagic = INIT_MAGIC;
|
||||
}
|
||||
@@ -227,10 +236,8 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
|
||||
_glthread_InitTSD(tsd);
|
||||
}
|
||||
if (TlsSetValue(tsd->key, ptr) == 0) {
|
||||
/* Can Windows handle stderr messages for non-console
|
||||
applications? Does Windows have perror? */
|
||||
/* perror(SET_TSD_ERROR);*/
|
||||
exit(-1);
|
||||
perror("Mesa:_glthread_SetTSD");
|
||||
InsteadOf_exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +249,7 @@ _glthread_SetTSD(_glthread_TSD *tsd, void *ptr)
|
||||
* XFree86 has its own thread wrapper, Xthreads.h
|
||||
* We wrap it again for GL.
|
||||
*/
|
||||
#ifdef XTHREADS
|
||||
#ifdef USE_XTHREADS
|
||||
|
||||
unsigned long
|
||||
_glthread_GetID(void)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.3
|
||||
* Version: 6.5.2
|
||||
*
|
||||
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -64,9 +64,16 @@
|
||||
#define GLTHREAD_H
|
||||
|
||||
|
||||
#if defined(PTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || \
|
||||
defined(XTHREADS) || defined(BEOS_THREADS)
|
||||
#define THREADS
|
||||
#if defined(USE_MGL_NAMESPACE)
|
||||
#define _glapi_Dispatch _mglapi_Dispatch
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\
|
||||
defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \
|
||||
&& !defined(THREADS)
|
||||
# define THREADS
|
||||
#endif
|
||||
|
||||
#ifdef VMS
|
||||
@@ -109,20 +116,6 @@ typedef pthread_mutex_t _glthread_Mutex;
|
||||
#define _glthread_UNLOCK_MUTEX(name) \
|
||||
(void) pthread_mutex_unlock(&(name))
|
||||
|
||||
/* This is temporarilly removed because driver binaries cannot count on
|
||||
* the existance of _gl_DispatchTSD in libGL. It only exists in "new"
|
||||
* libGL. We may be able to ressurect this optimization at some point
|
||||
* for DRI driver or for software Mesa.
|
||||
*/
|
||||
#if 0
|
||||
extern struct _glapi_table * _glapi_DispatchTSD;
|
||||
extern _glthread_TSD _gl_DispatchTSD;
|
||||
|
||||
#define GL_CALL(name) \
|
||||
(((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \
|
||||
? _glapi_DispatchTSD : (struct _glapi_table *) pthread_getspecific(_gl_DispatchTSD.key))-> name)
|
||||
#endif
|
||||
|
||||
#endif /* PTHREADS */
|
||||
|
||||
|
||||
@@ -176,12 +169,11 @@ typedef HANDLE _glthread_Thread;
|
||||
|
||||
typedef CRITICAL_SECTION _glthread_Mutex;
|
||||
|
||||
/* XXX need to really implement mutex-related macros */
|
||||
#define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
|
||||
#define _glthread_INIT_MUTEX(name) (void) name
|
||||
#define _glthread_DESTROY_MUTEX(name) (void) name
|
||||
#define _glthread_LOCK_MUTEX(name) (void) name
|
||||
#define _glthread_UNLOCK_MUTEX(name) (void) name
|
||||
#define _glthread_DECLARE_STATIC_MUTEX(name) /*static*/ _glthread_Mutex name = {0,0,0,0,0,0}
|
||||
#define _glthread_INIT_MUTEX(name) InitializeCriticalSection(&name)
|
||||
#define _glthread_DESTROY_MUTEX(name) DeleteCriticalSection(&name)
|
||||
#define _glthread_LOCK_MUTEX(name) EnterCriticalSection(&name)
|
||||
#define _glthread_UNLOCK_MUTEX(name) LeaveCriticalSection(&name)
|
||||
|
||||
#endif /* WIN32_THREADS */
|
||||
|
||||
@@ -192,7 +184,7 @@ typedef CRITICAL_SECTION _glthread_Mutex;
|
||||
* XFree86 has its own thread wrapper, Xthreads.h
|
||||
* We wrap it again for GL.
|
||||
*/
|
||||
#ifdef XTHREADS
|
||||
#ifdef USE_XTHREADS
|
||||
#include <X11/Xthreads.h>
|
||||
|
||||
typedef struct {
|
||||
@@ -224,7 +216,7 @@ typedef xmutex_rec _glthread_Mutex;
|
||||
#define _glthread_UNLOCK_MUTEX(name) \
|
||||
(void) xmutex_unlock(&(name))
|
||||
|
||||
#endif /* XTHREADS */
|
||||
#endif /* USE_XTHREADS */
|
||||
|
||||
|
||||
|
||||
@@ -306,14 +298,20 @@ _glthread_GetTSD(_glthread_TSD *);
|
||||
extern void
|
||||
_glthread_SetTSD(_glthread_TSD *, void *);
|
||||
|
||||
#ifndef GL_CALL
|
||||
#if defined(GLX_USE_TLS)
|
||||
|
||||
extern __thread struct _glapi_table * _glapi_tls_Dispatch
|
||||
__attribute__((tls_model("initial-exec")));
|
||||
|
||||
#define GET_DISPATCH() _glapi_tls_Dispatch
|
||||
|
||||
#elif !defined(GL_CALL)
|
||||
# if defined(THREADS)
|
||||
extern struct _glapi_table * _glapi_DispatchTSD;
|
||||
# define GL_CALL(name) \
|
||||
(((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \
|
||||
? _glapi_DispatchTSD : _glapi_get_dispatch())-> name)
|
||||
# define GET_DISPATCH() \
|
||||
((__builtin_expect( _glapi_Dispatch != NULL, 1 )) \
|
||||
? _glapi_Dispatch : _glapi_get_dispatch())
|
||||
# else
|
||||
# define GL_CALL(name) (*(_glapi_Dispatch-> name))
|
||||
# define GET_DISPATCH() _glapi_Dispatch
|
||||
# endif /* defined(THREADS) */
|
||||
#endif /* ndef GL_CALL */
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
# (C) Copyright IBM Corporation 2004
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
bsd_license_template = """%s
|
||||
All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sub license,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice (including the next
|
||||
paragraph) shall be included in all copies or substantial portions of the
|
||||
Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
%s,
|
||||
AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE."""
|
||||
@@ -1,223 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# $Id: mesadef.py,v 1.2 2004/05/10 07:42:27 dborca Exp $
|
||||
|
||||
# Mesa 3-D graphics library
|
||||
# Version: 4.1
|
||||
#
|
||||
# Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
# Generate the mesa.def file for Windows.
|
||||
#
|
||||
# Usage:
|
||||
# mesadef.py >mesa.def
|
||||
# Then copy to src/mesa/drivers/windows/gdi
|
||||
#
|
||||
# Dependencies:
|
||||
# The apispec file must be in the current directory.
|
||||
|
||||
|
||||
|
||||
import apiparser
|
||||
import string
|
||||
|
||||
|
||||
def PrintHead():
|
||||
print '; DO NOT EDIT - This file generated automatically by mesadef.py script'
|
||||
print 'DESCRIPTION \'Mesa (OpenGL work-alike) for Win32\''
|
||||
print 'VERSION 6.0'
|
||||
print ';'
|
||||
print '; Module definition file for Mesa (OPENGL32.DLL)'
|
||||
print ';'
|
||||
print '; Note: The OpenGL functions use the STDCALL'
|
||||
print '; function calling convention. Microsoft\'s'
|
||||
print '; OPENGL32 uses this convention and so must the'
|
||||
print '; Mesa OPENGL32 so that the Mesa DLL can be used'
|
||||
print '; as a drop-in replacement.'
|
||||
print ';'
|
||||
print '; The linker exports STDCALL entry points with'
|
||||
print '; \'decorated\' names; e.g., _glBegin@0, where the'
|
||||
print '; trailing number is the number of bytes of '
|
||||
print '; parameter data pushed onto the stack. The'
|
||||
print '; callee is responsible for popping this data'
|
||||
print '; off the stack, usually via a RETF n instruction.'
|
||||
print ';'
|
||||
print '; However, the Microsoft OPENGL32.DLL does not export'
|
||||
print '; the decorated names, even though the calling convention'
|
||||
print '; is STDCALL. So, this module definition file is'
|
||||
print '; needed to force the Mesa OPENGL32.DLL to export the'
|
||||
print '; symbols in the same manner as the Microsoft DLL.'
|
||||
print '; Were it not for this problem, this file would not'
|
||||
print '; be needed (for the gl* functions) since the entry'
|
||||
print '; points are compiled with dllexport declspec.'
|
||||
print ';'
|
||||
print '; However, this file is still needed to export "internal"'
|
||||
print '; Mesa symbols for the benefit of the OSMESA32.DLL.'
|
||||
print ';'
|
||||
print 'EXPORTS'
|
||||
return
|
||||
#enddef
|
||||
|
||||
|
||||
def PrintTail():
|
||||
print ';'
|
||||
print '; WGL API'
|
||||
print '\twglChoosePixelFormat'
|
||||
print '\twglCopyContext'
|
||||
print '\twglCreateContext'
|
||||
print '\twglCreateLayerContext'
|
||||
print '\twglDeleteContext'
|
||||
print '\twglDescribeLayerPlane'
|
||||
print '\twglDescribePixelFormat'
|
||||
print '\twglGetCurrentContext'
|
||||
print '\twglGetCurrentDC'
|
||||
print '\twglGetLayerPaletteEntries'
|
||||
print '\twglGetPixelFormat'
|
||||
print '\twglGetProcAddress'
|
||||
print '\twglMakeCurrent'
|
||||
print '\twglRealizeLayerPalette'
|
||||
print '\twglSetLayerPaletteEntries'
|
||||
print '\twglSetPixelFormat'
|
||||
print '\twglShareLists'
|
||||
print '\twglSwapBuffers'
|
||||
print '\twglSwapLayerBuffers'
|
||||
print '\twglUseFontBitmapsA'
|
||||
print '\twglUseFontBitmapsW'
|
||||
print '\twglUseFontOutlinesA'
|
||||
print '\twglUseFontOutlinesW'
|
||||
print ';'
|
||||
print '; Mesa internals - mostly for OSMESA'
|
||||
print '\t_ac_CreateContext'
|
||||
print '\t_ac_DestroyContext'
|
||||
print '\t_ac_InvalidateState'
|
||||
print '\t_glapi_get_context'
|
||||
print '\t_glapi_get_proc_address'
|
||||
print '\t_mesa_buffer_data'
|
||||
print '\t_mesa_buffer_map'
|
||||
print '\t_mesa_buffer_subdata'
|
||||
print '\t_mesa_bzero'
|
||||
print '\t_mesa_calloc'
|
||||
print '\t_mesa_choose_tex_format'
|
||||
print '\t_mesa_compressed_texture_size'
|
||||
print '\t_mesa_create_framebuffer'
|
||||
print '\t_mesa_create_visual'
|
||||
print '\t_mesa_delete_buffer_object'
|
||||
print '\t_mesa_delete_texture_object'
|
||||
print '\t_mesa_destroy_framebuffer'
|
||||
print '\t_mesa_destroy_visual'
|
||||
print '\t_mesa_enable_1_3_extensions'
|
||||
print '\t_mesa_enable_1_4_extensions'
|
||||
print '\t_mesa_enable_1_5_extensions'
|
||||
print '\t_mesa_enable_sw_extensions'
|
||||
print '\t_mesa_error'
|
||||
print '\t_mesa_free'
|
||||
print '\t_mesa_free_context_data'
|
||||
print '\t_mesa_get_current_context'
|
||||
print '\t_mesa_init_default_imports'
|
||||
print '\t_mesa_initialize_context'
|
||||
print '\t_mesa_make_current'
|
||||
print '\t_mesa_memcpy'
|
||||
print '\t_mesa_memset'
|
||||
print '\t_mesa_new_buffer_object'
|
||||
print '\t_mesa_new_texture_object'
|
||||
print '\t_mesa_problem'
|
||||
print '\t_mesa_ResizeBuffersMESA'
|
||||
print '\t_mesa_store_compressed_teximage1d'
|
||||
print '\t_mesa_store_compressed_teximage2d'
|
||||
print '\t_mesa_store_compressed_teximage3d'
|
||||
print '\t_mesa_store_compressed_texsubimage1d'
|
||||
print '\t_mesa_store_compressed_texsubimage2d'
|
||||
print '\t_mesa_store_compressed_texsubimage3d'
|
||||
print '\t_mesa_store_teximage1d'
|
||||
print '\t_mesa_store_teximage2d'
|
||||
print '\t_mesa_store_teximage3d'
|
||||
print '\t_mesa_store_texsubimage1d'
|
||||
print '\t_mesa_store_texsubimage2d'
|
||||
print '\t_mesa_store_texsubimage3d'
|
||||
print '\t_mesa_strcmp'
|
||||
print '\t_mesa_test_proxy_teximage'
|
||||
print '\t_mesa_Viewport'
|
||||
print '\t_swrast_Accum'
|
||||
print '\t_swrast_alloc_buffers'
|
||||
print '\t_swrast_Bitmap'
|
||||
print '\t_swrast_CopyPixels'
|
||||
print '\t_swrast_DrawBuffer'
|
||||
print '\t_swrast_DrawPixels'
|
||||
print '\t_swrast_GetDeviceDriverReference'
|
||||
print '\t_swrast_Clear'
|
||||
print '\t_swrast_choose_line'
|
||||
print '\t_swrast_choose_triangle'
|
||||
print '\t_swrast_CopyColorSubTable'
|
||||
print '\t_swrast_CopyColorTable'
|
||||
print '\t_swrast_CopyConvolutionFilter1D'
|
||||
print '\t_swrast_CopyConvolutionFilter2D'
|
||||
print '\t_swrast_copy_teximage1d'
|
||||
print '\t_swrast_copy_teximage2d'
|
||||
print '\t_swrast_copy_texsubimage1d'
|
||||
print '\t_swrast_copy_texsubimage2d'
|
||||
print '\t_swrast_copy_texsubimage3d'
|
||||
print '\t_swrast_CreateContext'
|
||||
print '\t_swrast_DestroyContext'
|
||||
print '\t_swrast_InvalidateState'
|
||||
print '\t_swrast_ReadPixels'
|
||||
print '\t_swrast_zbuffer_address'
|
||||
print '\t_swsetup_Wakeup'
|
||||
print '\t_swsetup_CreateContext'
|
||||
print '\t_swsetup_DestroyContext'
|
||||
print '\t_swsetup_InvalidateState'
|
||||
print '\t_tnl_CreateContext'
|
||||
print '\t_tnl_DestroyContext'
|
||||
print '\t_tnl_InvalidateState'
|
||||
print '\t_tnl_MakeCurrent'
|
||||
print '\t_tnl_run_pipeline'
|
||||
#enddef
|
||||
|
||||
|
||||
records = []
|
||||
|
||||
def FindOffset(funcName):
|
||||
for (name, alias, offset) in records:
|
||||
if name == funcName:
|
||||
return offset
|
||||
#endif
|
||||
#endfor
|
||||
return -1
|
||||
#enddef
|
||||
|
||||
|
||||
def EmitEntry(name, returnType, argTypeList, argNameList, alias, offset):
|
||||
if alias == '':
|
||||
dispatchName = name
|
||||
else:
|
||||
dispatchName = alias
|
||||
if offset < 0:
|
||||
offset = FindOffset(dispatchName)
|
||||
if offset >= 0 and string.find(name, "unused") == -1:
|
||||
print '\tgl%s' % (name)
|
||||
# save this info in case we need to look up an alias later
|
||||
records.append((name, dispatchName, offset))
|
||||
|
||||
#enddef
|
||||
|
||||
|
||||
PrintHead()
|
||||
apiparser.ProcessSpecFile("APIspec", EmitEntry)
|
||||
PrintTail()
|
||||
@@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# (C) Copyright IBM Corporation 2004
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
# license, and/or sell copies of the Software, and to permit persons to whom
|
||||
# the Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice (including the next
|
||||
# paragraph) shall be included in all copies or substantial portions of the
|
||||
# Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
#
|
||||
# Authors:
|
||||
# Ian Romanick <[email protected]>
|
||||
|
||||
# Trivial shell script to search the API definition file and print out the
|
||||
# next numerically available API entry-point offset. This could probably
|
||||
# be made smarter, but it would be better to use the existin Python
|
||||
# framework to do that. This is just a quick-and-dirty hack.
|
||||
|
||||
num=$(grep 'offset="' gl_API.xml |\
|
||||
sed 's/.\+ offset="//g;s/".*$//g' |\
|
||||
grep -v '?' |\
|
||||
sort -rn |\
|
||||
head -1)
|
||||
|
||||
echo $((num + 1))
|
||||
@@ -1,21 +0,0 @@
|
||||
|
||||
|
||||
Performance issues with EXT_point_parameters & quake2
|
||||
|
||||
|
||||
|
||||
Using glPolygonMode() where the front and back modes aren't the
|
||||
same causes poor performance on 3Dfx.
|
||||
|
||||
|
||||
|
||||
Broken drivers: some of the Mesa device drivers (such as BeOS, D3D,
|
||||
etc) haven't been updated for Mesa 3.3's device driver changes.
|
||||
|
||||
|
||||
|
||||
glDrawRangeElements() should use vertex array locking to improve performance
|
||||
but trying to do so causes a rendering error. Reported by Scott McMillan.
|
||||
Fixed by disabling locking in glDrawRangeElements (varray.c) but that's
|
||||
really just hiding a bug in array locking.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 5.1
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -55,40 +55,51 @@ void GLAPIENTRY
|
||||
_mesa_Accum( GLenum op, GLfloat value )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLuint xpos, ypos, width, height;
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
||||
|
||||
if (ctx->Visual.accumRedBits == 0 || ctx->DrawBuffer != ctx->ReadBuffer) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glAccum");
|
||||
switch (op) {
|
||||
case GL_ADD:
|
||||
case GL_MULT:
|
||||
case GL_ACCUM:
|
||||
case GL_LOAD:
|
||||
case GL_RETURN:
|
||||
/* OK */
|
||||
break;
|
||||
default:
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glAccum(op)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->DrawBuffer->Visual.haveAccumBuffer == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glAccum(no accum buffer)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->DrawBuffer != ctx->ReadBuffer) {
|
||||
/* See GLX_SGI_make_current_read or WGL_ARB_make_current_read,
|
||||
* or GL_EXT_framebuffer_blit.
|
||||
*/
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glAccum(different read/draw buffers)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->NewState)
|
||||
_mesa_update_state( ctx );
|
||||
_mesa_update_state(ctx);
|
||||
|
||||
if (ctx->RenderMode != GL_RENDER) {
|
||||
/* no-op */
|
||||
if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
||||
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
|
||||
"glAccum(incomplete framebuffer)");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Determine region to operate upon. */
|
||||
if (ctx->Scissor.Enabled) {
|
||||
xpos = ctx->Scissor.X;
|
||||
ypos = ctx->Scissor.Y;
|
||||
width = ctx->Scissor.Width;
|
||||
height = ctx->Scissor.Height;
|
||||
if (ctx->RenderMode == GL_RENDER) {
|
||||
ctx->Driver.Accum(ctx, op, value);
|
||||
}
|
||||
else {
|
||||
/* whole window */
|
||||
xpos = 0;
|
||||
ypos = 0;
|
||||
width = ctx->DrawBuffer->Width;
|
||||
height = ctx->DrawBuffer->Height;
|
||||
}
|
||||
|
||||
ctx->Driver.Accum( ctx, op, value, xpos, ypos, width, height );
|
||||
}
|
||||
|
||||
|
||||
|
||||
void
|
||||
_mesa_init_accum( GLcontext *ctx )
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,4 +34,9 @@ extern void _ae_destroy_context( GLcontext *ctx );
|
||||
extern void _ae_invalidate_state( GLcontext *ctx, GLuint new_state );
|
||||
extern void GLAPIENTRY _ae_loopback_array_elt( GLint elt );
|
||||
|
||||
/* May optionally be called before a batch of element calls:
|
||||
*/
|
||||
extern void _ae_map_vbos( GLcontext *ctx );
|
||||
extern void _ae_unmap_vbos( GLcontext *ctx );
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
#include "colormac.h"
|
||||
#include "api_loopback.h"
|
||||
#include "glthread.h"
|
||||
#include "mtypes.h"
|
||||
#include "dispatch.h"
|
||||
|
||||
/* KW: A set of functions to convert unusual Color/Normal/Vertex/etc
|
||||
* calls to a smaller set of driver-provided formats. Currently just
|
||||
@@ -46,35 +48,35 @@
|
||||
* listed in dd.h. The easiest way for a driver to do this is to
|
||||
* install the supplied software t&l module.
|
||||
*/
|
||||
#define COLORF(r,g,b,a) GL_CALL(Color4f)(r,g,b,a)
|
||||
#define VERTEX2(x,y) GL_CALL(Vertex2f)(x,y)
|
||||
#define VERTEX3(x,y,z) GL_CALL(Vertex3f)(x,y,z)
|
||||
#define VERTEX4(x,y,z,w) GL_CALL(Vertex4f)(x,y,z,w)
|
||||
#define NORMAL(x,y,z) GL_CALL(Normal3f)(x,y,z)
|
||||
#define TEXCOORD1(s) GL_CALL(TexCoord1f)(s)
|
||||
#define TEXCOORD2(s,t) GL_CALL(TexCoord2f)(s,t)
|
||||
#define TEXCOORD3(s,t,u) GL_CALL(TexCoord3f)(s,t,u)
|
||||
#define TEXCOORD4(s,t,u,v) GL_CALL(TexCoord4f)(s,t,u,v)
|
||||
#define INDEX(c) GL_CALL(Indexf)(c)
|
||||
#define MULTI_TEXCOORD1(z,s) GL_CALL(MultiTexCoord1fARB)(z,s)
|
||||
#define MULTI_TEXCOORD2(z,s,t) GL_CALL(MultiTexCoord2fARB)(z,s,t)
|
||||
#define MULTI_TEXCOORD3(z,s,t,u) GL_CALL(MultiTexCoord3fARB)(z,s,t,u)
|
||||
#define MULTI_TEXCOORD4(z,s,t,u,v) GL_CALL(MultiTexCoord4fARB)(z,s,t,u,v)
|
||||
#define EVALCOORD1(x) GL_CALL(EvalCoord1f)(x)
|
||||
#define EVALCOORD2(x,y) GL_CALL(EvalCoord2f)(x,y)
|
||||
#define MATERIALFV(a,b,c) GL_CALL(Materialfv)(a,b,c)
|
||||
#define RECTF(a,b,c,d) GL_CALL(Rectf)(a,b,c,d)
|
||||
#define COLORF(r,g,b,a) CALL_Color4f(GET_DISPATCH(), (r,g,b,a))
|
||||
#define VERTEX2(x,y) CALL_Vertex2f(GET_DISPATCH(), (x,y))
|
||||
#define VERTEX3(x,y,z) CALL_Vertex3f(GET_DISPATCH(), (x,y,z))
|
||||
#define VERTEX4(x,y,z,w) CALL_Vertex4f(GET_DISPATCH(), (x,y,z,w))
|
||||
#define NORMAL(x,y,z) CALL_Normal3f(GET_DISPATCH(), (x,y,z))
|
||||
#define TEXCOORD1(s) CALL_TexCoord1f(GET_DISPATCH(), (s))
|
||||
#define TEXCOORD2(s,t) CALL_TexCoord2f(GET_DISPATCH(), (s,t))
|
||||
#define TEXCOORD3(s,t,u) CALL_TexCoord3f(GET_DISPATCH(), (s,t,u))
|
||||
#define TEXCOORD4(s,t,u,v) CALL_TexCoord4f(GET_DISPATCH(), (s,t,u,v))
|
||||
#define INDEX(c) CALL_Indexf(GET_DISPATCH(), (c))
|
||||
#define MULTI_TEXCOORD1(z,s) CALL_MultiTexCoord1fARB(GET_DISPATCH(), (z,s))
|
||||
#define MULTI_TEXCOORD2(z,s,t) CALL_MultiTexCoord2fARB(GET_DISPATCH(), (z,s,t))
|
||||
#define MULTI_TEXCOORD3(z,s,t,u) CALL_MultiTexCoord3fARB(GET_DISPATCH(), (z,s,t,u))
|
||||
#define MULTI_TEXCOORD4(z,s,t,u,v) CALL_MultiTexCoord4fARB(GET_DISPATCH(), (z,s,t,u,v))
|
||||
#define EVALCOORD1(x) CALL_EvalCoord1f(GET_DISPATCH(), (x))
|
||||
#define EVALCOORD2(x,y) CALL_EvalCoord2f(GET_DISPATCH(), (x,y))
|
||||
#define MATERIALFV(a,b,c) CALL_Materialfv(GET_DISPATCH(), (a,b,c))
|
||||
#define RECTF(a,b,c,d) CALL_Rectf(GET_DISPATCH(), (a,b,c,d))
|
||||
|
||||
#define ATTRIB1NV(index,x) GL_CALL(VertexAttrib1fNV)(index,x)
|
||||
#define ATTRIB2NV(index,x,y) GL_CALL(VertexAttrib2fNV)(index,x,y)
|
||||
#define ATTRIB3NV(index,x,y,z) GL_CALL(VertexAttrib3fNV)(index,x,y,z)
|
||||
#define ATTRIB4NV(index,x,y,z,w) GL_CALL(VertexAttrib4fNV)(index,x,y,z,w)
|
||||
#define ATTRIB1ARB(index,x) GL_CALL(VertexAttrib1fARB)(index,x)
|
||||
#define ATTRIB2ARB(index,x,y) GL_CALL(VertexAttrib2fARB)(index,x,y)
|
||||
#define ATTRIB3ARB(index,x,y,z) GL_CALL(VertexAttrib3fARB)(index,x,y,z)
|
||||
#define ATTRIB4ARB(index,x,y,z,w) GL_CALL(VertexAttrib4fARB)(index,x,y,z,w)
|
||||
#define FOGCOORDF(x) GL_CALL(FogCoordfEXT)(x)
|
||||
#define SECONDARYCOLORF(a,b,c) GL_CALL(SecondaryColor3fEXT)(a,b,c)
|
||||
#define ATTRIB1NV(index,x) CALL_VertexAttrib1fNV(GET_DISPATCH(), (index,x))
|
||||
#define ATTRIB2NV(index,x,y) CALL_VertexAttrib2fNV(GET_DISPATCH(), (index,x,y))
|
||||
#define ATTRIB3NV(index,x,y,z) CALL_VertexAttrib3fNV(GET_DISPATCH(), (index,x,y,z))
|
||||
#define ATTRIB4NV(index,x,y,z,w) CALL_VertexAttrib4fNV(GET_DISPATCH(), (index,x,y,z,w))
|
||||
#define ATTRIB1ARB(index,x) CALL_VertexAttrib1fARB(GET_DISPATCH(), (index,x))
|
||||
#define ATTRIB2ARB(index,x,y) CALL_VertexAttrib2fARB(GET_DISPATCH(), (index,x,y))
|
||||
#define ATTRIB3ARB(index,x,y,z) CALL_VertexAttrib3fARB(GET_DISPATCH(), (index,x,y,z))
|
||||
#define ATTRIB4ARB(index,x,y,z,w) CALL_VertexAttrib4fARB(GET_DISPATCH(), (index,x,y,z,w))
|
||||
#define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x))
|
||||
#define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c))
|
||||
|
||||
static void GLAPIENTRY
|
||||
loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue )
|
||||
@@ -279,6 +281,7 @@ loopback_Color4ubv_f( const GLubyte *v)
|
||||
UBYTE_TO_FLOAT(v[2]), UBYTE_TO_FLOAT(v[3]) );
|
||||
}
|
||||
|
||||
|
||||
static void GLAPIENTRY
|
||||
loopback_FogCoorddEXT( GLdouble d )
|
||||
{
|
||||
@@ -340,6 +343,14 @@ loopback_Indexubv( const GLubyte *c )
|
||||
INDEX( (GLfloat) *c );
|
||||
}
|
||||
|
||||
|
||||
static void GLAPIENTRY
|
||||
loopback_EdgeFlagv(const GLboolean *flag)
|
||||
{
|
||||
CALL_EdgeFlag(GET_DISPATCH(), (*flag));
|
||||
}
|
||||
|
||||
|
||||
static void GLAPIENTRY
|
||||
loopback_Normal3b( GLbyte nx, GLbyte ny, GLbyte nz )
|
||||
{
|
||||
@@ -499,7 +510,7 @@ loopback_TexCoord2sv( const GLshort *v )
|
||||
static void GLAPIENTRY
|
||||
loopback_TexCoord3dv( const GLdouble *v )
|
||||
{
|
||||
TEXCOORD2((GLfloat) v[0],(GLfloat) v[1]);
|
||||
TEXCOORD3((GLfloat) v[0],(GLfloat) v[1],(GLfloat) v[2]);
|
||||
}
|
||||
|
||||
static void GLAPIENTRY
|
||||
@@ -1437,209 +1448,211 @@ loopback_VertexAttrib4NuivARB(GLuint index, const GLuint * v)
|
||||
void
|
||||
_mesa_loopback_init_api_table( struct _glapi_table *dest )
|
||||
{
|
||||
dest->Color3b = loopback_Color3b_f;
|
||||
dest->Color3d = loopback_Color3d_f;
|
||||
dest->Color3i = loopback_Color3i_f;
|
||||
dest->Color3s = loopback_Color3s_f;
|
||||
dest->Color3ui = loopback_Color3ui_f;
|
||||
dest->Color3us = loopback_Color3us_f;
|
||||
dest->Color3ub = loopback_Color3ub_f;
|
||||
dest->Color4b = loopback_Color4b_f;
|
||||
dest->Color4d = loopback_Color4d_f;
|
||||
dest->Color4i = loopback_Color4i_f;
|
||||
dest->Color4s = loopback_Color4s_f;
|
||||
dest->Color4ui = loopback_Color4ui_f;
|
||||
dest->Color4us = loopback_Color4us_f;
|
||||
dest->Color4ub = loopback_Color4ub_f;
|
||||
dest->Color3bv = loopback_Color3bv_f;
|
||||
dest->Color3dv = loopback_Color3dv_f;
|
||||
dest->Color3iv = loopback_Color3iv_f;
|
||||
dest->Color3sv = loopback_Color3sv_f;
|
||||
dest->Color3uiv = loopback_Color3uiv_f;
|
||||
dest->Color3usv = loopback_Color3usv_f;
|
||||
dest->Color3ubv = loopback_Color3ubv_f;
|
||||
dest->Color4bv = loopback_Color4bv_f;
|
||||
dest->Color4dv = loopback_Color4dv_f;
|
||||
dest->Color4iv = loopback_Color4iv_f;
|
||||
dest->Color4sv = loopback_Color4sv_f;
|
||||
dest->Color4uiv = loopback_Color4uiv_f;
|
||||
dest->Color4usv = loopback_Color4usv_f;
|
||||
dest->Color4ubv = loopback_Color4ubv_f;
|
||||
SET_Color3b(dest, loopback_Color3b_f);
|
||||
SET_Color3d(dest, loopback_Color3d_f);
|
||||
SET_Color3i(dest, loopback_Color3i_f);
|
||||
SET_Color3s(dest, loopback_Color3s_f);
|
||||
SET_Color3ui(dest, loopback_Color3ui_f);
|
||||
SET_Color3us(dest, loopback_Color3us_f);
|
||||
SET_Color3ub(dest, loopback_Color3ub_f);
|
||||
SET_Color4b(dest, loopback_Color4b_f);
|
||||
SET_Color4d(dest, loopback_Color4d_f);
|
||||
SET_Color4i(dest, loopback_Color4i_f);
|
||||
SET_Color4s(dest, loopback_Color4s_f);
|
||||
SET_Color4ui(dest, loopback_Color4ui_f);
|
||||
SET_Color4us(dest, loopback_Color4us_f);
|
||||
SET_Color4ub(dest, loopback_Color4ub_f);
|
||||
SET_Color3bv(dest, loopback_Color3bv_f);
|
||||
SET_Color3dv(dest, loopback_Color3dv_f);
|
||||
SET_Color3iv(dest, loopback_Color3iv_f);
|
||||
SET_Color3sv(dest, loopback_Color3sv_f);
|
||||
SET_Color3uiv(dest, loopback_Color3uiv_f);
|
||||
SET_Color3usv(dest, loopback_Color3usv_f);
|
||||
SET_Color3ubv(dest, loopback_Color3ubv_f);
|
||||
SET_Color4bv(dest, loopback_Color4bv_f);
|
||||
SET_Color4dv(dest, loopback_Color4dv_f);
|
||||
SET_Color4iv(dest, loopback_Color4iv_f);
|
||||
SET_Color4sv(dest, loopback_Color4sv_f);
|
||||
SET_Color4uiv(dest, loopback_Color4uiv_f);
|
||||
SET_Color4usv(dest, loopback_Color4usv_f);
|
||||
SET_Color4ubv(dest, loopback_Color4ubv_f);
|
||||
|
||||
dest->SecondaryColor3bEXT = loopback_SecondaryColor3bEXT_f;
|
||||
dest->SecondaryColor3dEXT = loopback_SecondaryColor3dEXT_f;
|
||||
dest->SecondaryColor3iEXT = loopback_SecondaryColor3iEXT_f;
|
||||
dest->SecondaryColor3sEXT = loopback_SecondaryColor3sEXT_f;
|
||||
dest->SecondaryColor3uiEXT = loopback_SecondaryColor3uiEXT_f;
|
||||
dest->SecondaryColor3usEXT = loopback_SecondaryColor3usEXT_f;
|
||||
dest->SecondaryColor3ubEXT = loopback_SecondaryColor3ubEXT_f;
|
||||
dest->SecondaryColor3bvEXT = loopback_SecondaryColor3bvEXT_f;
|
||||
dest->SecondaryColor3dvEXT = loopback_SecondaryColor3dvEXT_f;
|
||||
dest->SecondaryColor3ivEXT = loopback_SecondaryColor3ivEXT_f;
|
||||
dest->SecondaryColor3svEXT = loopback_SecondaryColor3svEXT_f;
|
||||
dest->SecondaryColor3uivEXT = loopback_SecondaryColor3uivEXT_f;
|
||||
dest->SecondaryColor3usvEXT = loopback_SecondaryColor3usvEXT_f;
|
||||
dest->SecondaryColor3ubvEXT = loopback_SecondaryColor3ubvEXT_f;
|
||||
SET_SecondaryColor3bEXT(dest, loopback_SecondaryColor3bEXT_f);
|
||||
SET_SecondaryColor3dEXT(dest, loopback_SecondaryColor3dEXT_f);
|
||||
SET_SecondaryColor3iEXT(dest, loopback_SecondaryColor3iEXT_f);
|
||||
SET_SecondaryColor3sEXT(dest, loopback_SecondaryColor3sEXT_f);
|
||||
SET_SecondaryColor3uiEXT(dest, loopback_SecondaryColor3uiEXT_f);
|
||||
SET_SecondaryColor3usEXT(dest, loopback_SecondaryColor3usEXT_f);
|
||||
SET_SecondaryColor3ubEXT(dest, loopback_SecondaryColor3ubEXT_f);
|
||||
SET_SecondaryColor3bvEXT(dest, loopback_SecondaryColor3bvEXT_f);
|
||||
SET_SecondaryColor3dvEXT(dest, loopback_SecondaryColor3dvEXT_f);
|
||||
SET_SecondaryColor3ivEXT(dest, loopback_SecondaryColor3ivEXT_f);
|
||||
SET_SecondaryColor3svEXT(dest, loopback_SecondaryColor3svEXT_f);
|
||||
SET_SecondaryColor3uivEXT(dest, loopback_SecondaryColor3uivEXT_f);
|
||||
SET_SecondaryColor3usvEXT(dest, loopback_SecondaryColor3usvEXT_f);
|
||||
SET_SecondaryColor3ubvEXT(dest, loopback_SecondaryColor3ubvEXT_f);
|
||||
|
||||
dest->Indexd = loopback_Indexd;
|
||||
dest->Indexi = loopback_Indexi;
|
||||
dest->Indexs = loopback_Indexs;
|
||||
dest->Indexub = loopback_Indexub;
|
||||
dest->Indexdv = loopback_Indexdv;
|
||||
dest->Indexiv = loopback_Indexiv;
|
||||
dest->Indexsv = loopback_Indexsv;
|
||||
dest->Indexubv = loopback_Indexubv;
|
||||
dest->Normal3b = loopback_Normal3b;
|
||||
dest->Normal3d = loopback_Normal3d;
|
||||
dest->Normal3i = loopback_Normal3i;
|
||||
dest->Normal3s = loopback_Normal3s;
|
||||
dest->Normal3bv = loopback_Normal3bv;
|
||||
dest->Normal3dv = loopback_Normal3dv;
|
||||
dest->Normal3iv = loopback_Normal3iv;
|
||||
dest->Normal3sv = loopback_Normal3sv;
|
||||
dest->TexCoord1d = loopback_TexCoord1d;
|
||||
dest->TexCoord1i = loopback_TexCoord1i;
|
||||
dest->TexCoord1s = loopback_TexCoord1s;
|
||||
dest->TexCoord2d = loopback_TexCoord2d;
|
||||
dest->TexCoord2s = loopback_TexCoord2s;
|
||||
dest->TexCoord2i = loopback_TexCoord2i;
|
||||
dest->TexCoord3d = loopback_TexCoord3d;
|
||||
dest->TexCoord3i = loopback_TexCoord3i;
|
||||
dest->TexCoord3s = loopback_TexCoord3s;
|
||||
dest->TexCoord4d = loopback_TexCoord4d;
|
||||
dest->TexCoord4i = loopback_TexCoord4i;
|
||||
dest->TexCoord4s = loopback_TexCoord4s;
|
||||
dest->TexCoord1dv = loopback_TexCoord1dv;
|
||||
dest->TexCoord1iv = loopback_TexCoord1iv;
|
||||
dest->TexCoord1sv = loopback_TexCoord1sv;
|
||||
dest->TexCoord2dv = loopback_TexCoord2dv;
|
||||
dest->TexCoord2iv = loopback_TexCoord2iv;
|
||||
dest->TexCoord2sv = loopback_TexCoord2sv;
|
||||
dest->TexCoord3dv = loopback_TexCoord3dv;
|
||||
dest->TexCoord3iv = loopback_TexCoord3iv;
|
||||
dest->TexCoord3sv = loopback_TexCoord3sv;
|
||||
dest->TexCoord4dv = loopback_TexCoord4dv;
|
||||
dest->TexCoord4iv = loopback_TexCoord4iv;
|
||||
dest->TexCoord4sv = loopback_TexCoord4sv;
|
||||
dest->Vertex2d = loopback_Vertex2d;
|
||||
dest->Vertex2i = loopback_Vertex2i;
|
||||
dest->Vertex2s = loopback_Vertex2s;
|
||||
dest->Vertex3d = loopback_Vertex3d;
|
||||
dest->Vertex3i = loopback_Vertex3i;
|
||||
dest->Vertex3s = loopback_Vertex3s;
|
||||
dest->Vertex4d = loopback_Vertex4d;
|
||||
dest->Vertex4i = loopback_Vertex4i;
|
||||
dest->Vertex4s = loopback_Vertex4s;
|
||||
dest->Vertex2dv = loopback_Vertex2dv;
|
||||
dest->Vertex2iv = loopback_Vertex2iv;
|
||||
dest->Vertex2sv = loopback_Vertex2sv;
|
||||
dest->Vertex3dv = loopback_Vertex3dv;
|
||||
dest->Vertex3iv = loopback_Vertex3iv;
|
||||
dest->Vertex3sv = loopback_Vertex3sv;
|
||||
dest->Vertex4dv = loopback_Vertex4dv;
|
||||
dest->Vertex4iv = loopback_Vertex4iv;
|
||||
dest->Vertex4sv = loopback_Vertex4sv;
|
||||
dest->MultiTexCoord1dARB = loopback_MultiTexCoord1dARB;
|
||||
dest->MultiTexCoord1dvARB = loopback_MultiTexCoord1dvARB;
|
||||
dest->MultiTexCoord1iARB = loopback_MultiTexCoord1iARB;
|
||||
dest->MultiTexCoord1ivARB = loopback_MultiTexCoord1ivARB;
|
||||
dest->MultiTexCoord1sARB = loopback_MultiTexCoord1sARB;
|
||||
dest->MultiTexCoord1svARB = loopback_MultiTexCoord1svARB;
|
||||
dest->MultiTexCoord2dARB = loopback_MultiTexCoord2dARB;
|
||||
dest->MultiTexCoord2dvARB = loopback_MultiTexCoord2dvARB;
|
||||
dest->MultiTexCoord2iARB = loopback_MultiTexCoord2iARB;
|
||||
dest->MultiTexCoord2ivARB = loopback_MultiTexCoord2ivARB;
|
||||
dest->MultiTexCoord2sARB = loopback_MultiTexCoord2sARB;
|
||||
dest->MultiTexCoord2svARB = loopback_MultiTexCoord2svARB;
|
||||
dest->MultiTexCoord3dARB = loopback_MultiTexCoord3dARB;
|
||||
dest->MultiTexCoord3dvARB = loopback_MultiTexCoord3dvARB;
|
||||
dest->MultiTexCoord3iARB = loopback_MultiTexCoord3iARB;
|
||||
dest->MultiTexCoord3ivARB = loopback_MultiTexCoord3ivARB;
|
||||
dest->MultiTexCoord3sARB = loopback_MultiTexCoord3sARB;
|
||||
dest->MultiTexCoord3svARB = loopback_MultiTexCoord3svARB;
|
||||
dest->MultiTexCoord4dARB = loopback_MultiTexCoord4dARB;
|
||||
dest->MultiTexCoord4dvARB = loopback_MultiTexCoord4dvARB;
|
||||
dest->MultiTexCoord4iARB = loopback_MultiTexCoord4iARB;
|
||||
dest->MultiTexCoord4ivARB = loopback_MultiTexCoord4ivARB;
|
||||
dest->MultiTexCoord4sARB = loopback_MultiTexCoord4sARB;
|
||||
dest->MultiTexCoord4svARB = loopback_MultiTexCoord4svARB;
|
||||
dest->EvalCoord2dv = loopback_EvalCoord2dv;
|
||||
dest->EvalCoord2fv = loopback_EvalCoord2fv;
|
||||
dest->EvalCoord2d = loopback_EvalCoord2d;
|
||||
dest->EvalCoord1dv = loopback_EvalCoord1dv;
|
||||
dest->EvalCoord1fv = loopback_EvalCoord1fv;
|
||||
dest->EvalCoord1d = loopback_EvalCoord1d;
|
||||
dest->Materialf = loopback_Materialf;
|
||||
dest->Materiali = loopback_Materiali;
|
||||
dest->Materialiv = loopback_Materialiv;
|
||||
dest->Rectd = loopback_Rectd;
|
||||
dest->Rectdv = loopback_Rectdv;
|
||||
dest->Rectfv = loopback_Rectfv;
|
||||
dest->Recti = loopback_Recti;
|
||||
dest->Rectiv = loopback_Rectiv;
|
||||
dest->Rects = loopback_Rects;
|
||||
dest->Rectsv = loopback_Rectsv;
|
||||
dest->FogCoorddEXT = loopback_FogCoorddEXT;
|
||||
dest->FogCoorddvEXT = loopback_FogCoorddvEXT;
|
||||
SET_EdgeFlagv(dest, loopback_EdgeFlagv);
|
||||
|
||||
dest->VertexAttrib1sNV = loopback_VertexAttrib1sNV;
|
||||
dest->VertexAttrib1dNV = loopback_VertexAttrib1dNV;
|
||||
dest->VertexAttrib2sNV = loopback_VertexAttrib2sNV;
|
||||
dest->VertexAttrib2dNV = loopback_VertexAttrib2dNV;
|
||||
dest->VertexAttrib3sNV = loopback_VertexAttrib3sNV;
|
||||
dest->VertexAttrib3dNV = loopback_VertexAttrib3dNV;
|
||||
dest->VertexAttrib4sNV = loopback_VertexAttrib4sNV;
|
||||
dest->VertexAttrib4dNV = loopback_VertexAttrib4dNV;
|
||||
dest->VertexAttrib4ubNV = loopback_VertexAttrib4ubNV;
|
||||
dest->VertexAttrib1svNV = loopback_VertexAttrib1svNV;
|
||||
dest->VertexAttrib1dvNV = loopback_VertexAttrib1dvNV;
|
||||
dest->VertexAttrib2svNV = loopback_VertexAttrib2svNV;
|
||||
dest->VertexAttrib2dvNV = loopback_VertexAttrib2dvNV;
|
||||
dest->VertexAttrib3svNV = loopback_VertexAttrib3svNV;
|
||||
dest->VertexAttrib3dvNV = loopback_VertexAttrib3dvNV;
|
||||
dest->VertexAttrib4svNV = loopback_VertexAttrib4svNV;
|
||||
dest->VertexAttrib4dvNV = loopback_VertexAttrib4dvNV;
|
||||
dest->VertexAttrib4ubvNV = loopback_VertexAttrib4ubvNV;
|
||||
dest->VertexAttribs1svNV = loopback_VertexAttribs1svNV;
|
||||
dest->VertexAttribs1fvNV = loopback_VertexAttribs1fvNV;
|
||||
dest->VertexAttribs1dvNV = loopback_VertexAttribs1dvNV;
|
||||
dest->VertexAttribs2svNV = loopback_VertexAttribs2svNV;
|
||||
dest->VertexAttribs2fvNV = loopback_VertexAttribs2fvNV;
|
||||
dest->VertexAttribs2dvNV = loopback_VertexAttribs2dvNV;
|
||||
dest->VertexAttribs3svNV = loopback_VertexAttribs3svNV;
|
||||
dest->VertexAttribs3fvNV = loopback_VertexAttribs3fvNV;
|
||||
dest->VertexAttribs3dvNV = loopback_VertexAttribs3dvNV;
|
||||
dest->VertexAttribs4svNV = loopback_VertexAttribs4svNV;
|
||||
dest->VertexAttribs4fvNV = loopback_VertexAttribs4fvNV;
|
||||
dest->VertexAttribs4dvNV = loopback_VertexAttribs4dvNV;
|
||||
dest->VertexAttribs4ubvNV = loopback_VertexAttribs4ubvNV;
|
||||
SET_Indexd(dest, loopback_Indexd);
|
||||
SET_Indexi(dest, loopback_Indexi);
|
||||
SET_Indexs(dest, loopback_Indexs);
|
||||
SET_Indexub(dest, loopback_Indexub);
|
||||
SET_Indexdv(dest, loopback_Indexdv);
|
||||
SET_Indexiv(dest, loopback_Indexiv);
|
||||
SET_Indexsv(dest, loopback_Indexsv);
|
||||
SET_Indexubv(dest, loopback_Indexubv);
|
||||
SET_Normal3b(dest, loopback_Normal3b);
|
||||
SET_Normal3d(dest, loopback_Normal3d);
|
||||
SET_Normal3i(dest, loopback_Normal3i);
|
||||
SET_Normal3s(dest, loopback_Normal3s);
|
||||
SET_Normal3bv(dest, loopback_Normal3bv);
|
||||
SET_Normal3dv(dest, loopback_Normal3dv);
|
||||
SET_Normal3iv(dest, loopback_Normal3iv);
|
||||
SET_Normal3sv(dest, loopback_Normal3sv);
|
||||
SET_TexCoord1d(dest, loopback_TexCoord1d);
|
||||
SET_TexCoord1i(dest, loopback_TexCoord1i);
|
||||
SET_TexCoord1s(dest, loopback_TexCoord1s);
|
||||
SET_TexCoord2d(dest, loopback_TexCoord2d);
|
||||
SET_TexCoord2s(dest, loopback_TexCoord2s);
|
||||
SET_TexCoord2i(dest, loopback_TexCoord2i);
|
||||
SET_TexCoord3d(dest, loopback_TexCoord3d);
|
||||
SET_TexCoord3i(dest, loopback_TexCoord3i);
|
||||
SET_TexCoord3s(dest, loopback_TexCoord3s);
|
||||
SET_TexCoord4d(dest, loopback_TexCoord4d);
|
||||
SET_TexCoord4i(dest, loopback_TexCoord4i);
|
||||
SET_TexCoord4s(dest, loopback_TexCoord4s);
|
||||
SET_TexCoord1dv(dest, loopback_TexCoord1dv);
|
||||
SET_TexCoord1iv(dest, loopback_TexCoord1iv);
|
||||
SET_TexCoord1sv(dest, loopback_TexCoord1sv);
|
||||
SET_TexCoord2dv(dest, loopback_TexCoord2dv);
|
||||
SET_TexCoord2iv(dest, loopback_TexCoord2iv);
|
||||
SET_TexCoord2sv(dest, loopback_TexCoord2sv);
|
||||
SET_TexCoord3dv(dest, loopback_TexCoord3dv);
|
||||
SET_TexCoord3iv(dest, loopback_TexCoord3iv);
|
||||
SET_TexCoord3sv(dest, loopback_TexCoord3sv);
|
||||
SET_TexCoord4dv(dest, loopback_TexCoord4dv);
|
||||
SET_TexCoord4iv(dest, loopback_TexCoord4iv);
|
||||
SET_TexCoord4sv(dest, loopback_TexCoord4sv);
|
||||
SET_Vertex2d(dest, loopback_Vertex2d);
|
||||
SET_Vertex2i(dest, loopback_Vertex2i);
|
||||
SET_Vertex2s(dest, loopback_Vertex2s);
|
||||
SET_Vertex3d(dest, loopback_Vertex3d);
|
||||
SET_Vertex3i(dest, loopback_Vertex3i);
|
||||
SET_Vertex3s(dest, loopback_Vertex3s);
|
||||
SET_Vertex4d(dest, loopback_Vertex4d);
|
||||
SET_Vertex4i(dest, loopback_Vertex4i);
|
||||
SET_Vertex4s(dest, loopback_Vertex4s);
|
||||
SET_Vertex2dv(dest, loopback_Vertex2dv);
|
||||
SET_Vertex2iv(dest, loopback_Vertex2iv);
|
||||
SET_Vertex2sv(dest, loopback_Vertex2sv);
|
||||
SET_Vertex3dv(dest, loopback_Vertex3dv);
|
||||
SET_Vertex3iv(dest, loopback_Vertex3iv);
|
||||
SET_Vertex3sv(dest, loopback_Vertex3sv);
|
||||
SET_Vertex4dv(dest, loopback_Vertex4dv);
|
||||
SET_Vertex4iv(dest, loopback_Vertex4iv);
|
||||
SET_Vertex4sv(dest, loopback_Vertex4sv);
|
||||
SET_MultiTexCoord1dARB(dest, loopback_MultiTexCoord1dARB);
|
||||
SET_MultiTexCoord1dvARB(dest, loopback_MultiTexCoord1dvARB);
|
||||
SET_MultiTexCoord1iARB(dest, loopback_MultiTexCoord1iARB);
|
||||
SET_MultiTexCoord1ivARB(dest, loopback_MultiTexCoord1ivARB);
|
||||
SET_MultiTexCoord1sARB(dest, loopback_MultiTexCoord1sARB);
|
||||
SET_MultiTexCoord1svARB(dest, loopback_MultiTexCoord1svARB);
|
||||
SET_MultiTexCoord2dARB(dest, loopback_MultiTexCoord2dARB);
|
||||
SET_MultiTexCoord2dvARB(dest, loopback_MultiTexCoord2dvARB);
|
||||
SET_MultiTexCoord2iARB(dest, loopback_MultiTexCoord2iARB);
|
||||
SET_MultiTexCoord2ivARB(dest, loopback_MultiTexCoord2ivARB);
|
||||
SET_MultiTexCoord2sARB(dest, loopback_MultiTexCoord2sARB);
|
||||
SET_MultiTexCoord2svARB(dest, loopback_MultiTexCoord2svARB);
|
||||
SET_MultiTexCoord3dARB(dest, loopback_MultiTexCoord3dARB);
|
||||
SET_MultiTexCoord3dvARB(dest, loopback_MultiTexCoord3dvARB);
|
||||
SET_MultiTexCoord3iARB(dest, loopback_MultiTexCoord3iARB);
|
||||
SET_MultiTexCoord3ivARB(dest, loopback_MultiTexCoord3ivARB);
|
||||
SET_MultiTexCoord3sARB(dest, loopback_MultiTexCoord3sARB);
|
||||
SET_MultiTexCoord3svARB(dest, loopback_MultiTexCoord3svARB);
|
||||
SET_MultiTexCoord4dARB(dest, loopback_MultiTexCoord4dARB);
|
||||
SET_MultiTexCoord4dvARB(dest, loopback_MultiTexCoord4dvARB);
|
||||
SET_MultiTexCoord4iARB(dest, loopback_MultiTexCoord4iARB);
|
||||
SET_MultiTexCoord4ivARB(dest, loopback_MultiTexCoord4ivARB);
|
||||
SET_MultiTexCoord4sARB(dest, loopback_MultiTexCoord4sARB);
|
||||
SET_MultiTexCoord4svARB(dest, loopback_MultiTexCoord4svARB);
|
||||
SET_EvalCoord2dv(dest, loopback_EvalCoord2dv);
|
||||
SET_EvalCoord2fv(dest, loopback_EvalCoord2fv);
|
||||
SET_EvalCoord2d(dest, loopback_EvalCoord2d);
|
||||
SET_EvalCoord1dv(dest, loopback_EvalCoord1dv);
|
||||
SET_EvalCoord1fv(dest, loopback_EvalCoord1fv);
|
||||
SET_EvalCoord1d(dest, loopback_EvalCoord1d);
|
||||
SET_Materialf(dest, loopback_Materialf);
|
||||
SET_Materiali(dest, loopback_Materiali);
|
||||
SET_Materialiv(dest, loopback_Materialiv);
|
||||
SET_Rectd(dest, loopback_Rectd);
|
||||
SET_Rectdv(dest, loopback_Rectdv);
|
||||
SET_Rectfv(dest, loopback_Rectfv);
|
||||
SET_Recti(dest, loopback_Recti);
|
||||
SET_Rectiv(dest, loopback_Rectiv);
|
||||
SET_Rects(dest, loopback_Rects);
|
||||
SET_Rectsv(dest, loopback_Rectsv);
|
||||
SET_FogCoorddEXT(dest, loopback_FogCoorddEXT);
|
||||
SET_FogCoorddvEXT(dest, loopback_FogCoorddvEXT);
|
||||
|
||||
dest->VertexAttrib1sARB = loopback_VertexAttrib1sARB;
|
||||
dest->VertexAttrib1dARB = loopback_VertexAttrib1dARB;
|
||||
dest->VertexAttrib2sARB = loopback_VertexAttrib2sARB;
|
||||
dest->VertexAttrib2dARB = loopback_VertexAttrib2dARB;
|
||||
dest->VertexAttrib3sARB = loopback_VertexAttrib3sARB;
|
||||
dest->VertexAttrib3dARB = loopback_VertexAttrib3dARB;
|
||||
dest->VertexAttrib4sARB = loopback_VertexAttrib4sARB;
|
||||
dest->VertexAttrib4dARB = loopback_VertexAttrib4dARB;
|
||||
dest->VertexAttrib1svARB = loopback_VertexAttrib1svARB;
|
||||
dest->VertexAttrib1dvARB = loopback_VertexAttrib1dvARB;
|
||||
dest->VertexAttrib2svARB = loopback_VertexAttrib2svARB;
|
||||
dest->VertexAttrib2dvARB = loopback_VertexAttrib2dvARB;
|
||||
dest->VertexAttrib3svARB = loopback_VertexAttrib3svARB;
|
||||
dest->VertexAttrib3dvARB = loopback_VertexAttrib3dvARB;
|
||||
dest->VertexAttrib4svARB = loopback_VertexAttrib4svARB;
|
||||
dest->VertexAttrib4dvARB = loopback_VertexAttrib4dvARB;
|
||||
dest->VertexAttrib4NubARB = loopback_VertexAttrib4NubARB;
|
||||
dest->VertexAttrib4NubvARB = loopback_VertexAttrib4NubvARB;
|
||||
dest->VertexAttrib4bvARB = loopback_VertexAttrib4bvARB;
|
||||
dest->VertexAttrib4ivARB = loopback_VertexAttrib4ivARB;
|
||||
dest->VertexAttrib4ubvARB = loopback_VertexAttrib4ubvARB;
|
||||
dest->VertexAttrib4usvARB = loopback_VertexAttrib4usvARB;
|
||||
dest->VertexAttrib4uivARB = loopback_VertexAttrib4uivARB;
|
||||
dest->VertexAttrib4NbvARB = loopback_VertexAttrib4NbvARB;
|
||||
dest->VertexAttrib4NsvARB = loopback_VertexAttrib4NsvARB;
|
||||
dest->VertexAttrib4NivARB = loopback_VertexAttrib4NivARB;
|
||||
dest->VertexAttrib4NusvARB = loopback_VertexAttrib4NusvARB;
|
||||
dest->VertexAttrib4NuivARB = loopback_VertexAttrib4NuivARB;
|
||||
SET_VertexAttrib1sNV(dest, loopback_VertexAttrib1sNV);
|
||||
SET_VertexAttrib1dNV(dest, loopback_VertexAttrib1dNV);
|
||||
SET_VertexAttrib2sNV(dest, loopback_VertexAttrib2sNV);
|
||||
SET_VertexAttrib2dNV(dest, loopback_VertexAttrib2dNV);
|
||||
SET_VertexAttrib3sNV(dest, loopback_VertexAttrib3sNV);
|
||||
SET_VertexAttrib3dNV(dest, loopback_VertexAttrib3dNV);
|
||||
SET_VertexAttrib4sNV(dest, loopback_VertexAttrib4sNV);
|
||||
SET_VertexAttrib4dNV(dest, loopback_VertexAttrib4dNV);
|
||||
SET_VertexAttrib4ubNV(dest, loopback_VertexAttrib4ubNV);
|
||||
SET_VertexAttrib1svNV(dest, loopback_VertexAttrib1svNV);
|
||||
SET_VertexAttrib1dvNV(dest, loopback_VertexAttrib1dvNV);
|
||||
SET_VertexAttrib2svNV(dest, loopback_VertexAttrib2svNV);
|
||||
SET_VertexAttrib2dvNV(dest, loopback_VertexAttrib2dvNV);
|
||||
SET_VertexAttrib3svNV(dest, loopback_VertexAttrib3svNV);
|
||||
SET_VertexAttrib3dvNV(dest, loopback_VertexAttrib3dvNV);
|
||||
SET_VertexAttrib4svNV(dest, loopback_VertexAttrib4svNV);
|
||||
SET_VertexAttrib4dvNV(dest, loopback_VertexAttrib4dvNV);
|
||||
SET_VertexAttrib4ubvNV(dest, loopback_VertexAttrib4ubvNV);
|
||||
SET_VertexAttribs1svNV(dest, loopback_VertexAttribs1svNV);
|
||||
SET_VertexAttribs1fvNV(dest, loopback_VertexAttribs1fvNV);
|
||||
SET_VertexAttribs1dvNV(dest, loopback_VertexAttribs1dvNV);
|
||||
SET_VertexAttribs2svNV(dest, loopback_VertexAttribs2svNV);
|
||||
SET_VertexAttribs2fvNV(dest, loopback_VertexAttribs2fvNV);
|
||||
SET_VertexAttribs2dvNV(dest, loopback_VertexAttribs2dvNV);
|
||||
SET_VertexAttribs3svNV(dest, loopback_VertexAttribs3svNV);
|
||||
SET_VertexAttribs3fvNV(dest, loopback_VertexAttribs3fvNV);
|
||||
SET_VertexAttribs3dvNV(dest, loopback_VertexAttribs3dvNV);
|
||||
SET_VertexAttribs4svNV(dest, loopback_VertexAttribs4svNV);
|
||||
SET_VertexAttribs4fvNV(dest, loopback_VertexAttribs4fvNV);
|
||||
SET_VertexAttribs4dvNV(dest, loopback_VertexAttribs4dvNV);
|
||||
SET_VertexAttribs4ubvNV(dest, loopback_VertexAttribs4ubvNV);
|
||||
|
||||
SET_VertexAttrib1sARB(dest, loopback_VertexAttrib1sARB);
|
||||
SET_VertexAttrib1dARB(dest, loopback_VertexAttrib1dARB);
|
||||
SET_VertexAttrib2sARB(dest, loopback_VertexAttrib2sARB);
|
||||
SET_VertexAttrib2dARB(dest, loopback_VertexAttrib2dARB);
|
||||
SET_VertexAttrib3sARB(dest, loopback_VertexAttrib3sARB);
|
||||
SET_VertexAttrib3dARB(dest, loopback_VertexAttrib3dARB);
|
||||
SET_VertexAttrib4sARB(dest, loopback_VertexAttrib4sARB);
|
||||
SET_VertexAttrib4dARB(dest, loopback_VertexAttrib4dARB);
|
||||
SET_VertexAttrib1svARB(dest, loopback_VertexAttrib1svARB);
|
||||
SET_VertexAttrib1dvARB(dest, loopback_VertexAttrib1dvARB);
|
||||
SET_VertexAttrib2svARB(dest, loopback_VertexAttrib2svARB);
|
||||
SET_VertexAttrib2dvARB(dest, loopback_VertexAttrib2dvARB);
|
||||
SET_VertexAttrib3svARB(dest, loopback_VertexAttrib3svARB);
|
||||
SET_VertexAttrib3dvARB(dest, loopback_VertexAttrib3dvARB);
|
||||
SET_VertexAttrib4svARB(dest, loopback_VertexAttrib4svARB);
|
||||
SET_VertexAttrib4dvARB(dest, loopback_VertexAttrib4dvARB);
|
||||
SET_VertexAttrib4NubARB(dest, loopback_VertexAttrib4NubARB);
|
||||
SET_VertexAttrib4NubvARB(dest, loopback_VertexAttrib4NubvARB);
|
||||
SET_VertexAttrib4bvARB(dest, loopback_VertexAttrib4bvARB);
|
||||
SET_VertexAttrib4ivARB(dest, loopback_VertexAttrib4ivARB);
|
||||
SET_VertexAttrib4ubvARB(dest, loopback_VertexAttrib4ubvARB);
|
||||
SET_VertexAttrib4usvARB(dest, loopback_VertexAttrib4usvARB);
|
||||
SET_VertexAttrib4uivARB(dest, loopback_VertexAttrib4uivARB);
|
||||
SET_VertexAttrib4NbvARB(dest, loopback_VertexAttrib4NbvARB);
|
||||
SET_VertexAttrib4NsvARB(dest, loopback_VertexAttrib4NsvARB);
|
||||
SET_VertexAttrib4NivARB(dest, loopback_VertexAttrib4NivARB);
|
||||
SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB);
|
||||
SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.1
|
||||
* Version: 6.5.1
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -28,47 +28,39 @@
|
||||
#include "api_validate.h"
|
||||
#include "api_arrayelt.h"
|
||||
#include "context.h"
|
||||
#include "colormac.h"
|
||||
#include "light.h"
|
||||
#include "macros.h"
|
||||
#include "mtypes.h"
|
||||
#include "dlist.h"
|
||||
#include "dispatch.h"
|
||||
|
||||
|
||||
/* In states where certain vertex components are required for t&l or
|
||||
* rasterization, we still need to keep track of the current values.
|
||||
* These functions provide this service by keeping uptodate the
|
||||
* 'ctx->Current' struct for all data elements not included in the
|
||||
* currently enabled hardware vertex.
|
||||
* I.e. these functions would typically be used when outside of glBegin/End.
|
||||
/**
|
||||
* \file
|
||||
* Just update the ctx->Current vertex attributes.
|
||||
* These functions are used when outside glBegin/glEnd or outside display
|
||||
* lists.
|
||||
*/
|
||||
|
||||
|
||||
void GLAPIENTRY _mesa_noop_EdgeFlag( GLboolean b )
|
||||
static void GLAPIENTRY _mesa_noop_EdgeFlag( GLboolean b )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ctx->Current.EdgeFlag = b;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_EdgeFlagv( const GLboolean *b )
|
||||
static void GLAPIENTRY _mesa_noop_Indexf( GLfloat f )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ctx->Current.EdgeFlag = *b;
|
||||
ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0] = f;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Indexf( GLfloat f )
|
||||
static void GLAPIENTRY _mesa_noop_Indexfv( const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ctx->Current.Index = f;
|
||||
ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0] = *v;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Indexfv( const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ctx->Current.Index = *v;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_FogCoordfEXT( GLfloat a )
|
||||
static void GLAPIENTRY _mesa_noop_FogCoordfEXT( GLfloat a )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_FOG];
|
||||
@@ -78,17 +70,17 @@ void GLAPIENTRY _mesa_noop_FogCoordfEXT( GLfloat a )
|
||||
dest[3] = 1.0;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_FogCoordfvEXT( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_FogCoordfvEXT( const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_FOG];
|
||||
dest[0] = v[0];
|
||||
dest[1] = 0.0;
|
||||
dest[2] = 0.0;
|
||||
dest[3] = 1.0;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Normal3f( GLfloat a, GLfloat b, GLfloat c )
|
||||
static void GLAPIENTRY _mesa_noop_Normal3f( GLfloat a, GLfloat b, GLfloat c )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
|
||||
@@ -98,7 +90,7 @@ void GLAPIENTRY _mesa_noop_Normal3f( GLfloat a, GLfloat b, GLfloat c )
|
||||
dest[3] = 1.0;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Normal3fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_Normal3fv( const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_NORMAL];
|
||||
@@ -108,7 +100,7 @@ void GLAPIENTRY _mesa_noop_Normal3fv( const GLfloat *v )
|
||||
dest[3] = 1.0;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Color4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
|
||||
static void GLAPIENTRY _mesa_noop_Color4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
|
||||
@@ -118,7 +110,7 @@ void GLAPIENTRY _mesa_noop_Color4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
|
||||
color[3] = d;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Color4fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_Color4fv( const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
|
||||
@@ -128,7 +120,7 @@ void GLAPIENTRY _mesa_noop_Color4fv( const GLfloat *v )
|
||||
color[3] = v[3];
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Color3f( GLfloat a, GLfloat b, GLfloat c )
|
||||
static void GLAPIENTRY _mesa_noop_Color3f( GLfloat a, GLfloat b, GLfloat c )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
|
||||
@@ -138,7 +130,7 @@ void GLAPIENTRY _mesa_noop_Color3f( GLfloat a, GLfloat b, GLfloat c )
|
||||
color[3] = 1.0;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Color3fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_Color3fv( const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0];
|
||||
@@ -148,7 +140,7 @@ void GLAPIENTRY _mesa_noop_Color3fv( const GLfloat *v )
|
||||
color[3] = 1.0;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_MultiTexCoord1fARB( GLenum target, GLfloat a )
|
||||
static void GLAPIENTRY _mesa_noop_MultiTexCoord1fARB( GLenum target, GLfloat a )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLuint unit = target - GL_TEXTURE0_ARB;
|
||||
@@ -165,7 +157,7 @@ void GLAPIENTRY _mesa_noop_MultiTexCoord1fARB( GLenum target, GLfloat a )
|
||||
}
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_MultiTexCoord1fvARB( GLenum target, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_MultiTexCoord1fvARB( GLenum target, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLuint unit = target - GL_TEXTURE0_ARB;
|
||||
@@ -182,7 +174,7 @@ void GLAPIENTRY _mesa_noop_MultiTexCoord1fvARB( GLenum target, const GLfloat *v
|
||||
}
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_MultiTexCoord2fARB( GLenum target, GLfloat a, GLfloat b )
|
||||
static void GLAPIENTRY _mesa_noop_MultiTexCoord2fARB( GLenum target, GLfloat a, GLfloat b )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLuint unit = target - GL_TEXTURE0_ARB;
|
||||
@@ -199,7 +191,7 @@ void GLAPIENTRY _mesa_noop_MultiTexCoord2fARB( GLenum target, GLfloat a, GLfloat
|
||||
}
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_MultiTexCoord2fvARB( GLenum target, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_MultiTexCoord2fvARB( GLenum target, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLuint unit = target - GL_TEXTURE0_ARB;
|
||||
@@ -216,7 +208,7 @@ void GLAPIENTRY _mesa_noop_MultiTexCoord2fvARB( GLenum target, const GLfloat *v
|
||||
}
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_MultiTexCoord3fARB( GLenum target, GLfloat a, GLfloat b, GLfloat c)
|
||||
static void GLAPIENTRY _mesa_noop_MultiTexCoord3fARB( GLenum target, GLfloat a, GLfloat b, GLfloat c)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLuint unit = target - GL_TEXTURE0_ARB;
|
||||
@@ -233,7 +225,7 @@ void GLAPIENTRY _mesa_noop_MultiTexCoord3fARB( GLenum target, GLfloat a, GLfloat
|
||||
}
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_MultiTexCoord3fvARB( GLenum target, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_MultiTexCoord3fvARB( GLenum target, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLuint unit = target - GL_TEXTURE0_ARB;
|
||||
@@ -250,7 +242,7 @@ void GLAPIENTRY _mesa_noop_MultiTexCoord3fvARB( GLenum target, const GLfloat *v
|
||||
}
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_MultiTexCoord4fARB( GLenum target, GLfloat a, GLfloat b,
|
||||
static void GLAPIENTRY _mesa_noop_MultiTexCoord4fARB( GLenum target, GLfloat a, GLfloat b,
|
||||
GLfloat c, GLfloat d )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
@@ -268,7 +260,7 @@ void GLAPIENTRY _mesa_noop_MultiTexCoord4fARB( GLenum target, GLfloat a, GLfloat
|
||||
}
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_MultiTexCoord4fvARB( GLenum target, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_MultiTexCoord4fvARB( GLenum target, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLuint unit = target - GL_TEXTURE0_ARB;
|
||||
@@ -285,7 +277,7 @@ void GLAPIENTRY _mesa_noop_MultiTexCoord4fvARB( GLenum target, const GLfloat *v
|
||||
}
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_SecondaryColor3fEXT( GLfloat a, GLfloat b, GLfloat c )
|
||||
static void GLAPIENTRY _mesa_noop_SecondaryColor3fEXT( GLfloat a, GLfloat b, GLfloat c )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
|
||||
@@ -295,7 +287,7 @@ void GLAPIENTRY _mesa_noop_SecondaryColor3fEXT( GLfloat a, GLfloat b, GLfloat c
|
||||
color[3] = 1.0;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_SecondaryColor3fvEXT( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_SecondaryColor3fvEXT( const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *color = ctx->Current.Attrib[VERT_ATTRIB_COLOR1];
|
||||
@@ -305,7 +297,7 @@ void GLAPIENTRY _mesa_noop_SecondaryColor3fvEXT( const GLfloat *v )
|
||||
color[3] = 1.0;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_TexCoord1f( GLfloat a )
|
||||
static void GLAPIENTRY _mesa_noop_TexCoord1f( GLfloat a )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
|
||||
@@ -315,7 +307,7 @@ void GLAPIENTRY _mesa_noop_TexCoord1f( GLfloat a )
|
||||
dest[3] = 1;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_TexCoord1fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_TexCoord1fv( const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
|
||||
@@ -325,7 +317,7 @@ void GLAPIENTRY _mesa_noop_TexCoord1fv( const GLfloat *v )
|
||||
dest[3] = 1;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_TexCoord2f( GLfloat a, GLfloat b )
|
||||
static void GLAPIENTRY _mesa_noop_TexCoord2f( GLfloat a, GLfloat b )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
|
||||
@@ -335,7 +327,7 @@ void GLAPIENTRY _mesa_noop_TexCoord2f( GLfloat a, GLfloat b )
|
||||
dest[3] = 1;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_TexCoord2fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_TexCoord2fv( const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
|
||||
@@ -345,7 +337,7 @@ void GLAPIENTRY _mesa_noop_TexCoord2fv( const GLfloat *v )
|
||||
dest[3] = 1;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_TexCoord3f( GLfloat a, GLfloat b, GLfloat c )
|
||||
static void GLAPIENTRY _mesa_noop_TexCoord3f( GLfloat a, GLfloat b, GLfloat c )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
|
||||
@@ -355,7 +347,7 @@ void GLAPIENTRY _mesa_noop_TexCoord3f( GLfloat a, GLfloat b, GLfloat c )
|
||||
dest[3] = 1;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_TexCoord3fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_TexCoord3fv( const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
|
||||
@@ -365,7 +357,7 @@ void GLAPIENTRY _mesa_noop_TexCoord3fv( const GLfloat *v )
|
||||
dest[3] = 1;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
|
||||
static void GLAPIENTRY _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
|
||||
@@ -375,7 +367,7 @@ void GLAPIENTRY _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat
|
||||
dest[3] = d;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_TexCoord4fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_TexCoord4fv( const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat *dest = ctx->Current.Attrib[VERT_ATTRIB_TEX0];
|
||||
@@ -386,181 +378,189 @@ void GLAPIENTRY _mesa_noop_TexCoord4fv( const GLfloat *v )
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* GL_NV_vertex_program attributes.
|
||||
* Note that these attributes alias the conventional vertex attributes.
|
||||
*/
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib1fNV( GLuint index, GLfloat x )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib1fNV( GLuint index, GLfloat x )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], x, 0, 0, 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib1fNV" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fNV(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib1fvNV( GLuint index, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], v[0], 0, 0, 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib1fvNV" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fvNV(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], x, y, 0, 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib2fNV" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fNV(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib2fvNV( GLuint index, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], 0, 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib2fvNV" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fvNV(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib3fNV( GLuint index, GLfloat x,
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib3fNV( GLuint index, GLfloat x,
|
||||
GLfloat y, GLfloat z )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib3fNV" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fNV(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib3fvNV( GLuint index, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib3fvNV" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fvNV(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x,
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x,
|
||||
GLfloat y, GLfloat z, GLfloat w )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, w);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib4fNV" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fNV(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
if (index < MAX_NV_VERTEX_PROGRAM_INPUTS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib4fvNV" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fvNV(index)" );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* XXX Un-alias attribs here
|
||||
|
||||
/**
|
||||
* GL_ARB_vertex_program attributes.
|
||||
* Note that these attributes DO NOT alias the conventional vertex attributes.
|
||||
*/
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib1fARB( GLuint index, GLfloat x )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib1fARB( GLuint index, GLfloat x )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], x, 0, 0, 1);
|
||||
if (index < MAX_VERTEX_ATTRIBS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, 0, 0, 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib1fARB" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fARB(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib1fvARB( GLuint index, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib1fvARB( GLuint index, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], v[0], 0, 0, 1);
|
||||
if (index < MAX_VERTEX_ATTRIBS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], 0, 0, 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib1fvARB" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib1fvARB(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib2fARB( GLuint index, GLfloat x, GLfloat y )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib2fARB( GLuint index, GLfloat x, GLfloat y )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], x, y, 0, 1);
|
||||
if (index < MAX_VERTEX_ATTRIBS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, 0, 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib2fARB" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fARB(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib2fvARB( GLuint index, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib2fvARB( GLuint index, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], 0, 1);
|
||||
if (index < MAX_VERTEX_ATTRIBS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], 0, 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib2fvARB" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib2fvARB(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib3fARB( GLuint index, GLfloat x,
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib3fARB( GLuint index, GLfloat x,
|
||||
GLfloat y, GLfloat z )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, 1);
|
||||
if (index < MAX_VERTEX_ATTRIBS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, z, 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib3fARB" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fARB(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib3fvARB( GLuint index, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib3fvARB( GLuint index, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], 1);
|
||||
if (index < MAX_VERTEX_ATTRIBS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], v[2], 1);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib3fvARB" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib3fvARB(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib4fARB( GLuint index, GLfloat x,
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib4fARB( GLuint index, GLfloat x,
|
||||
GLfloat y, GLfloat z, GLfloat w )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], x, y, z, w);
|
||||
if (index < MAX_VERTEX_ATTRIBS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], x, y, z, w);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib4fARB" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fARB(index)" );
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_VertexAttrib4fvARB( GLuint index, const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_VertexAttrib4fvARB( GLuint index, const GLfloat *v )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
if (index < VERT_ATTRIB_MAX) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[index], v[0], v[1], v[2], v[3]);
|
||||
if (index < MAX_VERTEX_ATTRIBS) {
|
||||
ASSIGN_4V(ctx->Current.Attrib[VERT_ATTRIB_GENERIC0 + index], v[0], v[1], v[2], v[3]);
|
||||
}
|
||||
else
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glVertexAttrib4fvARB" );
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glVertexAttrib4fvARB(index)" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Material
|
||||
/**
|
||||
* Called by glMaterial*()
|
||||
*/
|
||||
void GLAPIENTRY _mesa_noop_Materialfv( GLenum face, GLenum pname, const GLfloat *params )
|
||||
void GLAPIENTRY
|
||||
_mesa_noop_Materialfv( GLenum face, GLenum pname, const GLfloat *params )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLint i, nr;
|
||||
@@ -574,7 +574,7 @@ void GLAPIENTRY _mesa_noop_Materialfv( GLenum face, GLenum pname, const GLfloat
|
||||
if (bitmask == 0)
|
||||
return;
|
||||
|
||||
switch (face) {
|
||||
switch (pname) {
|
||||
case GL_SHININESS: nr = 1; break;
|
||||
case GL_COLOR_INDEXES: nr = 3; break;
|
||||
default: nr = 4 ; break;
|
||||
@@ -587,66 +587,68 @@ void GLAPIENTRY _mesa_noop_Materialfv( GLenum face, GLenum pname, const GLfloat
|
||||
_mesa_update_material( ctx, bitmask );
|
||||
}
|
||||
|
||||
/* These really are noops outside begin/end:
|
||||
|
||||
/**
|
||||
* These really are noops outside begin/end:
|
||||
*/
|
||||
void GLAPIENTRY _mesa_noop_Vertex2fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_Vertex2fv( const GLfloat *v )
|
||||
{
|
||||
(void) v;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Vertex3fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_Vertex3fv( const GLfloat *v )
|
||||
{
|
||||
(void) v;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Vertex4fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_Vertex4fv( const GLfloat *v )
|
||||
{
|
||||
(void) v;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Vertex2f( GLfloat a, GLfloat b )
|
||||
static void GLAPIENTRY _mesa_noop_Vertex2f( GLfloat a, GLfloat b )
|
||||
{
|
||||
(void) a; (void) b;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Vertex3f( GLfloat a, GLfloat b, GLfloat c )
|
||||
static void GLAPIENTRY _mesa_noop_Vertex3f( GLfloat a, GLfloat b, GLfloat c )
|
||||
{
|
||||
(void) a; (void) b; (void) c;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_Vertex4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
|
||||
static void GLAPIENTRY _mesa_noop_Vertex4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d )
|
||||
{
|
||||
(void) a; (void) b; (void) c; (void) d;
|
||||
}
|
||||
|
||||
/* Similarly, these have no effect outside begin/end:
|
||||
*/
|
||||
void GLAPIENTRY _mesa_noop_EvalCoord1f( GLfloat a )
|
||||
static void GLAPIENTRY _mesa_noop_EvalCoord1f( GLfloat a )
|
||||
{
|
||||
(void) a;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_EvalCoord1fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_EvalCoord1fv( const GLfloat *v )
|
||||
{
|
||||
(void) v;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_EvalCoord2f( GLfloat a, GLfloat b )
|
||||
static void GLAPIENTRY _mesa_noop_EvalCoord2f( GLfloat a, GLfloat b )
|
||||
{
|
||||
(void) a; (void) b;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_EvalCoord2fv( const GLfloat *v )
|
||||
static void GLAPIENTRY _mesa_noop_EvalCoord2fv( const GLfloat *v )
|
||||
{
|
||||
(void) v;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_EvalPoint1( GLint a )
|
||||
static void GLAPIENTRY _mesa_noop_EvalPoint1( GLint a )
|
||||
{
|
||||
(void) a;
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_EvalPoint2( GLint a, GLint b )
|
||||
static void GLAPIENTRY _mesa_noop_EvalPoint2( GLint a, GLint b )
|
||||
{
|
||||
(void) a; (void) b;
|
||||
}
|
||||
@@ -655,7 +657,7 @@ void GLAPIENTRY _mesa_noop_EvalPoint2( GLint a, GLint b )
|
||||
/* Begin -- call into driver, should result in the vtxfmt being
|
||||
* swapped out:
|
||||
*/
|
||||
void GLAPIENTRY _mesa_noop_Begin( GLenum mode )
|
||||
static void GLAPIENTRY _mesa_noop_Begin( GLenum mode )
|
||||
{
|
||||
(void) mode;
|
||||
}
|
||||
@@ -663,14 +665,15 @@ void GLAPIENTRY _mesa_noop_Begin( GLenum mode )
|
||||
|
||||
/* End -- just raise an error
|
||||
*/
|
||||
void GLAPIENTRY _mesa_noop_End( void )
|
||||
static void GLAPIENTRY _mesa_noop_End( void )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
_mesa_error( ctx, GL_INVALID_OPERATION, "glEnd" );
|
||||
_mesa_error( ctx, GL_INVALID_OPERATION, "glEnd(no glBegin)" );
|
||||
}
|
||||
|
||||
|
||||
/* Execute a glRectf() function. This is not suitable for GL_COMPILE
|
||||
/**
|
||||
* Execute a glRectf() function. This is not suitable for GL_COMPILE
|
||||
* modes (as the test for outside begin/end is not compiled),
|
||||
* but may be useful for drivers in circumstances which exclude
|
||||
* display list interactions.
|
||||
@@ -678,27 +681,30 @@ void GLAPIENTRY _mesa_noop_End( void )
|
||||
* (None of the functions in this file are suitable for GL_COMPILE
|
||||
* modes).
|
||||
*/
|
||||
void GLAPIENTRY _mesa_noop_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
|
||||
void GLAPIENTRY
|
||||
_mesa_noop_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 )
|
||||
{
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
}
|
||||
|
||||
GL_CALL(Begin)( GL_QUADS );
|
||||
GL_CALL(Vertex2f)( x1, y1 );
|
||||
GL_CALL(Vertex2f)( x2, y1 );
|
||||
GL_CALL(Vertex2f)( x2, y2 );
|
||||
GL_CALL(Vertex2f)( x1, y2 );
|
||||
GL_CALL(End)();
|
||||
CALL_Begin(GET_DISPATCH(), (GL_QUADS));
|
||||
CALL_Vertex2f(GET_DISPATCH(), (x1, y1));
|
||||
CALL_Vertex2f(GET_DISPATCH(), (x2, y1));
|
||||
CALL_Vertex2f(GET_DISPATCH(), (x2, y2));
|
||||
CALL_Vertex2f(GET_DISPATCH(), (x1, y2));
|
||||
CALL_End(GET_DISPATCH(), ());
|
||||
}
|
||||
|
||||
|
||||
/* Some very basic support for arrays. Drivers without explicit array
|
||||
/**
|
||||
* Some very basic support for arrays. Drivers without explicit array
|
||||
* support can hook these in, but still need to supply an array-elt
|
||||
* implementation.
|
||||
*/
|
||||
void GLAPIENTRY _mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count)
|
||||
static void GLAPIENTRY
|
||||
_mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLint i;
|
||||
@@ -706,15 +712,16 @@ void GLAPIENTRY _mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count)
|
||||
if (!_mesa_validate_DrawArrays( ctx, mode, start, count ))
|
||||
return;
|
||||
|
||||
GL_CALL(Begin)(mode);
|
||||
CALL_Begin(GET_DISPATCH(), (mode));
|
||||
for (i = 0; i < count; i++)
|
||||
GL_CALL(ArrayElement)(start + i);
|
||||
GL_CALL(End)();
|
||||
CALL_ArrayElement(GET_DISPATCH(), (start + i));
|
||||
CALL_End(GET_DISPATCH(), ());
|
||||
}
|
||||
|
||||
|
||||
void GLAPIENTRY _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type,
|
||||
const GLvoid *indices)
|
||||
static void GLAPIENTRY
|
||||
_mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type,
|
||||
const GLvoid *indices)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLint i;
|
||||
@@ -722,56 +729,60 @@ void GLAPIENTRY _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type,
|
||||
if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices ))
|
||||
return;
|
||||
|
||||
GL_CALL(Begin)(mode);
|
||||
CALL_Begin(GET_DISPATCH(), (mode));
|
||||
|
||||
switch (type) {
|
||||
case GL_UNSIGNED_BYTE:
|
||||
for (i = 0 ; i < count ; i++)
|
||||
GL_CALL(ArrayElement)( ((GLubyte *)indices)[i] );
|
||||
CALL_ArrayElement(GET_DISPATCH(), ( ((GLubyte *)indices)[i] ));
|
||||
break;
|
||||
case GL_UNSIGNED_SHORT:
|
||||
for (i = 0 ; i < count ; i++)
|
||||
GL_CALL(ArrayElement)( ((GLushort *)indices)[i] );
|
||||
CALL_ArrayElement(GET_DISPATCH(), ( ((GLushort *)indices)[i] ));
|
||||
break;
|
||||
case GL_UNSIGNED_INT:
|
||||
for (i = 0 ; i < count ; i++)
|
||||
GL_CALL(ArrayElement)( ((GLuint *)indices)[i] );
|
||||
CALL_ArrayElement(GET_DISPATCH(), ( ((GLuint *)indices)[i] ));
|
||||
break;
|
||||
default:
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glDrawElements(type)" );
|
||||
break;
|
||||
}
|
||||
|
||||
GL_CALL(End)();
|
||||
CALL_End(GET_DISPATCH(), ());
|
||||
}
|
||||
|
||||
void GLAPIENTRY _mesa_noop_DrawRangeElements(GLenum mode,
|
||||
GLuint start, GLuint end,
|
||||
GLsizei count, GLenum type,
|
||||
const GLvoid *indices)
|
||||
|
||||
static void GLAPIENTRY
|
||||
_mesa_noop_DrawRangeElements(GLenum mode,
|
||||
GLuint start, GLuint end,
|
||||
GLsizei count, GLenum type,
|
||||
const GLvoid *indices)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
if (_mesa_validate_DrawRangeElements( ctx, mode,
|
||||
start, end,
|
||||
count, type, indices ))
|
||||
GL_CALL(DrawElements)( mode, count, type, indices );
|
||||
CALL_DrawElements(GET_DISPATCH(), (mode, count, type, indices));
|
||||
}
|
||||
|
||||
/*
|
||||
* Eval Mesh
|
||||
*/
|
||||
|
||||
/* KW: If are compiling, we don't know whether eval will produce a
|
||||
* vertex when it is run in the future. If this is pure immediate
|
||||
* mode, eval is a noop if neither vertex map is enabled.
|
||||
/**
|
||||
* KW:
|
||||
* If are compiling, we don't know whether eval will produce a
|
||||
* vertex when it is run in the future. If this is pure immediate
|
||||
* mode, eval is a noop if neither vertex map is enabled.
|
||||
*
|
||||
* Thus we need to have a check in the display list code or
|
||||
* elsewhere for eval(1,2) vertices in the case where
|
||||
* map(1,2)_vertex is disabled, and to purge those vertices from
|
||||
* the vb.
|
||||
* Thus we need to have a check in the display list code or elsewhere
|
||||
* for eval(1,2) vertices in the case where map(1,2)_vertex is
|
||||
* disabled, and to purge those vertices from the vb.
|
||||
*/
|
||||
void GLAPIENTRY _mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
|
||||
void GLAPIENTRY
|
||||
_mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLint i;
|
||||
@@ -800,16 +811,17 @@ void GLAPIENTRY _mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 )
|
||||
du = ctx->Eval.MapGrid1du;
|
||||
u = ctx->Eval.MapGrid1u1 + i1 * du;
|
||||
|
||||
GL_CALL(Begin)( prim );
|
||||
CALL_Begin(GET_DISPATCH(), (prim));
|
||||
for (i=i1;i<=i2;i++,u+=du) {
|
||||
GL_CALL(EvalCoord1f)( u );
|
||||
CALL_EvalCoord1f(GET_DISPATCH(), (u));
|
||||
}
|
||||
GL_CALL(End)();
|
||||
CALL_End(GET_DISPATCH(), ());
|
||||
}
|
||||
|
||||
|
||||
|
||||
void GLAPIENTRY _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
|
||||
void GLAPIENTRY
|
||||
_mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLfloat u, du, v, dv, v1, u1;
|
||||
@@ -839,38 +851,38 @@ void GLAPIENTRY _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1,
|
||||
|
||||
switch (mode) {
|
||||
case GL_POINT:
|
||||
GL_CALL(Begin)( GL_POINTS );
|
||||
CALL_Begin(GET_DISPATCH(), (GL_POINTS));
|
||||
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
|
||||
for (u=u1,i=i1;i<=i2;i++,u+=du) {
|
||||
GL_CALL(EvalCoord2f)(u, v );
|
||||
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
|
||||
}
|
||||
}
|
||||
GL_CALL(End)();
|
||||
CALL_End(GET_DISPATCH(), ());
|
||||
break;
|
||||
case GL_LINE:
|
||||
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
|
||||
GL_CALL(Begin)( GL_LINE_STRIP );
|
||||
CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
|
||||
for (u=u1,i=i1;i<=i2;i++,u+=du) {
|
||||
GL_CALL(EvalCoord2f)(u, v );
|
||||
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
|
||||
}
|
||||
GL_CALL(End)();
|
||||
CALL_End(GET_DISPATCH(), ());
|
||||
}
|
||||
for (u=u1,i=i1;i<=i2;i++,u+=du) {
|
||||
GL_CALL(Begin)( GL_LINE_STRIP );
|
||||
CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
|
||||
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
|
||||
GL_CALL(EvalCoord2f)(u, v );
|
||||
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
|
||||
}
|
||||
GL_CALL(End)();
|
||||
CALL_End(GET_DISPATCH(), ());
|
||||
}
|
||||
break;
|
||||
case GL_FILL:
|
||||
for (v=v1,j=j1;j<j2;j++,v+=dv) {
|
||||
GL_CALL(Begin)( GL_TRIANGLE_STRIP );
|
||||
CALL_Begin(GET_DISPATCH(), (GL_TRIANGLE_STRIP));
|
||||
for (u=u1,i=i1;i<=i2;i++,u+=du) {
|
||||
GL_CALL(EvalCoord2f)(u, v );
|
||||
GL_CALL(EvalCoord2f)(u, v+dv );
|
||||
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
|
||||
CALL_EvalCoord2f(GET_DISPATCH(), (u, v+dv));
|
||||
}
|
||||
GL_CALL(End)();
|
||||
CALL_End(GET_DISPATCH(), ());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -881,12 +893,14 @@ void GLAPIENTRY _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1,
|
||||
|
||||
|
||||
|
||||
/* Build a vertexformat full of things to use outside begin/end pairs.
|
||||
/**
|
||||
* Build a vertexformat of functions to use outside begin/end pairs.
|
||||
*
|
||||
* TODO -- build a whole dispatch table for this purpose, and likewise
|
||||
* for inside begin/end.
|
||||
*/
|
||||
void _mesa_noop_vtxfmt_init( GLvertexformat *vfmt )
|
||||
void
|
||||
_mesa_noop_vtxfmt_init( GLvertexformat *vfmt )
|
||||
{
|
||||
vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */
|
||||
vfmt->Begin = _mesa_noop_Begin;
|
||||
@@ -897,7 +911,6 @@ void _mesa_noop_vtxfmt_init( GLvertexformat *vfmt )
|
||||
vfmt->Color4f = _mesa_noop_Color4f;
|
||||
vfmt->Color4fv = _mesa_noop_Color4fv;
|
||||
vfmt->EdgeFlag = _mesa_noop_EdgeFlag;
|
||||
vfmt->EdgeFlagv = _mesa_noop_EdgeFlagv;
|
||||
vfmt->End = _mesa_noop_End;
|
||||
vfmt->EvalCoord1f = _mesa_noop_EvalCoord1f;
|
||||
vfmt->EvalCoord1fv = _mesa_noop_EvalCoord1fv;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 4.1
|
||||
* Version: 6.5.1
|
||||
*
|
||||
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -26,122 +25,22 @@
|
||||
#ifndef _API_NOOP_H
|
||||
#define _API_NOOP_H
|
||||
|
||||
|
||||
#include "glheader.h"
|
||||
#include "mtypes.h"
|
||||
#include "context.h"
|
||||
|
||||
/* In states where certain vertex components are required for t&l or
|
||||
* rasterization, we still need to keep track of the current values.
|
||||
* These functions provide this service by keeping uptodate the
|
||||
* 'ctx->Current' struct for all data elements not included in the
|
||||
* currently enabled hardware vertex.
|
||||
*
|
||||
*/
|
||||
extern void GLAPIENTRY _mesa_noop_EdgeFlag( GLboolean b );
|
||||
extern void GLAPIENTRY _mesa_noop_EdgeFlagv( const GLboolean *b );
|
||||
extern void GLAPIENTRY
|
||||
_mesa_noop_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_FogCoordfEXT( GLfloat a );
|
||||
extern void GLAPIENTRY _mesa_noop_FogCoordfvEXT( const GLfloat *v );
|
||||
extern void GLAPIENTRY
|
||||
_mesa_noop_EvalMesh1(GLenum mode, GLint i1, GLint i2);
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_Indexf( GLfloat i );
|
||||
extern void GLAPIENTRY _mesa_noop_Indexfv( const GLfloat *v );
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_Normal3f( GLfloat a, GLfloat b, GLfloat c );
|
||||
extern void GLAPIENTRY _mesa_noop_Normal3fv( const GLfloat *v );
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_Materialfv( GLenum face, GLenum pname, const GLfloat *param );
|
||||
|
||||
extern void _mesa_noop_Color4ub( GLubyte a, GLubyte b, GLubyte c, GLubyte d );
|
||||
extern void _mesa_noop_Color4ubv( const GLubyte *v );
|
||||
extern void GLAPIENTRY _mesa_noop_Color4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d );
|
||||
extern void GLAPIENTRY _mesa_noop_Color4fv( const GLfloat *v );
|
||||
extern void _mesa_noop_Color3ub( GLubyte a, GLubyte b, GLubyte c );
|
||||
extern void _mesa_noop_Color3ubv( const GLubyte *v );
|
||||
extern void GLAPIENTRY _mesa_noop_Color3f( GLfloat a, GLfloat b, GLfloat c );
|
||||
extern void GLAPIENTRY _mesa_noop_Color3fv( const GLfloat *v );
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_MultiTexCoord1fARB( GLenum target, GLfloat a );
|
||||
extern void GLAPIENTRY _mesa_noop_MultiTexCoord1fvARB( GLenum target, const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_MultiTexCoord2fARB( GLenum target, GLfloat a, GLfloat b );
|
||||
extern void GLAPIENTRY _mesa_noop_MultiTexCoord2fvARB( GLenum target, const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_MultiTexCoord3fARB( GLenum target, GLfloat a, GLfloat b, GLfloat c);
|
||||
extern void GLAPIENTRY _mesa_noop_MultiTexCoord3fvARB( GLenum target, const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_MultiTexCoord4fARB( GLenum target, GLfloat a, GLfloat b, GLfloat c, GLfloat d );
|
||||
extern void GLAPIENTRY _mesa_noop_MultiTexCoord4fvARB( GLenum target, const GLfloat *v );
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_SecondaryColor3ubEXT( GLubyte a, GLubyte b, GLubyte c );
|
||||
extern void GLAPIENTRY _mesa_noop_SecondaryColor3ubvEXT( const GLubyte *v );
|
||||
extern void GLAPIENTRY _mesa_noop_SecondaryColor3fEXT( GLfloat a, GLfloat b, GLfloat c );
|
||||
extern void GLAPIENTRY _mesa_noop_SecondaryColor3fvEXT( const GLfloat *v );
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_TexCoord1f( GLfloat a );
|
||||
extern void GLAPIENTRY _mesa_noop_TexCoord1fv( const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_TexCoord2f( GLfloat a, GLfloat b );
|
||||
extern void GLAPIENTRY _mesa_noop_TexCoord2fv( const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_TexCoord3f( GLfloat a, GLfloat b, GLfloat c );
|
||||
extern void GLAPIENTRY _mesa_noop_TexCoord3fv( const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_TexCoord4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d );
|
||||
extern void GLAPIENTRY _mesa_noop_TexCoord4fv( const GLfloat *v );
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_Vertex2f( GLfloat a, GLfloat b );
|
||||
extern void GLAPIENTRY _mesa_noop_Vertex2fv( const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_Vertex3f( GLfloat a, GLfloat b, GLfloat c );
|
||||
extern void GLAPIENTRY _mesa_noop_Vertex3fv( const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_Vertex4f( GLfloat a, GLfloat b, GLfloat c, GLfloat d );
|
||||
extern void GLAPIENTRY _mesa_noop_Vertex4fv( const GLfloat *v );
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib1fNV( GLuint index, GLfloat x );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib1fvNV( GLuint index, const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib2fNV( GLuint index, GLfloat x, GLfloat y );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib2fvNV( GLuint index, const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib3fNV( GLuint index, GLfloat x, GLfloat y, GLfloat z );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib3fvNV( GLuint index, const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib4fNV( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib4fvNV( GLuint index, const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib1fARB( GLuint index, GLfloat x );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib1fvARB( GLuint index, const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib2fARB( GLuint index, GLfloat x, GLfloat y );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib2fvARB( GLuint index, const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib3fARB( GLuint index, GLfloat x, GLfloat y, GLfloat z );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib3fvARB( GLuint index, const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib4fARB( GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w );
|
||||
extern void GLAPIENTRY _mesa_noop_VertexAttrib4fvARB( GLuint index, const GLfloat *v );
|
||||
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_End( void );
|
||||
extern void GLAPIENTRY _mesa_noop_Begin( GLenum mode );
|
||||
extern void GLAPIENTRY _mesa_noop_EvalPoint2( GLint a, GLint b );
|
||||
extern void GLAPIENTRY _mesa_noop_EvalPoint1( GLint a );
|
||||
extern void GLAPIENTRY _mesa_noop_EvalCoord2fv( const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_EvalCoord2f( GLfloat a, GLfloat b );
|
||||
extern void GLAPIENTRY _mesa_noop_EvalCoord1fv( const GLfloat *v );
|
||||
extern void GLAPIENTRY _mesa_noop_EvalCoord1f( GLfloat a );
|
||||
|
||||
extern void _mesa_noop_vtxfmt_init( GLvertexformat *vfmt );
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2,
|
||||
GLint j1, GLint j2 );
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_EvalMesh1( GLenum mode, GLint i1, GLint i2 );
|
||||
|
||||
|
||||
/* Not strictly a noop -- translate Rectf down to Begin/End and
|
||||
* vertices. Closer to the loopback operations, but doesn't meet the
|
||||
* criteria for inclusion there (cannot be used in the Save table).
|
||||
*/
|
||||
extern void GLAPIENTRY _mesa_noop_Rectf( GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2 );
|
||||
|
||||
|
||||
extern void GLAPIENTRY _mesa_noop_DrawArrays(GLenum mode, GLint start, GLsizei count);
|
||||
extern void GLAPIENTRY _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type,
|
||||
const GLvoid *indices);
|
||||
extern void GLAPIENTRY _mesa_noop_DrawRangeElements(GLenum mode,
|
||||
GLuint start, GLuint end,
|
||||
GLsizei count, GLenum type,
|
||||
const GLvoid *indices);
|
||||
extern void GLAPIENTRY
|
||||
_mesa_noop_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
|
||||
|
||||
extern void GLAPIENTRY
|
||||
_mesa_noop_Materialfv(GLenum face, GLenum pname, const GLfloat *param);
|
||||
|
||||
extern void
|
||||
_mesa_noop_vtxfmt_init(GLvertexformat *vfmt);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -60,8 +60,8 @@ _mesa_validate_DrawElements(GLcontext *ctx,
|
||||
_mesa_update_state(ctx);
|
||||
|
||||
/* Always need vertex positions */
|
||||
if (!ctx->Array.Vertex.Enabled
|
||||
&& !(ctx->VertexProgram._Enabled && ctx->Array.VertexAttrib[0].Enabled))
|
||||
if (!ctx->Array.ArrayObj->Vertex.Enabled
|
||||
&& !(ctx->VertexProgram._Enabled && ctx->Array.ArrayObj->VertexAttrib[0].Enabled))
|
||||
return GL_FALSE;
|
||||
|
||||
/* Vertex buffer object tests */
|
||||
@@ -166,8 +166,8 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode,
|
||||
_mesa_update_state(ctx);
|
||||
|
||||
/* Always need vertex positions */
|
||||
if (!ctx->Array.Vertex.Enabled
|
||||
&& !(ctx->VertexProgram._Enabled && ctx->Array.VertexAttrib[0].Enabled))
|
||||
if (!ctx->Array.ArrayObj->Vertex.Enabled
|
||||
&& !(ctx->VertexProgram._Enabled && ctx->Array.ArrayObj->VertexAttrib[0].Enabled))
|
||||
return GL_FALSE;
|
||||
|
||||
if (ctx->Const.CheckArrayBounds) {
|
||||
@@ -226,7 +226,7 @@ _mesa_validate_DrawArrays(GLcontext *ctx,
|
||||
_mesa_update_state(ctx);
|
||||
|
||||
/* Always need vertex positions */
|
||||
if (!ctx->Array.Vertex.Enabled && !ctx->Array.VertexAttrib[0].Enabled)
|
||||
if (!ctx->Array.ArrayObj->Vertex.Enabled && !ctx->Array.ArrayObj->VertexAttrib[0].Enabled)
|
||||
return GL_FALSE;
|
||||
|
||||
if (ctx->Const.CheckArrayBounds) {
|
||||
|
||||
@@ -0,0 +1,419 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* (C) Copyright IBM Corporation 2006
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL OR IBM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file arrayobj.c
|
||||
* Functions for the GL_APPLE_vertex_array_object extension.
|
||||
*
|
||||
* \todo
|
||||
* The code in this file borrows a lot from bufferobj.c. There's a certain
|
||||
* amount of cruft left over from that origin that may be unnecessary.
|
||||
*
|
||||
* \author Ian Romanick <idr@us.ibm.com>
|
||||
* \author Brian Paul
|
||||
*/
|
||||
|
||||
|
||||
#include "glheader.h"
|
||||
#include "hash.h"
|
||||
#include "imports.h"
|
||||
#include "context.h"
|
||||
#if FEATURE_ARB_vertex_buffer_object
|
||||
#include "bufferobj.h"
|
||||
#endif
|
||||
#include "arrayobj.h"
|
||||
#include "dispatch.h"
|
||||
|
||||
|
||||
/**
|
||||
* Look up the array object for the given ID.
|
||||
*
|
||||
* \returns
|
||||
* Either a pointer to the array object with the specified ID or \c NULL for
|
||||
* a non-existent ID. The spec defines ID 0 as being technically
|
||||
* non-existent.
|
||||
*/
|
||||
|
||||
static INLINE struct gl_array_object *
|
||||
lookup_arrayobj(GLcontext *ctx, GLuint id)
|
||||
{
|
||||
return (id == 0)
|
||||
? NULL
|
||||
: (struct gl_array_object *) _mesa_HashLookup(ctx->Shared->ArrayObjects,
|
||||
id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Allocate and initialize a new vertex array object.
|
||||
*
|
||||
* This function is intended to be called via
|
||||
* \c dd_function_table::NewArrayObject.
|
||||
*/
|
||||
struct gl_array_object *
|
||||
_mesa_new_array_object( GLcontext *ctx, GLuint name )
|
||||
{
|
||||
struct gl_array_object *obj = MALLOC_STRUCT(gl_array_object);
|
||||
if (obj)
|
||||
_mesa_initialize_array_object(ctx, obj, name);
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete an array object.
|
||||
*
|
||||
* This function is intended to be called via
|
||||
* \c dd_function_table::DeleteArrayObject.
|
||||
*/
|
||||
void
|
||||
_mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj )
|
||||
{
|
||||
(void) ctx;
|
||||
_mesa_free(obj);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_initialize_array_object( GLcontext *ctx,
|
||||
struct gl_array_object *obj,
|
||||
GLuint name )
|
||||
{
|
||||
GLuint i;
|
||||
|
||||
obj->Name = name;
|
||||
|
||||
/* Vertex arrays */
|
||||
obj->Vertex.Size = 4;
|
||||
obj->Vertex.Type = GL_FLOAT;
|
||||
obj->Vertex.Stride = 0;
|
||||
obj->Vertex.StrideB = 0;
|
||||
obj->Vertex.Ptr = NULL;
|
||||
obj->Vertex.Enabled = GL_FALSE;
|
||||
obj->Vertex.Flags = CA_CLIENT_DATA;
|
||||
obj->Normal.Type = GL_FLOAT;
|
||||
obj->Normal.Stride = 0;
|
||||
obj->Normal.StrideB = 0;
|
||||
obj->Normal.Ptr = NULL;
|
||||
obj->Normal.Enabled = GL_FALSE;
|
||||
obj->Normal.Flags = CA_CLIENT_DATA;
|
||||
obj->Color.Size = 4;
|
||||
obj->Color.Type = GL_FLOAT;
|
||||
obj->Color.Stride = 0;
|
||||
obj->Color.StrideB = 0;
|
||||
obj->Color.Ptr = NULL;
|
||||
obj->Color.Enabled = GL_FALSE;
|
||||
obj->Color.Flags = CA_CLIENT_DATA;
|
||||
obj->SecondaryColor.Size = 4;
|
||||
obj->SecondaryColor.Type = GL_FLOAT;
|
||||
obj->SecondaryColor.Stride = 0;
|
||||
obj->SecondaryColor.StrideB = 0;
|
||||
obj->SecondaryColor.Ptr = NULL;
|
||||
obj->SecondaryColor.Enabled = GL_FALSE;
|
||||
obj->SecondaryColor.Flags = CA_CLIENT_DATA;
|
||||
obj->FogCoord.Size = 1;
|
||||
obj->FogCoord.Type = GL_FLOAT;
|
||||
obj->FogCoord.Stride = 0;
|
||||
obj->FogCoord.StrideB = 0;
|
||||
obj->FogCoord.Ptr = NULL;
|
||||
obj->FogCoord.Enabled = GL_FALSE;
|
||||
obj->FogCoord.Flags = CA_CLIENT_DATA;
|
||||
obj->Index.Type = GL_FLOAT;
|
||||
obj->Index.Stride = 0;
|
||||
obj->Index.StrideB = 0;
|
||||
obj->Index.Ptr = NULL;
|
||||
obj->Index.Enabled = GL_FALSE;
|
||||
obj->Index.Flags = CA_CLIENT_DATA;
|
||||
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
|
||||
obj->TexCoord[i].Size = 4;
|
||||
obj->TexCoord[i].Type = GL_FLOAT;
|
||||
obj->TexCoord[i].Stride = 0;
|
||||
obj->TexCoord[i].StrideB = 0;
|
||||
obj->TexCoord[i].Ptr = NULL;
|
||||
obj->TexCoord[i].Enabled = GL_FALSE;
|
||||
obj->TexCoord[i].Flags = CA_CLIENT_DATA;
|
||||
}
|
||||
obj->EdgeFlag.Stride = 0;
|
||||
obj->EdgeFlag.StrideB = 0;
|
||||
obj->EdgeFlag.Ptr = NULL;
|
||||
obj->EdgeFlag.Enabled = GL_FALSE;
|
||||
obj->EdgeFlag.Flags = CA_CLIENT_DATA;
|
||||
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
|
||||
obj->VertexAttrib[i].Size = 4;
|
||||
obj->VertexAttrib[i].Type = GL_FLOAT;
|
||||
obj->VertexAttrib[i].Stride = 0;
|
||||
obj->VertexAttrib[i].StrideB = 0;
|
||||
obj->VertexAttrib[i].Ptr = NULL;
|
||||
obj->VertexAttrib[i].Enabled = GL_FALSE;
|
||||
obj->VertexAttrib[i].Normalized = GL_FALSE;
|
||||
obj->VertexAttrib[i].Flags = CA_CLIENT_DATA;
|
||||
}
|
||||
|
||||
#if FEATURE_ARB_vertex_buffer_object
|
||||
/* Vertex array buffers */
|
||||
obj->Vertex.BufferObj = ctx->Array.NullBufferObj;
|
||||
obj->Normal.BufferObj = ctx->Array.NullBufferObj;
|
||||
obj->Color.BufferObj = ctx->Array.NullBufferObj;
|
||||
obj->SecondaryColor.BufferObj = ctx->Array.NullBufferObj;
|
||||
obj->FogCoord.BufferObj = ctx->Array.NullBufferObj;
|
||||
obj->Index.BufferObj = ctx->Array.NullBufferObj;
|
||||
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
|
||||
obj->TexCoord[i].BufferObj = ctx->Array.NullBufferObj;
|
||||
}
|
||||
obj->EdgeFlag.BufferObj = ctx->Array.NullBufferObj;
|
||||
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
|
||||
obj->VertexAttrib[i].BufferObj = ctx->Array.NullBufferObj;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add the given array object to the array object pool.
|
||||
*/
|
||||
void
|
||||
_mesa_save_array_object( GLcontext *ctx, struct gl_array_object *obj )
|
||||
{
|
||||
if (obj->Name > 0) {
|
||||
/* insert into hash table */
|
||||
_mesa_HashInsert(ctx->Shared->ArrayObjects, obj->Name, obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Remove the given array object from the array object pool.
|
||||
* Do not deallocate the array object though.
|
||||
*/
|
||||
void
|
||||
_mesa_remove_array_object( GLcontext *ctx, struct gl_array_object *obj )
|
||||
{
|
||||
if (obj->Name > 0) {
|
||||
/* remove from hash table */
|
||||
_mesa_HashRemove(ctx->Shared->ArrayObjects, obj->Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* API Functions */
|
||||
/**********************************************************************/
|
||||
|
||||
/**
|
||||
* Bind a new array.
|
||||
*
|
||||
* \todo
|
||||
* The binding could be done more efficiently by comparing the non-NULL
|
||||
* pointers in the old and new objects. The only arrays that are "dirty" are
|
||||
* the ones that are non-NULL in either object.
|
||||
*/
|
||||
void GLAPIENTRY
|
||||
_mesa_BindVertexArrayAPPLE( GLuint id )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_array_object * const oldObj = ctx->Array.ArrayObj;
|
||||
struct gl_array_object *newObj = NULL;
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
||||
ASSERT(oldObj != NULL);
|
||||
|
||||
if ( oldObj->Name == id )
|
||||
return; /* rebinding the same array object- no change */
|
||||
|
||||
/*
|
||||
* Get pointer to new array object (newBufObj)
|
||||
*/
|
||||
if (id == 0) {
|
||||
/* The spec says there is no array object named 0, but we use
|
||||
* one internally because it simplifies things.
|
||||
*/
|
||||
newObj = ctx->Array.DefaultArrayObj;
|
||||
}
|
||||
else {
|
||||
/* non-default array object */
|
||||
newObj = lookup_arrayobj(ctx, id);
|
||||
if (!newObj) {
|
||||
/* If this is a new array object id, allocate an array object now.
|
||||
*/
|
||||
|
||||
newObj = (*ctx->Driver.NewArrayObject)(ctx, id);
|
||||
if (!newObj) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindVertexArrayAPPLE");
|
||||
return;
|
||||
}
|
||||
_mesa_save_array_object(ctx, newObj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ctx->NewState |= _NEW_ARRAY;
|
||||
ctx->Array.NewState |= _NEW_ARRAY_ALL;
|
||||
ctx->Array.ArrayObj = newObj;
|
||||
|
||||
|
||||
/* Pass BindVertexArray call to device driver */
|
||||
if (ctx->Driver.BindArrayObject && newObj)
|
||||
(*ctx->Driver.BindArrayObject)( ctx, newObj );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete a set of array objects.
|
||||
*
|
||||
* \param n Number of array objects to delete.
|
||||
* \param ids Array of \c n array object IDs.
|
||||
*/
|
||||
void GLAPIENTRY
|
||||
_mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLsizei i;
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
||||
if (n < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glDeleteVertexArrayAPPLE(n)");
|
||||
return;
|
||||
}
|
||||
|
||||
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
struct gl_array_object *obj = lookup_arrayobj(ctx, ids[i]);
|
||||
|
||||
if ( obj != NULL ) {
|
||||
ASSERT( obj->Name == ids[i] );
|
||||
|
||||
|
||||
/* If the array object is currently bound, the spec says "the binding
|
||||
* for that object reverts to zero and the default vertex array
|
||||
* becomes current."
|
||||
*/
|
||||
if ( obj == ctx->Array.ArrayObj ) {
|
||||
CALL_BindVertexArrayAPPLE( ctx->Exec, (0) );
|
||||
}
|
||||
|
||||
#if FEATURE_ARB_vertex_buffer_object
|
||||
/* Unbind any buffer objects that might be bound to arrays in
|
||||
* this array object.
|
||||
*/
|
||||
_mesa_unbind_buffer_object( ctx, obj->Vertex.BufferObj );
|
||||
_mesa_unbind_buffer_object( ctx, obj->Normal.BufferObj );
|
||||
_mesa_unbind_buffer_object( ctx, obj->Color.BufferObj );
|
||||
_mesa_unbind_buffer_object( ctx, obj->SecondaryColor.BufferObj );
|
||||
_mesa_unbind_buffer_object( ctx, obj->FogCoord.BufferObj );
|
||||
_mesa_unbind_buffer_object( ctx, obj->Index.BufferObj );
|
||||
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
|
||||
_mesa_unbind_buffer_object( ctx, obj->TexCoord[i].BufferObj );
|
||||
}
|
||||
_mesa_unbind_buffer_object( ctx, obj->EdgeFlag.BufferObj );
|
||||
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
|
||||
_mesa_unbind_buffer_object( ctx, obj->VertexAttrib[i].BufferObj );
|
||||
}
|
||||
#endif
|
||||
|
||||
/* The ID is immediately freed for re-use */
|
||||
_mesa_remove_array_object(ctx, obj);
|
||||
ctx->Driver.DeleteArrayObject(ctx, obj);
|
||||
}
|
||||
}
|
||||
|
||||
_glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate a set of unique array object IDs and store them in \c arrays.
|
||||
*
|
||||
* \param n Number of IDs to generate.
|
||||
* \param arrays Array of \c n locations to store the IDs.
|
||||
*/
|
||||
void GLAPIENTRY
|
||||
_mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *arrays)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
GLuint first;
|
||||
GLint i;
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
||||
if (n < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glGenVertexArraysAPPLE");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!arrays) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* This must be atomic (generation and allocation of array object IDs)
|
||||
*/
|
||||
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
|
||||
|
||||
first = _mesa_HashFindFreeKeyBlock(ctx->Shared->ArrayObjects, n);
|
||||
|
||||
/* Allocate new, empty array objects and return identifiers */
|
||||
for (i = 0; i < n; i++) {
|
||||
struct gl_array_object *obj;
|
||||
GLuint name = first + i;
|
||||
|
||||
obj = (*ctx->Driver.NewArrayObject)( ctx, name );
|
||||
if (!obj) {
|
||||
_glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenVertexArraysAPPLE");
|
||||
return;
|
||||
}
|
||||
_mesa_save_array_object(ctx, obj);
|
||||
arrays[i] = first + i;
|
||||
}
|
||||
|
||||
_glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine if ID is the name of an array object.
|
||||
*
|
||||
* \param id ID of the potential array object.
|
||||
* \return \c GL_TRUE if \c id is the name of a array object,
|
||||
* \c GL_FALSE otherwise.
|
||||
*/
|
||||
GLboolean GLAPIENTRY
|
||||
_mesa_IsVertexArrayAPPLE( GLuint id )
|
||||
{
|
||||
struct gl_array_object * obj;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
|
||||
|
||||
if (id == 0)
|
||||
return GL_FALSE;
|
||||
|
||||
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
|
||||
obj = lookup_arrayobj(ctx, id);
|
||||
_glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
|
||||
|
||||
return (obj != NULL) ? GL_TRUE : GL_FALSE;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* (C) Copyright IBM Corporation 2006
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL OR IBM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef ARRAYOBJ_H
|
||||
#define ARRAYOBJ_H
|
||||
|
||||
#include "context.h"
|
||||
|
||||
/**
|
||||
* \file arrayobj.h
|
||||
* Functions for the GL_APPLE_vertex_array_object extension.
|
||||
*
|
||||
* \author Ian Romanick <idr@us.ibm.com>
|
||||
* \author Brian Paul
|
||||
*/
|
||||
|
||||
/*
|
||||
* Internal functions
|
||||
*/
|
||||
|
||||
struct gl_array_object * _mesa_new_array_object( GLcontext *ctx,
|
||||
GLuint name );
|
||||
|
||||
void _mesa_delete_array_object( GLcontext *ctx, struct gl_array_object *obj );
|
||||
|
||||
void _mesa_initialize_array_object( GLcontext *ctx,
|
||||
struct gl_array_object *obj, GLuint name );
|
||||
|
||||
void _mesa_save_array_object( GLcontext *ctx, struct gl_array_object *obj );
|
||||
|
||||
void _mesa_remove_array_object( GLcontext *ctx, struct gl_array_object *obj );
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* API functions
|
||||
*/
|
||||
|
||||
void GLAPIENTRY _mesa_BindVertexArrayAPPLE( GLuint id );
|
||||
|
||||
void GLAPIENTRY _mesa_DeleteVertexArraysAPPLE(GLsizei n, const GLuint *ids);
|
||||
|
||||
void GLAPIENTRY _mesa_GenVertexArraysAPPLE(GLsizei n, GLuint *buffer);
|
||||
|
||||
GLboolean GLAPIENTRY _mesa_IsVertexArrayAPPLE( GLuint id );
|
||||
|
||||
#endif /* ARRAYOBJ_H */
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.3
|
||||
* Version: 6.5.2
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "glheader.h"
|
||||
#include "imports.h"
|
||||
#include "accum.h"
|
||||
#include "arrayobj.h"
|
||||
#include "attrib.h"
|
||||
#include "blend.h"
|
||||
#include "buffers.h"
|
||||
@@ -50,7 +51,7 @@
|
||||
#include "math/m_xform.h"
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Allocate a new attribute state node. These nodes have a
|
||||
* "kind" value and a pointer to a struct of state data.
|
||||
*/
|
||||
@@ -147,7 +148,7 @@ _mesa_PushAttrib(GLbitfield mask)
|
||||
attr->DepthTest = ctx->Depth.Test;
|
||||
attr->Dither = ctx->Color.DitherFlag;
|
||||
attr->Fog = ctx->Fog.Enabled;
|
||||
for (i=0;i<MAX_LIGHTS;i++) {
|
||||
for (i = 0; i < ctx->Const.MaxLights; i++) {
|
||||
attr->Light[i] = ctx->Light.Light[i].Enabled;
|
||||
}
|
||||
attr->Lighting = ctx->Light.Enabled;
|
||||
@@ -179,7 +180,6 @@ _mesa_PushAttrib(GLbitfield mask)
|
||||
MEMCPY(attr->Map2Attrib, ctx->Eval.Map2Attrib, sizeof(ctx->Eval.Map2Attrib));
|
||||
attr->Normalize = ctx->Transform.Normalize;
|
||||
attr->RasterPositionUnclipped = ctx->Transform.RasterPositionUnclipped;
|
||||
attr->PixelTexture = ctx->Pixel.PixelTextureEnabled;
|
||||
attr->PointSmooth = ctx->Point.SmoothFlag;
|
||||
attr->PointSprite = ctx->Point.PointSprite;
|
||||
attr->PolygonOffsetPoint = ctx->Polygon.OffsetPoint;
|
||||
@@ -276,6 +276,8 @@ _mesa_PushAttrib(GLbitfield mask)
|
||||
struct gl_pixel_attrib *attr;
|
||||
attr = MALLOC_STRUCT( gl_pixel_attrib );
|
||||
MEMCPY( attr, &ctx->Pixel, sizeof(struct gl_pixel_attrib) );
|
||||
/* push the Read FBO's ReadBuffer state, not ctx->Pixel.ReadBuffer */
|
||||
attr->ReadBuffer = ctx->ReadBuffer->ColorReadBuffer;
|
||||
newnode = new_attrib_node( GL_PIXEL_MODE_BIT );
|
||||
newnode->data = attr;
|
||||
newnode->next = head;
|
||||
@@ -335,6 +337,8 @@ _mesa_PushAttrib(GLbitfield mask)
|
||||
if (mask & GL_TEXTURE_BIT) {
|
||||
struct gl_texture_attrib *attr;
|
||||
GLuint u;
|
||||
|
||||
_mesa_lock_context_textures(ctx);
|
||||
/* Bump the texture object reference counts so that they don't
|
||||
* inadvertantly get deleted.
|
||||
*/
|
||||
@@ -360,6 +364,9 @@ _mesa_PushAttrib(GLbitfield mask)
|
||||
_mesa_copy_texture_object(&attr->Unit[u].SavedRect,
|
||||
attr->Unit[u].CurrentRect);
|
||||
}
|
||||
|
||||
_mesa_unlock_context_textures(ctx);
|
||||
|
||||
newnode = new_attrib_node( GL_TEXTURE_BIT );
|
||||
newnode->data = attr;
|
||||
newnode->next = head;
|
||||
@@ -499,8 +506,6 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
|
||||
TEST_AND_UPDATE(ctx->Transform.RasterPositionUnclipped,
|
||||
enable->RasterPositionUnclipped,
|
||||
GL_RASTER_POSITION_UNCLIPPED_IBM);
|
||||
TEST_AND_UPDATE(ctx->Pixel.PixelTextureEnabled, enable->PixelTexture,
|
||||
GL_POINT_SMOOTH);
|
||||
TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth,
|
||||
GL_POINT_SMOOTH);
|
||||
if (ctx->Extensions.NV_point_sprite || ctx->Extensions.ARB_point_sprite) {
|
||||
@@ -536,16 +541,16 @@ pop_enable_group(GLcontext *ctx, const struct gl_enable_attrib *enable)
|
||||
TEST_AND_UPDATE(ctx->Multisample.SampleCoverageInvert,
|
||||
enable->SampleCoverageInvert,
|
||||
GL_SAMPLE_COVERAGE_INVERT_ARB);
|
||||
/* GL_NV_vertex_program */
|
||||
/* GL_ARB_vertex_program, GL_NV_vertex_program */
|
||||
TEST_AND_UPDATE(ctx->VertexProgram.Enabled,
|
||||
enable->VertexProgram,
|
||||
GL_VERTEX_PROGRAM_NV);
|
||||
GL_VERTEX_PROGRAM_ARB);
|
||||
TEST_AND_UPDATE(ctx->VertexProgram.PointSizeEnabled,
|
||||
enable->VertexProgramPointSize,
|
||||
GL_VERTEX_PROGRAM_POINT_SIZE_NV);
|
||||
GL_VERTEX_PROGRAM_POINT_SIZE_ARB);
|
||||
TEST_AND_UPDATE(ctx->VertexProgram.TwoSideEnabled,
|
||||
enable->VertexProgramTwoSide,
|
||||
GL_VERTEX_PROGRAM_TWO_SIDE_NV);
|
||||
GL_VERTEX_PROGRAM_TWO_SIDE_ARB);
|
||||
|
||||
#undef TEST_AND_UPDATE
|
||||
|
||||
@@ -618,18 +623,18 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib)
|
||||
|
||||
_mesa_ActiveTextureARB(GL_TEXTURE0_ARB + u);
|
||||
_mesa_set_enable(ctx, GL_TEXTURE_1D,
|
||||
(GLboolean) (unit->Enabled & TEXTURE_1D_BIT ? GL_TRUE : GL_FALSE));
|
||||
(unit->Enabled & TEXTURE_1D_BIT) ? GL_TRUE : GL_FALSE);
|
||||
_mesa_set_enable(ctx, GL_TEXTURE_2D,
|
||||
(GLboolean) (unit->Enabled & TEXTURE_2D_BIT ? GL_TRUE : GL_FALSE));
|
||||
(unit->Enabled & TEXTURE_2D_BIT) ? GL_TRUE : GL_FALSE);
|
||||
_mesa_set_enable(ctx, GL_TEXTURE_3D,
|
||||
(GLboolean) (unit->Enabled & TEXTURE_3D_BIT ? GL_TRUE : GL_FALSE));
|
||||
(unit->Enabled & TEXTURE_3D_BIT) ? GL_TRUE : GL_FALSE);
|
||||
if (ctx->Extensions.ARB_texture_cube_map) {
|
||||
_mesa_set_enable(ctx, GL_TEXTURE_CUBE_MAP_ARB,
|
||||
(GLboolean) (unit->Enabled & TEXTURE_CUBE_BIT ? GL_TRUE : GL_FALSE));
|
||||
(unit->Enabled & TEXTURE_CUBE_BIT) ? GL_TRUE : GL_FALSE);
|
||||
}
|
||||
if (ctx->Extensions.NV_texture_rectangle) {
|
||||
_mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE_NV,
|
||||
(GLboolean) (unit->Enabled & TEXTURE_RECT_BIT ? GL_TRUE : GL_FALSE));
|
||||
(unit->Enabled & TEXTURE_RECT_BIT) ? GL_TRUE : GL_FALSE);
|
||||
}
|
||||
if (ctx->Extensions.SGI_texture_color_table) {
|
||||
_mesa_set_enable(ctx, GL_TEXTURE_COLOR_TABLE_SGI,
|
||||
@@ -645,10 +650,28 @@ pop_texture_group(GLcontext *ctx, const struct gl_texture_attrib *texAttrib)
|
||||
_mesa_TexGenfv(GL_T, GL_OBJECT_PLANE, unit->ObjectPlaneT);
|
||||
_mesa_TexGenfv(GL_R, GL_OBJECT_PLANE, unit->ObjectPlaneR);
|
||||
_mesa_TexGenfv(GL_Q, GL_OBJECT_PLANE, unit->ObjectPlaneQ);
|
||||
_mesa_TexGenfv(GL_S, GL_EYE_PLANE, unit->EyePlaneS);
|
||||
_mesa_TexGenfv(GL_T, GL_EYE_PLANE, unit->EyePlaneT);
|
||||
_mesa_TexGenfv(GL_R, GL_EYE_PLANE, unit->EyePlaneR);
|
||||
_mesa_TexGenfv(GL_Q, GL_EYE_PLANE, unit->EyePlaneQ);
|
||||
/* Eye plane done differently to avoid re-transformation */
|
||||
{
|
||||
struct gl_texture_unit *destUnit = &ctx->Texture.Unit[u];
|
||||
COPY_4FV(destUnit->EyePlaneS, unit->EyePlaneS);
|
||||
COPY_4FV(destUnit->EyePlaneT, unit->EyePlaneT);
|
||||
COPY_4FV(destUnit->EyePlaneR, unit->EyePlaneR);
|
||||
COPY_4FV(destUnit->EyePlaneQ, unit->EyePlaneQ);
|
||||
if (ctx->Driver.TexGen) {
|
||||
ctx->Driver.TexGen(ctx, GL_S, GL_EYE_PLANE, unit->EyePlaneS);
|
||||
ctx->Driver.TexGen(ctx, GL_T, GL_EYE_PLANE, unit->EyePlaneT);
|
||||
ctx->Driver.TexGen(ctx, GL_R, GL_EYE_PLANE, unit->EyePlaneR);
|
||||
ctx->Driver.TexGen(ctx, GL_Q, GL_EYE_PLANE, unit->EyePlaneQ);
|
||||
}
|
||||
}
|
||||
_mesa_set_enable(ctx, GL_TEXTURE_GEN_S,
|
||||
((unit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE));
|
||||
_mesa_set_enable(ctx, GL_TEXTURE_GEN_T,
|
||||
((unit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE));
|
||||
_mesa_set_enable(ctx, GL_TEXTURE_GEN_R,
|
||||
((unit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE));
|
||||
_mesa_set_enable(ctx, GL_TEXTURE_GEN_Q,
|
||||
((unit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE));
|
||||
if (ctx->Extensions.EXT_texture_lod_bias) {
|
||||
_mesa_TexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT,
|
||||
GL_TEXTURE_LOD_BIAS_EXT, unit->LodBias);
|
||||
@@ -833,8 +856,36 @@ _mesa_PopAttrib(void)
|
||||
(GLboolean) (color->ColorMask[1] != 0),
|
||||
(GLboolean) (color->ColorMask[2] != 0),
|
||||
(GLboolean) (color->ColorMask[3] != 0));
|
||||
_mesa_DrawBuffersARB(ctx->Const.MaxDrawBuffers,
|
||||
color->DrawBuffer);
|
||||
{
|
||||
/* Need to determine if more than one color output is
|
||||
* specified. If so, call glDrawBuffersARB, else call
|
||||
* glDrawBuffer(). This is a subtle, but essential point
|
||||
* since GL_FRONT (for example) is illegal for the former
|
||||
* function, but legal for the later.
|
||||
*/
|
||||
GLboolean multipleBuffers = GL_FALSE;
|
||||
if (ctx->Extensions.ARB_draw_buffers) {
|
||||
GLuint i;
|
||||
for (i = 1; i < ctx->Const.MaxDrawBuffers; i++) {
|
||||
if (color->DrawBuffer[i] != GL_NONE) {
|
||||
multipleBuffers = GL_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Call the API_level functions, not _mesa_drawbuffers()
|
||||
* since we need to do error checking on the pop'd
|
||||
* GL_DRAW_BUFFER.
|
||||
* Ex: if GL_FRONT were pushed, but we're popping with a
|
||||
* user FBO bound, GL_FRONT will be illegal and we'll need
|
||||
* to record that error. Per OpenGL ARB decision.
|
||||
*/
|
||||
if (multipleBuffers)
|
||||
_mesa_DrawBuffersARB(ctx->Const.MaxDrawBuffers,
|
||||
color->DrawBuffer);
|
||||
else
|
||||
_mesa_DrawBuffer(color->DrawBuffer[0]);
|
||||
}
|
||||
_mesa_set_enable(ctx, GL_ALPHA_TEST, color->AlphaEnabled);
|
||||
_mesa_AlphaFunc(color->AlphaFunc, color->AlphaRef);
|
||||
_mesa_set_enable(ctx, GL_BLEND, color->BlendEnabled);
|
||||
@@ -877,9 +928,6 @@ _mesa_PopAttrib(void)
|
||||
_mesa_ClearDepth(depth->Clear);
|
||||
_mesa_set_enable(ctx, GL_DEPTH_TEST, depth->Test);
|
||||
_mesa_DepthMask(depth->Mask);
|
||||
if (ctx->Extensions.HP_occlusion_test)
|
||||
_mesa_set_enable(ctx, GL_OCCLUSION_TEST_HP,
|
||||
depth->OcclusionTest);
|
||||
}
|
||||
break;
|
||||
case GL_ENABLE_BIT:
|
||||
@@ -932,29 +980,25 @@ _mesa_PopAttrib(void)
|
||||
/* lighting enable */
|
||||
_mesa_set_enable(ctx, GL_LIGHTING, light->Enabled);
|
||||
/* per-light state */
|
||||
if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY_INVERSE)
|
||||
if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top))
|
||||
_math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
|
||||
|
||||
for (i = 0; i < MAX_LIGHTS; i++) {
|
||||
GLenum lgt = (GLenum) (GL_LIGHT0 + i);
|
||||
for (i = 0; i < ctx->Const.MaxLights; i++) {
|
||||
const struct gl_light *l = &light->Light[i];
|
||||
GLfloat tmp[4];
|
||||
_mesa_set_enable(ctx, lgt, l->Enabled);
|
||||
_mesa_Lightfv( lgt, GL_AMBIENT, l->Ambient );
|
||||
_mesa_Lightfv( lgt, GL_DIFFUSE, l->Diffuse );
|
||||
_mesa_Lightfv( lgt, GL_SPECULAR, l->Specular );
|
||||
TRANSFORM_POINT( tmp, ctx->ModelviewMatrixStack.Top->inv, l->EyePosition );
|
||||
_mesa_Lightfv( lgt, GL_POSITION, tmp );
|
||||
TRANSFORM_POINT( tmp, ctx->ModelviewMatrixStack.Top->m, l->EyeDirection );
|
||||
_mesa_Lightfv( lgt, GL_SPOT_DIRECTION, tmp );
|
||||
_mesa_Lightfv( lgt, GL_SPOT_EXPONENT, &l->SpotExponent );
|
||||
_mesa_Lightfv( lgt, GL_SPOT_CUTOFF, &l->SpotCutoff );
|
||||
_mesa_Lightfv( lgt, GL_CONSTANT_ATTENUATION,
|
||||
&l->ConstantAttenuation );
|
||||
_mesa_Lightfv( lgt, GL_LINEAR_ATTENUATION,
|
||||
&l->LinearAttenuation );
|
||||
_mesa_Lightfv( lgt, GL_QUADRATIC_ATTENUATION,
|
||||
&l->QuadraticAttenuation );
|
||||
_mesa_set_enable(ctx, GL_LIGHT0 + i, l->Enabled);
|
||||
_mesa_light(ctx, i, GL_AMBIENT, l->Ambient);
|
||||
_mesa_light(ctx, i, GL_DIFFUSE, l->Diffuse);
|
||||
_mesa_light(ctx, i, GL_SPECULAR, l->Specular );
|
||||
_mesa_light(ctx, i, GL_POSITION, l->EyePosition);
|
||||
_mesa_light(ctx, i, GL_SPOT_DIRECTION, l->EyeDirection);
|
||||
_mesa_light(ctx, i, GL_SPOT_EXPONENT, &l->SpotExponent);
|
||||
_mesa_light(ctx, i, GL_SPOT_CUTOFF, &l->SpotCutoff);
|
||||
_mesa_light(ctx, i, GL_CONSTANT_ATTENUATION,
|
||||
&l->ConstantAttenuation);
|
||||
_mesa_light(ctx, i, GL_LINEAR_ATTENUATION,
|
||||
&l->LinearAttenuation);
|
||||
_mesa_light(ctx, i, GL_QUADRATIC_ATTENUATION,
|
||||
&l->QuadraticAttenuation);
|
||||
}
|
||||
/* light model */
|
||||
_mesa_LightModelfv(GL_LIGHT_MODEL_AMBIENT,
|
||||
@@ -965,9 +1009,6 @@ _mesa_PopAttrib(void)
|
||||
(GLfloat) light->Model.TwoSide);
|
||||
_mesa_LightModelf(GL_LIGHT_MODEL_COLOR_CONTROL,
|
||||
(GLfloat) light->Model.ColorControl);
|
||||
/* materials */
|
||||
MEMCPY(&ctx->Light.Material, &light->Material,
|
||||
sizeof(struct gl_material));
|
||||
/* shade model */
|
||||
_mesa_ShadeModel(light->ShadeModel);
|
||||
/* color material */
|
||||
@@ -975,6 +1016,9 @@ _mesa_PopAttrib(void)
|
||||
light->ColorMaterialMode);
|
||||
_mesa_set_enable(ctx, GL_COLOR_MATERIAL,
|
||||
light->ColorMaterialEnabled);
|
||||
/* materials */
|
||||
MEMCPY(&ctx->Light.Material, &light->Material,
|
||||
sizeof(struct gl_material));
|
||||
}
|
||||
break;
|
||||
case GL_LINE_BIT:
|
||||
@@ -992,6 +1036,8 @@ _mesa_PopAttrib(void)
|
||||
break;
|
||||
case GL_PIXEL_MODE_BIT:
|
||||
MEMCPY( &ctx->Pixel, attr->data, sizeof(struct gl_pixel_attrib) );
|
||||
/* XXX what other pixel state needs to be set by function calls? */
|
||||
_mesa_ReadBuffer(ctx->Pixel.ReadBuffer);
|
||||
ctx->NewState |= _NEW_PIXEL;
|
||||
break;
|
||||
case GL_POINT_BIT:
|
||||
@@ -1063,26 +1109,34 @@ _mesa_PopAttrib(void)
|
||||
break;
|
||||
case GL_STENCIL_BUFFER_BIT:
|
||||
{
|
||||
GLint face;
|
||||
const struct gl_stencil_attrib *stencil;
|
||||
stencil = (const struct gl_stencil_attrib *) attr->data;
|
||||
_mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled);
|
||||
_mesa_ClearStencil(stencil->Clear);
|
||||
face = stencil->ActiveFace;
|
||||
if (ctx->Extensions.EXT_stencil_two_side) {
|
||||
_mesa_set_enable(ctx, GL_STENCIL_TEST_TWO_SIDE_EXT, stencil->TestTwoSide);
|
||||
face ^= 1;
|
||||
_mesa_set_enable(ctx, GL_STENCIL_TEST_TWO_SIDE_EXT,
|
||||
stencil->TestTwoSide);
|
||||
_mesa_ActiveStencilFaceEXT(stencil->ActiveFace
|
||||
? GL_BACK : GL_FRONT);
|
||||
}
|
||||
do {
|
||||
_mesa_ActiveStencilFaceEXT(face);
|
||||
_mesa_StencilFunc(stencil->Function[face], stencil->Ref[face],
|
||||
stencil->ValueMask[face]);
|
||||
_mesa_StencilMask(stencil->WriteMask[face]);
|
||||
_mesa_StencilOp(stencil->FailFunc[face],
|
||||
stencil->ZFailFunc[face],
|
||||
stencil->ZPassFunc[face]);
|
||||
face ^= 1;
|
||||
} while (face != (stencil->ActiveFace ^ 1));
|
||||
/* front state */
|
||||
_mesa_StencilFuncSeparate(GL_FRONT,
|
||||
stencil->Function[0],
|
||||
stencil->Ref[0],
|
||||
stencil->ValueMask[0]);
|
||||
_mesa_StencilMaskSeparate(GL_FRONT, stencil->WriteMask[0]);
|
||||
_mesa_StencilOpSeparate(GL_FRONT, stencil->FailFunc[0],
|
||||
stencil->ZFailFunc[0],
|
||||
stencil->ZPassFunc[0]);
|
||||
/* back state */
|
||||
_mesa_StencilFuncSeparate(GL_BACK,
|
||||
stencil->Function[1],
|
||||
stencil->Ref[1],
|
||||
stencil->ValueMask[1]);
|
||||
_mesa_StencilMaskSeparate(GL_BACK, stencil->WriteMask[1]);
|
||||
_mesa_StencilOpSeparate(GL_BACK, stencil->FailFunc[1],
|
||||
stencil->ZFailFunc[1],
|
||||
stencil->ZPassFunc[1]);
|
||||
}
|
||||
break;
|
||||
case GL_TRANSFORM_BIT:
|
||||
@@ -1091,7 +1145,7 @@ _mesa_PopAttrib(void)
|
||||
const struct gl_transform_attrib *xform;
|
||||
xform = (const struct gl_transform_attrib *) attr->data;
|
||||
_mesa_MatrixMode(xform->MatrixMode);
|
||||
if (ctx->ProjectionMatrixStack.Top->flags & MAT_DIRTY)
|
||||
if (_math_matrix_is_dirty(ctx->ProjectionMatrixStack.Top))
|
||||
_math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
|
||||
|
||||
/* restore clip planes */
|
||||
@@ -1164,17 +1218,17 @@ static void
|
||||
adjust_buffer_object_ref_counts(struct gl_array_attrib *array, GLint step)
|
||||
{
|
||||
GLuint i;
|
||||
array->Vertex.BufferObj->RefCount += step;
|
||||
array->Normal.BufferObj->RefCount += step;
|
||||
array->Color.BufferObj->RefCount += step;
|
||||
array->SecondaryColor.BufferObj->RefCount += step;
|
||||
array->FogCoord.BufferObj->RefCount += step;
|
||||
array->Index.BufferObj->RefCount += step;
|
||||
array->EdgeFlag.BufferObj->RefCount += step;
|
||||
array->ArrayObj->Vertex.BufferObj->RefCount += step;
|
||||
array->ArrayObj->Normal.BufferObj->RefCount += step;
|
||||
array->ArrayObj->Color.BufferObj->RefCount += step;
|
||||
array->ArrayObj->SecondaryColor.BufferObj->RefCount += step;
|
||||
array->ArrayObj->FogCoord.BufferObj->RefCount += step;
|
||||
array->ArrayObj->Index.BufferObj->RefCount += step;
|
||||
array->ArrayObj->EdgeFlag.BufferObj->RefCount += step;
|
||||
for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++)
|
||||
array->TexCoord[i].BufferObj->RefCount += step;
|
||||
array->ArrayObj->TexCoord[i].BufferObj->RefCount += step;
|
||||
for (i = 0; i < VERT_ATTRIB_MAX; i++)
|
||||
array->VertexAttrib[i].BufferObj->RefCount += step;
|
||||
array->ArrayObj->VertexAttrib[i].BufferObj->RefCount += step;
|
||||
|
||||
array->ArrayBufferObj->RefCount += step;
|
||||
array->ElementArrayBufferObj->RefCount += step;
|
||||
@@ -1226,8 +1280,16 @@ _mesa_PushClientAttrib(GLbitfield mask)
|
||||
}
|
||||
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
|
||||
struct gl_array_attrib *attr;
|
||||
struct gl_array_object *obj;
|
||||
|
||||
attr = MALLOC_STRUCT( gl_array_attrib );
|
||||
obj = MALLOC_STRUCT( gl_array_object );
|
||||
|
||||
MEMCPY( attr, &ctx->Array, sizeof(struct gl_array_attrib) );
|
||||
MEMCPY( obj, ctx->Array.ArrayObj, sizeof(struct gl_array_object) );
|
||||
|
||||
attr->ArrayObj = obj;
|
||||
|
||||
newnode = new_attrib_node( GL_CLIENT_VERTEX_ARRAY_BIT );
|
||||
newnode->data = attr;
|
||||
newnode->next = head;
|
||||
@@ -1285,13 +1347,31 @@ _mesa_PopClientAttrib(void)
|
||||
sizeof(struct gl_pixelstore_attrib) );
|
||||
ctx->NewState |= _NEW_PACKUNPACK;
|
||||
break;
|
||||
case GL_CLIENT_VERTEX_ARRAY_BIT:
|
||||
case GL_CLIENT_VERTEX_ARRAY_BIT: {
|
||||
struct gl_array_attrib * data =
|
||||
(struct gl_array_attrib *) attr->data;
|
||||
|
||||
adjust_buffer_object_ref_counts(&ctx->Array, -1);
|
||||
MEMCPY( &ctx->Array, attr->data,
|
||||
sizeof(struct gl_array_attrib) );
|
||||
/* decrement reference counts on buffer objects */
|
||||
|
||||
ctx->Array.ActiveTexture = data->ActiveTexture;
|
||||
ctx->Array.LockFirst = data->LockFirst;
|
||||
ctx->Array.LockCount = data->LockCount;
|
||||
|
||||
_mesa_BindVertexArrayAPPLE( data->ArrayObj->Name );
|
||||
|
||||
MEMCPY( ctx->Array.ArrayObj, data->ArrayObj,
|
||||
sizeof( struct gl_array_object ) );
|
||||
|
||||
FREE( data->ArrayObj );
|
||||
|
||||
/* FIXME: Should some bits in ctx->Array->NewState also be set
|
||||
* FIXME: here? It seems like it should be set to inclusive-or
|
||||
* FIXME: of the old ArrayObj->_Enabled and the new _Enabled.
|
||||
*/
|
||||
|
||||
ctx->NewState |= _NEW_ARRAY;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
_mesa_problem( ctx, "Bad attrib flag in PopClientAttrib");
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file bitset.h
|
||||
* \brief Bitset of arbitrary size definitions.
|
||||
* \author Michal Krol
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
* generic bitset implementation
|
||||
*/
|
||||
|
||||
#define BITSET_WORD GLuint
|
||||
#define BITSET_WORDBITS (sizeof (BITSET_WORD) * 8)
|
||||
|
||||
/* bitset declarations
|
||||
*/
|
||||
#define BITSET_DECLARE(name, size) \
|
||||
BITSET_WORD name[((size) + BITSET_WORDBITS - 1) / BITSET_WORDBITS]
|
||||
|
||||
/* bitset operations
|
||||
*/
|
||||
#define BITSET_COPY(x, y) _mesa_memcpy( (x), (y), sizeof (x) )
|
||||
#define BITSET_EQUAL(x, y) (_mesa_memcmp( (x), (y), sizeof (x) ) == 0)
|
||||
#define BITSET_ZERO(x) _mesa_memset( (x), 0, sizeof (x) )
|
||||
#define BITSET_ONES(x) _mesa_memset( (x), 0xff, sizeof (x) )
|
||||
|
||||
#define BITSET_BITWORD(b) ((b) / BITSET_WORDBITS)
|
||||
#define BITSET_BIT(b) (1 << ((b) % BITSET_WORDBITS))
|
||||
|
||||
/* single bit operations
|
||||
*/
|
||||
#define BITSET_TEST(x, b) ((x)[BITSET_BITWORD(b)] & BITSET_BIT(b))
|
||||
#define BITSET_SET(x, b) ((x)[BITSET_BITWORD(b)] |= BITSET_BIT(b))
|
||||
#define BITSET_CLEAR(x, b) ((x)[BITSET_BITWORD(b)] &= ~BITSET_BIT(b))
|
||||
|
||||
#define BITSET_MASK(b) ((b) == BITSET_WORDBITS ? ~0 : BITSET_BIT(b) - 1)
|
||||
#define BITSET_RANGE(b, e) (BITSET_MASK((e) + 1) & ~BITSET_MASK(b))
|
||||
|
||||
/* bit range operations
|
||||
*/
|
||||
#define BITSET_TEST_RANGE(x, b, e) \
|
||||
(BITSET_BITWORD(b) == BITSET_BITWORD(e) ? \
|
||||
((x)[BITSET_BITWORD(b)] & BITSET_RANGE(b, e)) : \
|
||||
(assert (!"BITSET_TEST_RANGE: bit range crosses word boundary"), 0))
|
||||
#define BITSET_SET_RANGE(x, b, e) \
|
||||
(BITSET_BITWORD(b) == BITSET_BITWORD(e) ? \
|
||||
((x)[BITSET_BITWORD(b)] |= BITSET_RANGE(b, e)) : \
|
||||
(assert (!"BITSET_SET_RANGE: bit range crosses word boundary"), 0))
|
||||
#define BITSET_CLEAR_RANGE(x, b, e) \
|
||||
(BITSET_BITWORD(b) == BITSET_BITWORD(e) ? \
|
||||
((x)[BITSET_BITWORD(b)] &= ~BITSET_RANGE(b, e)) : \
|
||||
(assert (!"BITSET_CLEAR_RANGE: bit range crosses word boundary"), 0))
|
||||
|
||||
/****************************************************************************
|
||||
* 64-bit bitset implementation
|
||||
*/
|
||||
|
||||
#define BITSET64_WORD GLuint
|
||||
#define BITSET64_WORDBITS (sizeof (BITSET64_WORD) * 8)
|
||||
|
||||
/* bitset declarations
|
||||
*/
|
||||
#define BITSET64_DECLARE(name, size) \
|
||||
GLuint name[2]
|
||||
|
||||
/* bitset operations
|
||||
*/
|
||||
#define BITSET64_COPY(x, y) do { (x)[0] = (y)[0]; (x)[1] = (y)[1]; } while (0)
|
||||
#define BITSET64_EQUAL(x, y) ( (x)[0] == (y)[0] && (x)[1] == (y)[1] )
|
||||
#define BITSET64_ZERO(x) do { (x)[0] = 0; (x)[1] = 0; } while (0)
|
||||
#define BITSET64_ONES(x) do { (x)[0] = 0xFF; (x)[1] = 0xFF; } while (0)
|
||||
|
||||
#define BITSET64_BITWORD(b) ((b) / BITSET64_WORDBITS)
|
||||
#define BITSET64_BIT(b) (1 << ((b) % BITSET64_WORDBITS))
|
||||
|
||||
/* single bit operations
|
||||
*/
|
||||
#define BITSET64_TEST(x, b) ((x)[BITSET64_BITWORD(b)] & BITSET64_BIT(b))
|
||||
#define BITSET64_SET(x, b) ((x)[BITSET64_BITWORD(b)] |= BITSET64_BIT(b))
|
||||
#define BITSET64_CLEAR(x, b) ((x)[BITSET64_BITWORD(b)] &= ~BITSET64_BIT(b))
|
||||
|
||||
#define BITSET64_MASK(b) ((b) == BITSET64_WORDBITS ? ~0 : BITSET64_BIT(b) - 1)
|
||||
#define BITSET64_RANGE(b, e) (BITSET64_MASK((e) + 1) & ~BITSET64_MASK(b))
|
||||
|
||||
/* bit range operations
|
||||
*/
|
||||
#define BITSET64_TEST_RANGE(x, b, e) \
|
||||
(BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \
|
||||
((x)[BITSET64_BITWORD(b)] & BITSET64_RANGE(b, e)) : \
|
||||
(assert (!"BITSET64_TEST_RANGE: bit range crosses word boundary"), 0))
|
||||
#define BITSET64_SET_RANGE(x, b, e) \
|
||||
(BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \
|
||||
((x)[BITSET64_BITWORD(b)] |= BITSET64_RANGE(b, e)) : \
|
||||
(assert (!"BITSET64_SET_RANGE: bit range crosses word boundary"), 0))
|
||||
#define BITSET64_CLEAR_RANGE(x, b, e) \
|
||||
(BITSET64_BITWORD(b) == BITSET64_BITWORD(e) ? \
|
||||
((x)[BITSET64_BITWORD(b)] &= ~BITSET64_RANGE(b, e)) : \
|
||||
(assert (!"BITSET64_CLEAR_RANGE: bit range crosses word boundary"), 0))
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.1
|
||||
* Version: 6.5.1
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -275,13 +275,6 @@ _mesa_BlendEquation( GLenum mode )
|
||||
ctx->Color.BlendEquationRGB = mode;
|
||||
ctx->Color.BlendEquationA = mode;
|
||||
|
||||
/* This is needed to support 1.1's RGB logic ops AND
|
||||
* 1.0's blending logicops.
|
||||
*/
|
||||
ctx->Color._LogicOpEnabled = (ctx->Color.ColorLogicOpEnabled ||
|
||||
(ctx->Color.BlendEnabled &&
|
||||
mode == GL_LOGIC_OP));
|
||||
|
||||
if (ctx->Driver.BlendEquationSeparate)
|
||||
(*ctx->Driver.BlendEquationSeparate)( ctx, mode, mode );
|
||||
}
|
||||
@@ -323,12 +316,6 @@ _mesa_BlendEquationSeparateEXT( GLenum modeRGB, GLenum modeA )
|
||||
ctx->Color.BlendEquationRGB = modeRGB;
|
||||
ctx->Color.BlendEquationA = modeA;
|
||||
|
||||
/* This is needed to support 1.1's RGB logic ops AND
|
||||
* 1.0's blending logicops. This test is simplified over glBlendEquation
|
||||
* because modeRGB cannot be GL_LOGIC_OP.
|
||||
*/
|
||||
ctx->Color._LogicOpEnabled = (ctx->Color.ColorLogicOpEnabled);
|
||||
|
||||
if (ctx->Driver.BlendEquationSeparate)
|
||||
(*ctx->Driver.BlendEquationSeparate)( ctx, modeRGB, modeA );
|
||||
}
|
||||
@@ -529,6 +516,37 @@ _mesa_ColorMask( GLboolean red, GLboolean green,
|
||||
}
|
||||
|
||||
|
||||
extern void GLAPIENTRY
|
||||
_mesa_ClampColorARB(GLenum target, GLenum clamp)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
||||
if (clamp != GL_TRUE && clamp != GL_FALSE && clamp != GL_FIXED_ONLY_ARB) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glClampColorARB(clamp)");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (target) {
|
||||
case GL_CLAMP_VERTEX_COLOR_ARB:
|
||||
ctx->Light.ClampVertexColor = clamp;
|
||||
break;
|
||||
case GL_CLAMP_FRAGMENT_COLOR_ARB:
|
||||
ctx->Color.ClampFragmentColor = clamp;
|
||||
break;
|
||||
case GL_CLAMP_READ_COLOR_ARB:
|
||||
ctx->Color.ClampReadColor = clamp;
|
||||
break;
|
||||
default:
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glClampColorARB(target)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/** \name Initialization */
|
||||
/*@{*/
|
||||
@@ -570,12 +588,13 @@ void _mesa_init_color( GLcontext * ctx )
|
||||
|
||||
if (ctx->Visual.doubleBufferMode) {
|
||||
ctx->Color.DrawBuffer[0] = GL_BACK;
|
||||
ctx->Color._DrawDestMask[0] = DD_BACK_LEFT_BIT;
|
||||
}
|
||||
else {
|
||||
ctx->Color.DrawBuffer[0] = GL_FRONT;
|
||||
ctx->Color._DrawDestMask[0] = DD_FRONT_LEFT_BIT;
|
||||
}
|
||||
|
||||
ctx->Color.ClampFragmentColor = GL_FIXED_ONLY_ARB;
|
||||
ctx->Color.ClampReadColor = GL_FIXED_ONLY_ARB;
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.5
|
||||
* Version: 6.5.2
|
||||
*
|
||||
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -72,6 +72,11 @@ extern void GLAPIENTRY
|
||||
_mesa_ColorMask( GLboolean red, GLboolean green,
|
||||
GLboolean blue, GLboolean alpha );
|
||||
|
||||
|
||||
extern void GLAPIENTRY
|
||||
_mesa_ClampColorARB(GLenum target, GLenum clamp);
|
||||
|
||||
|
||||
extern void
|
||||
_mesa_init_color( GLcontext * ctx );
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.3
|
||||
* Version: 6.5.1
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -44,13 +44,11 @@
|
||||
* \param ctx GL context
|
||||
* \param target Buffer object target to be retrieved. Currently this must
|
||||
* be either \c GL_ARRAY_BUFFER or \c GL_ELEMENT_ARRAY_BUFFER.
|
||||
* \param str Name of caller for logging errors.
|
||||
* \return A pointer to the buffer object bound to \c target in the
|
||||
* specified context or \c NULL if \c target is invalid or no
|
||||
* buffer object is bound.
|
||||
* specified context or \c NULL if \c target is invalid.
|
||||
*/
|
||||
static INLINE struct gl_buffer_object *
|
||||
buffer_object_get_target( GLcontext *ctx, GLenum target, const char * str )
|
||||
get_buffer(GLcontext *ctx, GLenum target)
|
||||
{
|
||||
struct gl_buffer_object * bufObj = NULL;
|
||||
|
||||
@@ -68,12 +66,12 @@ buffer_object_get_target( GLcontext *ctx, GLenum target, const char * str )
|
||||
bufObj = ctx->Unpack.BufferObj;
|
||||
break;
|
||||
default:
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "gl%s(target)", str);
|
||||
/* error must be recorded by caller */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (bufObj->Name == 0)
|
||||
return NULL;
|
||||
/* bufObj should point to NullBufferObj or a user-created buffer object */
|
||||
ASSERT(bufObj);
|
||||
|
||||
return bufObj;
|
||||
}
|
||||
@@ -87,7 +85,7 @@ buffer_object_get_target( GLcontext *ctx, GLenum target, const char * str )
|
||||
* \param target Buffer object target on which to operate.
|
||||
* \param offset Offset of the first byte of the subdata range.
|
||||
* \param size Size, in bytes, of the subdata range.
|
||||
* \param str Name of caller for logging errors.
|
||||
* \param caller Name of calling function for recording errors.
|
||||
* \return A pointer to the buffer object bound to \c target in the
|
||||
* specified context or \c NULL if any of the parameter or state
|
||||
* conditions for \c glBufferSubDataARB or \c glGetBufferSubDataARB
|
||||
@@ -98,34 +96,37 @@ buffer_object_get_target( GLcontext *ctx, GLenum target, const char * str )
|
||||
static struct gl_buffer_object *
|
||||
buffer_object_subdata_range_good( GLcontext * ctx, GLenum target,
|
||||
GLintptrARB offset, GLsizeiptrARB size,
|
||||
const char * str )
|
||||
const char *caller )
|
||||
{
|
||||
struct gl_buffer_object *bufObj;
|
||||
|
||||
if (size < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s(size < 0)", str);
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s(size < 0)", caller);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (offset < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s(offset < 0)", str);
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s(offset < 0)", caller);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bufObj = buffer_object_get_target( ctx, target, str );
|
||||
if (!bufObj || bufObj->Name == 0) {
|
||||
bufObj = get_buffer(ctx, target);
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", caller);
|
||||
return NULL;
|
||||
}
|
||||
if (bufObj->Name == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((GLuint) (offset + size) > bufObj->Size) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
"%s(size + offset > buffer size)", str);
|
||||
"%s(size + offset > buffer size)", caller);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (bufObj->Pointer) {
|
||||
/* Buffer is currently mapped */
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "%s", str);
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -169,6 +170,22 @@ _mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_mesa_unbind_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj )
|
||||
{
|
||||
if (bufObj != ctx->Array.NullBufferObj) {
|
||||
bufObj->RefCount--;
|
||||
if (bufObj->RefCount <= 0) {
|
||||
ASSERT(ctx->Array.ArrayBufferObj != bufObj);
|
||||
ASSERT(ctx->Array.ElementArrayBufferObj != bufObj);
|
||||
ASSERT(ctx->Array.ArrayObj->Vertex.BufferObj != bufObj);
|
||||
ASSERT(ctx->Driver.DeleteBuffer);
|
||||
ctx->Driver.DeleteBuffer(ctx, bufObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize a buffer object to default values.
|
||||
*/
|
||||
@@ -279,7 +296,10 @@ _mesa_buffer_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
|
||||
{
|
||||
(void) ctx; (void) target;
|
||||
|
||||
if (bufObj->Data && ((GLuint) (size + offset) <= bufObj->Size)) {
|
||||
/* this should have been caught in _mesa_BufferSubData() */
|
||||
ASSERT((GLuint) (size + offset) <= bufObj->Size);
|
||||
|
||||
if (bufObj->Data) {
|
||||
_mesa_memcpy( (GLubyte *) bufObj->Data + offset, data, size );
|
||||
}
|
||||
}
|
||||
@@ -310,7 +330,7 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
|
||||
{
|
||||
(void) ctx; (void) target;
|
||||
|
||||
if (bufObj->Data && ((GLuint) (size + offset) <= bufObj->Size)) {
|
||||
if (bufObj->Data && ((GLsizeiptrARB) (size + offset) <= bufObj->Size)) {
|
||||
_mesa_memcpy( data, (GLubyte *) bufObj->Data + offset, size );
|
||||
}
|
||||
}
|
||||
@@ -319,9 +339,9 @@ _mesa_buffer_get_subdata( GLcontext *ctx, GLenum target, GLintptrARB offset,
|
||||
/**
|
||||
* Fallback function called via ctx->Driver.MapBuffer().
|
||||
* Hardware drivers that really implement buffer objects should never use
|
||||
* function.
|
||||
* this function.
|
||||
*
|
||||
* The input parameters will have been already tested for errors.
|
||||
* The function parameters will have been already tested for errors.
|
||||
*
|
||||
* \param ctx GL context.
|
||||
* \param target Buffer object target on which to operate.
|
||||
@@ -378,8 +398,6 @@ _mesa_buffer_unmap( GLcontext *ctx, GLenum target,
|
||||
void
|
||||
_mesa_init_buffer_objects( GLcontext *ctx )
|
||||
{
|
||||
GLuint i;
|
||||
|
||||
/* Allocate the default buffer object and set refcount so high that
|
||||
* it never gets deleted.
|
||||
*/
|
||||
@@ -389,21 +407,6 @@ _mesa_init_buffer_objects( GLcontext *ctx )
|
||||
|
||||
ctx->Array.ArrayBufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.ElementArrayBufferObj = ctx->Array.NullBufferObj;
|
||||
|
||||
/* Vertex array buffers */
|
||||
ctx->Array.Vertex.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.Normal.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.Color.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.SecondaryColor.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.FogCoord.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.Index.BufferObj = ctx->Array.NullBufferObj;
|
||||
for (i = 0; i < MAX_TEXTURE_UNITS; i++) {
|
||||
ctx->Array.TexCoord[i].BufferObj = ctx->Array.NullBufferObj;
|
||||
}
|
||||
ctx->Array.EdgeFlag.BufferObj = ctx->Array.NullBufferObj;
|
||||
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
|
||||
ctx->Array.VertexAttrib[i].BufferObj = ctx->Array.NullBufferObj;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -433,6 +436,7 @@ _mesa_validate_pbo_access(GLuint dimensions,
|
||||
GLenum format, GLenum type, const GLvoid *ptr)
|
||||
{
|
||||
GLvoid *start, *end;
|
||||
const GLubyte *sizeAddr; /* buffer size, cast to a pointer */
|
||||
|
||||
ASSERT(pack->BufferObj->Name != 0);
|
||||
|
||||
@@ -449,11 +453,13 @@ _mesa_validate_pbo_access(GLuint dimensions,
|
||||
format, type, depth-1, height-1, width);
|
||||
|
||||
|
||||
if ((const GLubyte *) start > (const GLubyte *) pack->BufferObj->Size) {
|
||||
sizeAddr = ((const GLubyte *) 0) + pack->BufferObj->Size;
|
||||
|
||||
if ((const GLubyte *) start > sizeAddr) {
|
||||
/* This will catch negative values / wrap-around */
|
||||
return GL_FALSE;
|
||||
}
|
||||
if ((const GLubyte *) end > (const GLubyte *) pack->BufferObj->Size) {
|
||||
if ((const GLubyte *) end > sizeAddr) {
|
||||
/* Image read goes beyond end of buffer */
|
||||
return GL_FALSE;
|
||||
}
|
||||
@@ -463,6 +469,20 @@ _mesa_validate_pbo_access(GLuint dimensions,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the gl_buffer_object for the given ID.
|
||||
* Always return NULL for ID 0.
|
||||
*/
|
||||
struct gl_buffer_object *
|
||||
_mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer)
|
||||
{
|
||||
if (buffer == 0)
|
||||
return NULL;
|
||||
else
|
||||
return (struct gl_buffer_object *)
|
||||
_mesa_HashLookup(ctx->Shared->BufferObjects, buffer);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
@@ -474,10 +494,30 @@ _mesa_BindBufferARB(GLenum target, GLuint buffer)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
struct gl_buffer_object *oldBufObj;
|
||||
struct gl_buffer_object *newBufObj = 0;
|
||||
struct gl_buffer_object *newBufObj = NULL;
|
||||
struct gl_buffer_object **bindTarget = NULL;
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
||||
oldBufObj = buffer_object_get_target( ctx, target, "BindBufferARB" );
|
||||
switch (target) {
|
||||
case GL_ARRAY_BUFFER_ARB:
|
||||
bindTarget = &ctx->Array.ArrayBufferObj;
|
||||
break;
|
||||
case GL_ELEMENT_ARRAY_BUFFER_ARB:
|
||||
bindTarget = &ctx->Array.ElementArrayBufferObj;
|
||||
break;
|
||||
case GL_PIXEL_PACK_BUFFER_EXT:
|
||||
bindTarget = &ctx->Pack.BufferObj;
|
||||
break;
|
||||
case GL_PIXEL_UNPACK_BUFFER_EXT:
|
||||
bindTarget = &ctx->Unpack.BufferObj;
|
||||
break;
|
||||
default:
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferARB(target)");
|
||||
return;
|
||||
}
|
||||
|
||||
/* Get pointer to old buffer object (to be unbound) */
|
||||
oldBufObj = get_buffer(ctx, target);
|
||||
if (oldBufObj && oldBufObj->Name == buffer)
|
||||
return; /* rebinding the same buffer object- no change */
|
||||
|
||||
@@ -492,50 +532,35 @@ _mesa_BindBufferARB(GLenum target, GLuint buffer)
|
||||
}
|
||||
else {
|
||||
/* non-default buffer object */
|
||||
const struct _mesa_HashTable *hash = ctx->Shared->BufferObjects;
|
||||
newBufObj = (struct gl_buffer_object *) _mesa_HashLookup(hash, buffer);
|
||||
newBufObj = _mesa_lookup_bufferobj(ctx, buffer);
|
||||
if (!newBufObj) {
|
||||
/* if this is a new buffer object id, allocate a buffer object now */
|
||||
newBufObj = (*ctx->Driver.NewBufferObject)(ctx, buffer, target);
|
||||
ASSERT(ctx->Driver.NewBufferObject);
|
||||
newBufObj = ctx->Driver.NewBufferObject(ctx, buffer, target);
|
||||
if (!newBufObj) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindBufferARB");
|
||||
return;
|
||||
}
|
||||
_mesa_save_buffer_object(ctx, newBufObj);
|
||||
}
|
||||
newBufObj->RefCount++;
|
||||
}
|
||||
|
||||
switch (target) {
|
||||
case GL_ARRAY_BUFFER_ARB:
|
||||
ctx->Array.ArrayBufferObj = newBufObj;
|
||||
break;
|
||||
case GL_ELEMENT_ARRAY_BUFFER_ARB:
|
||||
ctx->Array.ElementArrayBufferObj = newBufObj;
|
||||
break;
|
||||
case GL_PIXEL_PACK_BUFFER_EXT:
|
||||
ctx->Pack.BufferObj = newBufObj;
|
||||
break;
|
||||
case GL_PIXEL_UNPACK_BUFFER_EXT:
|
||||
ctx->Unpack.BufferObj = newBufObj;
|
||||
break;
|
||||
default:
|
||||
_mesa_problem(ctx, "Bad target in _mesa_BindBufferARB");
|
||||
return;
|
||||
}
|
||||
/* Make new binding */
|
||||
*bindTarget = newBufObj;
|
||||
newBufObj->RefCount++;
|
||||
|
||||
/* Pass BindBuffer call to device driver */
|
||||
if (ctx->Driver.BindBuffer && newBufObj)
|
||||
(*ctx->Driver.BindBuffer)( ctx, target, newBufObj );
|
||||
ctx->Driver.BindBuffer( ctx, target, newBufObj );
|
||||
|
||||
/* decr ref count on old buffer obj, delete if needed */
|
||||
if (oldBufObj) {
|
||||
oldBufObj->RefCount--;
|
||||
assert(oldBufObj->RefCount >= 0);
|
||||
if (oldBufObj->RefCount == 0) {
|
||||
assert(oldBufObj->Name != 0);
|
||||
_mesa_remove_buffer_object(ctx, oldBufObj);
|
||||
ASSERT(ctx->Driver.DeleteBuffer);
|
||||
(*ctx->Driver.DeleteBuffer)( ctx, oldBufObj );
|
||||
ctx->Driver.DeleteBuffer( ctx, oldBufObj );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -562,95 +587,80 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids)
|
||||
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (ids[i] != 0) {
|
||||
struct gl_buffer_object *bufObj = (struct gl_buffer_object *)
|
||||
_mesa_HashLookup(ctx->Shared->BufferObjects, ids[i]);
|
||||
if (bufObj) {
|
||||
/* unbind any vertex pointers bound to this buffer */
|
||||
GLuint j;
|
||||
struct gl_buffer_object *bufObj = _mesa_lookup_bufferobj(ctx, ids[i]);
|
||||
if (bufObj) {
|
||||
/* unbind any vertex pointers bound to this buffer */
|
||||
GLuint j;
|
||||
|
||||
ASSERT(bufObj->Name == ids[i]);
|
||||
ASSERT(bufObj->Name == ids[i]);
|
||||
|
||||
if (ctx->Array.Vertex.BufferObj == bufObj) {
|
||||
if (ctx->Array.ArrayObj->Vertex.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.ArrayObj->Vertex.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.ArrayObj->Normal.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.ArrayObj->Normal.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.ArrayObj->Color.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.ArrayObj->Color.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.ArrayObj->SecondaryColor.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.ArrayObj->SecondaryColor.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.ArrayObj->FogCoord.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.ArrayObj->FogCoord.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.ArrayObj->Index.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.ArrayObj->Index.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.ArrayObj->EdgeFlag.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.ArrayObj->EdgeFlag.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
for (j = 0; j < MAX_TEXTURE_UNITS; j++) {
|
||||
if (ctx->Array.ArrayObj->TexCoord[j].BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.Vertex.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.ArrayObj->TexCoord[j].BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.Normal.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.Normal.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.Color.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.Color.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.SecondaryColor.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.SecondaryColor.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.FogCoord.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.FogCoord.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.Index.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.Index.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
if (ctx->Array.EdgeFlag.BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.EdgeFlag.BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
for (j = 0; j < MAX_TEXTURE_UNITS; j++) {
|
||||
if (ctx->Array.TexCoord[j].BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.TexCoord[j].BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
}
|
||||
for (j = 0; j < VERT_ATTRIB_MAX; j++) {
|
||||
if (ctx->Array.VertexAttrib[j].BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.VertexAttrib[j].BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->Array.ArrayBufferObj == bufObj) {
|
||||
_mesa_BindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
|
||||
}
|
||||
if (ctx->Array.ElementArrayBufferObj == bufObj) {
|
||||
_mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 );
|
||||
}
|
||||
|
||||
if (ctx->Pack.BufferObj == bufObj) {
|
||||
_mesa_BindBufferARB( GL_PIXEL_PACK_BUFFER_EXT, 0 );
|
||||
}
|
||||
if (ctx->Unpack.BufferObj == bufObj) {
|
||||
_mesa_BindBufferARB( GL_PIXEL_UNPACK_BUFFER_EXT, 0 );
|
||||
}
|
||||
|
||||
/* decrement refcount and delete if <= 0 */
|
||||
if (!bufObj->DeletePending) {
|
||||
bufObj->DeletePending = GL_TRUE;
|
||||
bufObj->RefCount--;
|
||||
}
|
||||
|
||||
if (bufObj->RefCount <= 0) {
|
||||
/* buffer should not be bound anymore! */
|
||||
ASSERT(ctx->Array.ArrayBufferObj != bufObj);
|
||||
ASSERT(ctx->Array.ElementArrayBufferObj != bufObj);
|
||||
ASSERT(ctx->Array.Vertex.BufferObj != bufObj);
|
||||
_mesa_remove_buffer_object(ctx, bufObj);
|
||||
ASSERT(ctx->Driver.DeleteBuffer);
|
||||
(*ctx->Driver.DeleteBuffer)(ctx, bufObj);
|
||||
}
|
||||
}
|
||||
for (j = 0; j < VERT_ATTRIB_MAX; j++) {
|
||||
if (ctx->Array.ArrayObj->VertexAttrib[j].BufferObj == bufObj) {
|
||||
bufObj->RefCount--;
|
||||
ctx->Array.ArrayObj->VertexAttrib[j].BufferObj = ctx->Array.NullBufferObj;
|
||||
ctx->Array.NullBufferObj->RefCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->Array.ArrayBufferObj == bufObj) {
|
||||
_mesa_BindBufferARB( GL_ARRAY_BUFFER_ARB, 0 );
|
||||
}
|
||||
if (ctx->Array.ElementArrayBufferObj == bufObj) {
|
||||
_mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 );
|
||||
}
|
||||
|
||||
if (ctx->Pack.BufferObj == bufObj) {
|
||||
_mesa_BindBufferARB( GL_PIXEL_PACK_BUFFER_EXT, 0 );
|
||||
}
|
||||
if (ctx->Unpack.BufferObj == bufObj) {
|
||||
_mesa_BindBufferARB( GL_PIXEL_UNPACK_BUFFER_EXT, 0 );
|
||||
}
|
||||
|
||||
/* The ID is immediately freed for re-use */
|
||||
_mesa_remove_buffer_object(ctx, bufObj);
|
||||
_mesa_unbind_buffer_object(ctx, bufObj);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -693,8 +703,9 @@ _mesa_GenBuffersARB(GLsizei n, GLuint *buffer)
|
||||
struct gl_buffer_object *bufObj;
|
||||
GLuint name = first + i;
|
||||
GLenum target = 0;
|
||||
bufObj = (*ctx->Driver.NewBufferObject)( ctx, name, target );
|
||||
bufObj = ctx->Driver.NewBufferObject( ctx, name, target );
|
||||
if (!bufObj) {
|
||||
_glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glGenBuffersARB");
|
||||
return;
|
||||
}
|
||||
@@ -716,18 +727,15 @@ _mesa_GenBuffersARB(GLsizei n, GLuint *buffer)
|
||||
GLboolean GLAPIENTRY
|
||||
_mesa_IsBufferARB(GLuint id)
|
||||
{
|
||||
struct gl_buffer_object * bufObj;
|
||||
struct gl_buffer_object *bufObj;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
|
||||
|
||||
if (id == 0)
|
||||
return GL_FALSE;
|
||||
|
||||
_glthread_LOCK_MUTEX(ctx->Shared->Mutex);
|
||||
bufObj = (struct gl_buffer_object *) _mesa_HashLookup(ctx->Shared->BufferObjects, id);
|
||||
bufObj = _mesa_lookup_bufferobj(ctx, id);
|
||||
_glthread_UNLOCK_MUTEX(ctx->Shared->Mutex);
|
||||
|
||||
return bufObj && !bufObj->DeletePending;
|
||||
return bufObj ? GL_TRUE : GL_FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -761,8 +769,12 @@ _mesa_BufferDataARB(GLenum target, GLsizeiptrARB size,
|
||||
return;
|
||||
}
|
||||
|
||||
bufObj = buffer_object_get_target( ctx, target, "BufferDataARB" );
|
||||
if (!bufObj || bufObj->Name ==0) {
|
||||
bufObj = get_buffer(ctx, target);
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glBufferDataARB(target)" );
|
||||
return;
|
||||
}
|
||||
if (bufObj->Name == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glBufferDataARB" );
|
||||
return;
|
||||
}
|
||||
@@ -775,7 +787,7 @@ _mesa_BufferDataARB(GLenum target, GLsizeiptrARB size,
|
||||
ASSERT(ctx->Driver.BufferData);
|
||||
|
||||
/* Give the buffer object to the driver! <data> may be null! */
|
||||
(*ctx->Driver.BufferData)( ctx, target, size, data, usage, bufObj );
|
||||
ctx->Driver.BufferData( ctx, target, size, data, usage, bufObj );
|
||||
}
|
||||
|
||||
|
||||
@@ -788,14 +800,14 @@ _mesa_BufferSubDataARB(GLenum target, GLintptrARB offset,
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
||||
bufObj = buffer_object_subdata_range_good( ctx, target, offset, size,
|
||||
"BufferSubDataARB" );
|
||||
"glBufferSubDataARB" );
|
||||
if (!bufObj) {
|
||||
/* error already recorded */
|
||||
return;
|
||||
}
|
||||
|
||||
ASSERT(ctx->Driver.BufferSubData);
|
||||
(*ctx->Driver.BufferSubData)( ctx, target, offset, size, data, bufObj );
|
||||
ctx->Driver.BufferSubData( ctx, target, offset, size, data, bufObj );
|
||||
}
|
||||
|
||||
|
||||
@@ -808,14 +820,14 @@ _mesa_GetBufferSubDataARB(GLenum target, GLintptrARB offset,
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
||||
bufObj = buffer_object_subdata_range_good( ctx, target, offset, size,
|
||||
"GetBufferSubDataARB" );
|
||||
"glGetBufferSubDataARB" );
|
||||
if (!bufObj) {
|
||||
/* error already recorded */
|
||||
return;
|
||||
}
|
||||
|
||||
ASSERT(ctx->Driver.GetBufferSubData);
|
||||
(*ctx->Driver.GetBufferSubData)( ctx, target, offset, size, data, bufObj );
|
||||
ctx->Driver.GetBufferSubData( ctx, target, offset, size, data, bufObj );
|
||||
}
|
||||
|
||||
|
||||
@@ -837,19 +849,22 @@ _mesa_MapBufferARB(GLenum target, GLenum access)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bufObj = buffer_object_get_target( ctx, target, "MapBufferARB" );
|
||||
if (!bufObj || bufObj->Name == 0) {
|
||||
bufObj = get_buffer(ctx, target);
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glMapBufferARB(target)" );
|
||||
return NULL;
|
||||
}
|
||||
if (bufObj->Name == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glMapBufferARB" );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (bufObj->Pointer) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glMapBufferARB(already mapped)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ASSERT(ctx->Driver.MapBuffer);
|
||||
bufObj->Pointer = (*ctx->Driver.MapBuffer)( ctx, target, access, bufObj );
|
||||
bufObj->Pointer = ctx->Driver.MapBuffer( ctx, target, access, bufObj );
|
||||
if (!bufObj->Pointer) {
|
||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(access)");
|
||||
}
|
||||
@@ -868,19 +883,22 @@ _mesa_UnmapBufferARB(GLenum target)
|
||||
GLboolean status = GL_TRUE;
|
||||
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
|
||||
|
||||
bufObj = buffer_object_get_target( ctx, target, "UnmapBufferARB" );
|
||||
if (!bufObj || bufObj->Name == 0) {
|
||||
bufObj = get_buffer(ctx, target);
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glUnmapBufferARB(target)" );
|
||||
return GL_FALSE;
|
||||
}
|
||||
if (bufObj->Name == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glUnmapBufferARB" );
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
if (!bufObj->Pointer) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glUnmapBufferARB");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
if (ctx->Driver.UnmapBuffer) {
|
||||
status = (*ctx->Driver.UnmapBuffer)( ctx, target, bufObj );
|
||||
status = ctx->Driver.UnmapBuffer( ctx, target, bufObj );
|
||||
}
|
||||
|
||||
bufObj->Access = GL_READ_WRITE_ARB; /* initial value, OK? */
|
||||
@@ -897,15 +915,19 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params)
|
||||
struct gl_buffer_object *bufObj;
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
||||
bufObj = buffer_object_get_target( ctx, target, "GetBufferParameterivARB" );
|
||||
if (!bufObj || bufObj->Name == 0) {
|
||||
bufObj = get_buffer(ctx, target);
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "GetBufferParameterivARB(target)" );
|
||||
return;
|
||||
}
|
||||
if (bufObj->Name == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "GetBufferParameterivARB" );
|
||||
return;
|
||||
}
|
||||
|
||||
switch (pname) {
|
||||
case GL_BUFFER_SIZE_ARB:
|
||||
*params = bufObj->Size;
|
||||
*params = (GLint) bufObj->Size;
|
||||
break;
|
||||
case GL_BUFFER_USAGE_ARB:
|
||||
*params = bufObj->Usage;
|
||||
@@ -935,8 +957,12 @@ _mesa_GetBufferPointervARB(GLenum target, GLenum pname, GLvoid **params)
|
||||
return;
|
||||
}
|
||||
|
||||
bufObj = buffer_object_get_target( ctx, target, "GetBufferPointervARB" );
|
||||
if (!bufObj || bufObj->Name == 0) {
|
||||
bufObj = get_buffer(ctx, target);
|
||||
if (!bufObj) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glGetBufferPointervARB(target)" );
|
||||
return;
|
||||
}
|
||||
if (bufObj->Name == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glGetBufferPointervARB" );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,9 @@ _mesa_new_buffer_object( GLcontext *ctx, GLuint name, GLenum target );
|
||||
extern void
|
||||
_mesa_delete_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj );
|
||||
|
||||
extern struct gl_buffer_object *
|
||||
_mesa_lookup_bufferobj(GLcontext *ctx, GLuint buffer);
|
||||
|
||||
extern void
|
||||
_mesa_initialize_buffer_object( struct gl_buffer_object *obj,
|
||||
GLuint name, GLenum target );
|
||||
@@ -83,6 +86,8 @@ _mesa_validate_pbo_access(GLuint dimensions,
|
||||
GLsizei width, GLsizei height, GLsizei depth,
|
||||
GLenum format, GLenum type, const GLvoid *ptr);
|
||||
|
||||
extern void
|
||||
_mesa_unbind_buffer_object( GLcontext *ctx, struct gl_buffer_object *bufObj );
|
||||
|
||||
/*
|
||||
* API functions
|
||||
|
||||
+408
-268
@@ -1,13 +1,8 @@
|
||||
/**
|
||||
* \file buffers.c
|
||||
* Frame buffer management.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 6.1
|
||||
* Version: 6.5.2
|
||||
*
|
||||
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -28,16 +23,23 @@
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* \file buffers.c
|
||||
* General framebuffer-related functions, like glClear, glScissor, etc.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "glheader.h"
|
||||
#include "imports.h"
|
||||
#include "buffers.h"
|
||||
#include "colormac.h"
|
||||
#include "context.h"
|
||||
#include "depth.h"
|
||||
#include "enums.h"
|
||||
#include "stencil.h"
|
||||
#include "fbobject.h"
|
||||
#include "state.h"
|
||||
#include "mtypes.h"
|
||||
|
||||
|
||||
#define BAD_MASK ~0u
|
||||
|
||||
|
||||
#if _HAVE_FULL_GL
|
||||
@@ -132,12 +134,14 @@ _mesa_Clear( GLbitfield mask )
|
||||
_mesa_update_state( ctx ); /* update _Xmin, etc */
|
||||
}
|
||||
|
||||
if (ctx->RenderMode==GL_RENDER) {
|
||||
const GLint x = ctx->DrawBuffer->_Xmin;
|
||||
const GLint y = ctx->DrawBuffer->_Ymin;
|
||||
const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
|
||||
const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
|
||||
GLbitfield ddMask;
|
||||
if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
|
||||
_mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
|
||||
"glClear(incomplete framebuffer)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->RenderMode == GL_RENDER) {
|
||||
GLbitfield bufferMask;
|
||||
|
||||
/* don't clear depth buffer if depth writing disabled */
|
||||
if (!ctx->Depth.Mask)
|
||||
@@ -145,48 +149,73 @@ _mesa_Clear( GLbitfield mask )
|
||||
|
||||
/* Build the bitmask to send to device driver's Clear function.
|
||||
* Note that the GL_COLOR_BUFFER_BIT flag will expand to 0, 1, 2 or 4
|
||||
* of the FRONT/BACK_LEFT/RIGHT_BIT flags.
|
||||
* of the BUFFER_BIT_FRONT/BACK_LEFT/RIGHT flags, or one of the
|
||||
* BUFFER_BIT_COLORn flags.
|
||||
*/
|
||||
ddMask = 0;
|
||||
if (mask & GL_COLOR_BUFFER_BIT)
|
||||
ddMask |= ctx->Color._DrawDestMask[0];
|
||||
if ((mask & GL_DEPTH_BUFFER_BIT) && ctx->Visual.depthBits > 0)
|
||||
ddMask |= GL_DEPTH_BUFFER_BIT;
|
||||
if ((mask & GL_STENCIL_BUFFER_BIT) && ctx->Visual.stencilBits > 0)
|
||||
ddMask |= GL_STENCIL_BUFFER_BIT;
|
||||
if ((mask & GL_ACCUM_BUFFER_BIT) && ctx->Visual.accumRedBits > 0)
|
||||
ddMask |= GL_ACCUM_BUFFER_BIT;
|
||||
bufferMask = 0;
|
||||
if (mask & GL_COLOR_BUFFER_BIT) {
|
||||
bufferMask |= ctx->DrawBuffer->_ColorDrawBufferMask[0];
|
||||
}
|
||||
|
||||
if ((mask & GL_DEPTH_BUFFER_BIT)
|
||||
&& ctx->DrawBuffer->Visual.haveDepthBuffer) {
|
||||
bufferMask |= BUFFER_BIT_DEPTH;
|
||||
}
|
||||
|
||||
if ((mask & GL_STENCIL_BUFFER_BIT)
|
||||
&& ctx->DrawBuffer->Visual.haveStencilBuffer) {
|
||||
bufferMask |= BUFFER_BIT_STENCIL;
|
||||
}
|
||||
|
||||
if ((mask & GL_ACCUM_BUFFER_BIT)
|
||||
&& ctx->DrawBuffer->Visual.haveAccumBuffer) {
|
||||
bufferMask |= BUFFER_BIT_ACCUM;
|
||||
}
|
||||
|
||||
ASSERT(ctx->Driver.Clear);
|
||||
ctx->Driver.Clear( ctx, ddMask, (GLboolean) !ctx->Scissor.Enabled,
|
||||
x, y, width, height );
|
||||
ctx->Driver.Clear(ctx, bufferMask);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return bitmask of DD_* flags indicating which color buffers are
|
||||
* available to the rendering context;
|
||||
* Return bitmask of BUFFER_BIT_* flags indicating which color buffers are
|
||||
* available to the rendering context.
|
||||
* This depends on the framebuffer we're writing to. For window system
|
||||
* framebuffers we look at the framebuffer's visual. But for user-
|
||||
* create framebuffers we look at the number of supported color attachments.
|
||||
*/
|
||||
static GLuint
|
||||
supported_buffer_bitmask(const GLcontext *ctx)
|
||||
static GLbitfield
|
||||
supported_buffer_bitmask(const GLcontext *ctx, GLuint framebufferID)
|
||||
{
|
||||
GLuint mask = DD_FRONT_LEFT_BIT; /* always have this */
|
||||
GLint i;
|
||||
GLbitfield mask = 0x0;
|
||||
|
||||
if (ctx->Visual.stereoMode) {
|
||||
mask |= DD_FRONT_RIGHT_BIT;
|
||||
if (ctx->Visual.doubleBufferMode) {
|
||||
mask |= DD_BACK_LEFT_BIT | DD_BACK_RIGHT_BIT;
|
||||
if (framebufferID > 0) {
|
||||
/* A user-created renderbuffer */
|
||||
GLuint i;
|
||||
ASSERT(ctx->Extensions.EXT_framebuffer_object);
|
||||
for (i = 0; i < ctx->Const.MaxColorAttachments; i++) {
|
||||
mask |= (BUFFER_BIT_COLOR0 << i);
|
||||
}
|
||||
}
|
||||
else if (ctx->Visual.doubleBufferMode) {
|
||||
mask |= DD_BACK_LEFT_BIT;
|
||||
}
|
||||
else {
|
||||
/* A window system renderbuffer */
|
||||
GLint i;
|
||||
mask = BUFFER_BIT_FRONT_LEFT; /* always have this */
|
||||
if (ctx->Visual.stereoMode) {
|
||||
mask |= BUFFER_BIT_FRONT_RIGHT;
|
||||
if (ctx->Visual.doubleBufferMode) {
|
||||
mask |= BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT;
|
||||
}
|
||||
}
|
||||
else if (ctx->Visual.doubleBufferMode) {
|
||||
mask |= BUFFER_BIT_BACK_LEFT;
|
||||
}
|
||||
|
||||
for (i = 0; i < ctx->Visual.numAuxBuffers; i++) {
|
||||
mask |= (DD_AUX0_BIT << i);
|
||||
for (i = 0; i < ctx->Visual.numAuxBuffers; i++) {
|
||||
mask |= (BUFFER_BIT_AUX0 << i);
|
||||
}
|
||||
}
|
||||
|
||||
return mask;
|
||||
@@ -195,183 +224,288 @@ supported_buffer_bitmask(const GLcontext *ctx)
|
||||
|
||||
/**
|
||||
* Helper routine used by glDrawBuffer and glDrawBuffersARB.
|
||||
* Given a GLenum naming (a) color buffer(s), return the corresponding
|
||||
* bitmask of DD_* flags.
|
||||
* Given a GLenum naming one or more color buffers (such as
|
||||
* GL_FRONT_AND_BACK), return the corresponding bitmask of BUFFER_BIT_* flags.
|
||||
*/
|
||||
static GLuint
|
||||
static GLbitfield
|
||||
draw_buffer_enum_to_bitmask(GLenum buffer)
|
||||
{
|
||||
switch (buffer) {
|
||||
case GL_FRONT:
|
||||
return DD_FRONT_LEFT_BIT | DD_FRONT_RIGHT_BIT;
|
||||
case GL_BACK:
|
||||
return DD_BACK_LEFT_BIT | DD_BACK_RIGHT_BIT;
|
||||
case GL_NONE:
|
||||
return 0;
|
||||
case GL_FRONT:
|
||||
return BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT;
|
||||
case GL_BACK:
|
||||
return BUFFER_BIT_BACK_LEFT | BUFFER_BIT_BACK_RIGHT;
|
||||
case GL_RIGHT:
|
||||
return DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT;
|
||||
return BUFFER_BIT_FRONT_RIGHT | BUFFER_BIT_BACK_RIGHT;
|
||||
case GL_FRONT_RIGHT:
|
||||
return DD_FRONT_RIGHT_BIT;
|
||||
return BUFFER_BIT_FRONT_RIGHT;
|
||||
case GL_BACK_RIGHT:
|
||||
return DD_BACK_RIGHT_BIT;
|
||||
return BUFFER_BIT_BACK_RIGHT;
|
||||
case GL_BACK_LEFT:
|
||||
return DD_BACK_LEFT_BIT;
|
||||
return BUFFER_BIT_BACK_LEFT;
|
||||
case GL_FRONT_AND_BACK:
|
||||
return DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT
|
||||
| DD_FRONT_RIGHT_BIT | DD_BACK_RIGHT_BIT;
|
||||
return BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT
|
||||
| BUFFER_BIT_FRONT_RIGHT | BUFFER_BIT_BACK_RIGHT;
|
||||
case GL_LEFT:
|
||||
return DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT;
|
||||
return BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT;
|
||||
case GL_FRONT_LEFT:
|
||||
return DD_FRONT_LEFT_BIT;
|
||||
return BUFFER_BIT_FRONT_LEFT;
|
||||
case GL_AUX0:
|
||||
return DD_AUX0_BIT;
|
||||
return BUFFER_BIT_AUX0;
|
||||
case GL_AUX1:
|
||||
return DD_AUX1_BIT;
|
||||
return BUFFER_BIT_AUX1;
|
||||
case GL_AUX2:
|
||||
return DD_AUX2_BIT;
|
||||
return BUFFER_BIT_AUX2;
|
||||
case GL_AUX3:
|
||||
return DD_AUX3_BIT;
|
||||
return BUFFER_BIT_AUX3;
|
||||
case GL_COLOR_ATTACHMENT0_EXT:
|
||||
return BUFFER_BIT_COLOR0;
|
||||
case GL_COLOR_ATTACHMENT1_EXT:
|
||||
return BUFFER_BIT_COLOR1;
|
||||
case GL_COLOR_ATTACHMENT2_EXT:
|
||||
return BUFFER_BIT_COLOR2;
|
||||
case GL_COLOR_ATTACHMENT3_EXT:
|
||||
return BUFFER_BIT_COLOR3;
|
||||
default:
|
||||
/* error */
|
||||
return ~0;
|
||||
return BAD_MASK;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper routine used by glReadBuffer.
|
||||
* Given a GLenum naming (a) color buffer(s), return the corresponding
|
||||
* bitmask of DD_* flags.
|
||||
* Given a GLenum naming a color buffer, return the index of the corresponding
|
||||
* renderbuffer (a BUFFER_* value).
|
||||
* return -1 for an invalid buffer.
|
||||
*/
|
||||
static GLuint
|
||||
read_buffer_enum_to_bitmask(GLenum buffer)
|
||||
static GLint
|
||||
read_buffer_enum_to_index(GLenum buffer)
|
||||
{
|
||||
switch (buffer) {
|
||||
case GL_FRONT:
|
||||
return DD_FRONT_LEFT_BIT;
|
||||
return BUFFER_FRONT_LEFT;
|
||||
case GL_BACK:
|
||||
return DD_BACK_LEFT_BIT;
|
||||
return BUFFER_BACK_LEFT;
|
||||
case GL_RIGHT:
|
||||
return DD_FRONT_RIGHT_BIT;
|
||||
return BUFFER_FRONT_RIGHT;
|
||||
case GL_FRONT_RIGHT:
|
||||
return DD_FRONT_RIGHT_BIT;
|
||||
return BUFFER_FRONT_RIGHT;
|
||||
case GL_BACK_RIGHT:
|
||||
return DD_BACK_RIGHT_BIT;
|
||||
return BUFFER_BACK_RIGHT;
|
||||
case GL_BACK_LEFT:
|
||||
return DD_BACK_LEFT_BIT;
|
||||
return BUFFER_BACK_LEFT;
|
||||
case GL_LEFT:
|
||||
return DD_FRONT_LEFT_BIT;
|
||||
return BUFFER_FRONT_LEFT;
|
||||
case GL_FRONT_LEFT:
|
||||
return DD_FRONT_LEFT_BIT;
|
||||
return BUFFER_FRONT_LEFT;
|
||||
case GL_AUX0:
|
||||
return DD_AUX0_BIT;
|
||||
return BUFFER_AUX0;
|
||||
case GL_AUX1:
|
||||
return DD_AUX1_BIT;
|
||||
return BUFFER_AUX1;
|
||||
case GL_AUX2:
|
||||
return DD_AUX2_BIT;
|
||||
return BUFFER_AUX2;
|
||||
case GL_AUX3:
|
||||
return DD_AUX3_BIT;
|
||||
return BUFFER_AUX3;
|
||||
case GL_COLOR_ATTACHMENT0_EXT:
|
||||
return BUFFER_COLOR0;
|
||||
case GL_COLOR_ATTACHMENT1_EXT:
|
||||
return BUFFER_COLOR1;
|
||||
case GL_COLOR_ATTACHMENT2_EXT:
|
||||
return BUFFER_COLOR2;
|
||||
case GL_COLOR_ATTACHMENT3_EXT:
|
||||
return BUFFER_COLOR3;
|
||||
default:
|
||||
/* error */
|
||||
return ~0;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Specify which color buffers to draw into.
|
||||
* Called by glDrawBuffer().
|
||||
* Specify which renderbuffer(s) to draw into for the first color output.
|
||||
* <buffer> can name zero, one, two or four renderbuffers!
|
||||
* \sa _mesa_DrawBuffersARB
|
||||
*
|
||||
* \param mode color buffer combination.
|
||||
*
|
||||
* \sa glDrawBuffer().
|
||||
*
|
||||
* Flushes the vertices and verifies the parameter and updates the
|
||||
* gl_colorbuffer_attrib::_DrawDestMask bitfield. Marks new color state in
|
||||
* __GLcontextRec::NewState and notifies the driver via the
|
||||
* dd_function_table::DrawBuffer callback.
|
||||
* \param buffer buffer token such as GL_LEFT or GL_FRONT_AND_BACK, etc.
|
||||
*/
|
||||
void GLAPIENTRY
|
||||
_mesa_DrawBuffer( GLenum mode )
|
||||
_mesa_DrawBuffer(GLenum buffer)
|
||||
{
|
||||
GLenum destMask, supportedMask;
|
||||
GLuint bufferID;
|
||||
GLbitfield destMask;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); /* too complex... */
|
||||
|
||||
if (MESA_VERBOSE & VERBOSE_API)
|
||||
_mesa_debug(ctx, "glDrawBuffer %s\n", _mesa_lookup_enum_by_nr(mode));
|
||||
|
||||
/*
|
||||
* Do error checking and compute the _DrawDestMask bitfield.
|
||||
*/
|
||||
destMask = draw_buffer_enum_to_bitmask(mode);
|
||||
if (destMask == ~0u) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(mode)");
|
||||
return;
|
||||
if (MESA_VERBOSE & VERBOSE_API) {
|
||||
_mesa_debug(ctx, "glDrawBuffer %s\n", _mesa_lookup_enum_by_nr(buffer));
|
||||
}
|
||||
|
||||
supportedMask = supported_buffer_bitmask(ctx);
|
||||
destMask &= supportedMask;
|
||||
bufferID = ctx->DrawBuffer->Name;
|
||||
|
||||
if (destMask == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(mode)");
|
||||
return;
|
||||
if (buffer == GL_NONE) {
|
||||
destMask = 0x0;
|
||||
}
|
||||
else {
|
||||
const GLbitfield supportedMask = supported_buffer_bitmask(ctx, bufferID);
|
||||
destMask = draw_buffer_enum_to_bitmask(buffer);
|
||||
if (destMask == BAD_MASK) {
|
||||
/* totally bogus buffer */
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffer(buffer)");
|
||||
return;
|
||||
}
|
||||
destMask &= supportedMask;
|
||||
if (destMask == 0x0) {
|
||||
/* none of the named color buffers exist! */
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffer(buffer)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ctx->Color.DrawBuffer[0] = mode;
|
||||
ctx->Color._DrawDestMask[0] = destMask;
|
||||
ctx->NewState |= _NEW_COLOR;
|
||||
|
||||
/*
|
||||
* Call device driver function.
|
||||
*/
|
||||
if (ctx->Driver.DrawBuffer)
|
||||
(*ctx->Driver.DrawBuffer)(ctx, mode);
|
||||
/* if we get here, there's no error so set new state */
|
||||
_mesa_drawbuffers(ctx, 1, &buffer, &destMask);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called by glDrawBuffersARB; specifies the destination color buffers
|
||||
* Called by glDrawBuffersARB; specifies the destination color renderbuffers
|
||||
* for N fragment program color outputs.
|
||||
* \sa _mesa_DrawBuffer
|
||||
* \param n number of outputs
|
||||
* \param buffers array [n] of renderbuffer names. Unlike glDrawBuffer, the
|
||||
* names cannot specify more than one buffer. For example,
|
||||
* GL_FRONT_AND_BACK is illegal.
|
||||
*/
|
||||
void GLAPIENTRY
|
||||
_mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers)
|
||||
{
|
||||
GLint i;
|
||||
GLuint usedBufferMask, supportedMask;
|
||||
GLint output;
|
||||
GLuint bufferID;
|
||||
GLbitfield usedBufferMask, supportedMask;
|
||||
GLbitfield destMask[MAX_DRAW_BUFFERS];
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
||||
|
||||
if (!ctx->Extensions.ARB_draw_buffers) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffersARB");
|
||||
return;
|
||||
}
|
||||
if (n < 1 || n > (GLsizei) ctx->Const.MaxDrawBuffers) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glDrawBuffersARB(n)" );
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glDrawBuffersARB(n)");
|
||||
return;
|
||||
}
|
||||
|
||||
supportedMask = supported_buffer_bitmask(ctx);
|
||||
usedBufferMask = 0;
|
||||
for (i = 0; i < n; i++) {
|
||||
GLuint destMask = draw_buffer_enum_to_bitmask(buffers[i]);
|
||||
if (destMask == ~0u ) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffersARB(buffer)");
|
||||
return;
|
||||
}
|
||||
destMask &= supportedMask;
|
||||
if (destMask == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glDrawBuffersARB(unsupported buffer)");
|
||||
return;
|
||||
bufferID = ctx->DrawBuffer->Name;
|
||||
|
||||
supportedMask = supported_buffer_bitmask(ctx, bufferID);
|
||||
usedBufferMask = 0x0;
|
||||
|
||||
/* complicated error checking... */
|
||||
for (output = 0; output < n; output++) {
|
||||
if (buffers[output] == GL_NONE) {
|
||||
destMask[output] = 0x0;
|
||||
}
|
||||
if (destMask & usedBufferMask) {
|
||||
/* can't use a dest buffer more than once! */
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glDrawBuffersARB(duplicated buffer)");
|
||||
return;
|
||||
else {
|
||||
destMask[output] = draw_buffer_enum_to_bitmask(buffers[output]);
|
||||
if (destMask[output] == BAD_MASK
|
||||
|| _mesa_bitcount(destMask[output]) > 1) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffersARB(buffer)");
|
||||
return;
|
||||
}
|
||||
destMask[output] &= supportedMask;
|
||||
if (destMask[output] == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glDrawBuffersARB(unsupported buffer)");
|
||||
return;
|
||||
}
|
||||
if (destMask[output] & usedBufferMask) {
|
||||
/* can't specify a dest buffer more than once! */
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glDrawBuffersARB(duplicated buffer)");
|
||||
return;
|
||||
}
|
||||
|
||||
/* update bitmask */
|
||||
usedBufferMask |= destMask[output];
|
||||
}
|
||||
/* update bitmask */
|
||||
usedBufferMask |= destMask;
|
||||
/* save state */
|
||||
ctx->Color.DrawBuffer[i] = buffers[i];
|
||||
ctx->Color._DrawDestMask[i] = destMask;
|
||||
}
|
||||
|
||||
/* OK, if we get here, there were no errors so set the new state */
|
||||
_mesa_drawbuffers(ctx, n, buffers, destMask);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set color output state. Traditionally, there was only one color
|
||||
* output, but fragment programs can now have several distinct color
|
||||
* outputs (see GL_ARB_draw_buffers). This function sets the state
|
||||
* for one such color output.
|
||||
* \param ctx current context
|
||||
* \param output which fragment program output
|
||||
* \param buffer buffer to write to (like GL_LEFT)
|
||||
* \param destMask BUFFER_* bitmask
|
||||
* (like BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT).
|
||||
*/
|
||||
static void
|
||||
set_color_output(GLcontext *ctx, GLuint output, GLenum buffer,
|
||||
GLbitfield destMask)
|
||||
{
|
||||
struct gl_framebuffer *fb = ctx->DrawBuffer;
|
||||
|
||||
ASSERT(output < ctx->Const.MaxDrawBuffers);
|
||||
|
||||
/* Set per-FBO state */
|
||||
fb->ColorDrawBuffer[output] = buffer;
|
||||
fb->_ColorDrawBufferMask[output] = destMask;
|
||||
/* not really needed, will be set later */
|
||||
fb->_NumColorDrawBuffers[output] = 0;
|
||||
|
||||
/* Set traditional state var */
|
||||
ctx->Color.DrawBuffer[output] = buffer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helper routine used by _mesa_DrawBuffer, _mesa_DrawBuffersARB and
|
||||
* _mesa_PopAttrib to set drawbuffer state.
|
||||
* All error checking will have been done prior to calling this function
|
||||
* so nothing should go wrong at this point.
|
||||
* \param ctx current context
|
||||
* \param n number of color outputs to set
|
||||
* \param buffers array[n] of colorbuffer names, like GL_LEFT.
|
||||
* \param destMask array[n] of BUFFER_* bitmasks which correspond to the
|
||||
* colorbuffer names. (i.e. GL_FRONT_AND_BACK =>
|
||||
* BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT).
|
||||
*/
|
||||
void
|
||||
_mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
|
||||
const GLbitfield *destMask)
|
||||
{
|
||||
GLbitfield mask[MAX_DRAW_BUFFERS];
|
||||
GLuint output;
|
||||
|
||||
if (!destMask) {
|
||||
/* compute destMask values now */
|
||||
const GLuint bufferID = ctx->DrawBuffer->Name;
|
||||
const GLbitfield supportedMask = supported_buffer_bitmask(ctx, bufferID);
|
||||
for (output = 0; output < n; output++) {
|
||||
mask[output] = draw_buffer_enum_to_bitmask(buffers[output]);
|
||||
ASSERT(mask[output] != BAD_MASK);
|
||||
mask[output] &= supportedMask;
|
||||
}
|
||||
destMask = mask;
|
||||
}
|
||||
|
||||
for (output = 0; output < n; output++) {
|
||||
set_color_output(ctx, output, buffers[output], destMask[output]);
|
||||
}
|
||||
|
||||
/* set remaining color outputs to NONE */
|
||||
for (output = n; output < ctx->Const.MaxDrawBuffers; output++) {
|
||||
set_color_output(ctx, output, GL_NONE, 0x0);
|
||||
}
|
||||
|
||||
ctx->NewState |= _NEW_COLOR;
|
||||
@@ -380,56 +514,73 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers)
|
||||
* Call device driver function.
|
||||
*/
|
||||
if (ctx->Driver.DrawBuffers)
|
||||
(*ctx->Driver.DrawBuffers)(ctx, n, buffers);
|
||||
ctx->Driver.DrawBuffers(ctx, n, buffers);
|
||||
else if (ctx->Driver.DrawBuffer)
|
||||
ctx->Driver.DrawBuffer(ctx, buffers[0]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set the color buffer source for reading pixels.
|
||||
*
|
||||
* \param mode color buffer.
|
||||
*
|
||||
* \sa glReadBuffer().
|
||||
*
|
||||
* Verifies the parameter and updates gl_pixel_attrib::_ReadSrcMask. Marks
|
||||
* new pixel state in __GLcontextRec::NewState and notifies the driver via
|
||||
* dd_function_table::ReadBuffer.
|
||||
* Called by glReadBuffer to set the source renderbuffer for reading pixels.
|
||||
* \param mode color buffer such as GL_FRONT, GL_BACK, etc.
|
||||
*/
|
||||
void GLAPIENTRY
|
||||
_mesa_ReadBuffer( GLenum mode )
|
||||
_mesa_ReadBuffer(GLenum buffer)
|
||||
{
|
||||
GLuint srcMask, supportedMask;
|
||||
struct gl_framebuffer *fb;
|
||||
GLbitfield supportedMask;
|
||||
GLint srcBuffer;
|
||||
GLuint bufferID;
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
||||
|
||||
if (MESA_VERBOSE & VERBOSE_API)
|
||||
_mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(mode));
|
||||
fb = ctx->ReadBuffer;
|
||||
bufferID = fb->Name;
|
||||
|
||||
srcMask = read_buffer_enum_to_bitmask(mode);
|
||||
if (srcMask == ~0u) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(mode)");
|
||||
return;
|
||||
if (MESA_VERBOSE & VERBOSE_API)
|
||||
_mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(buffer));
|
||||
|
||||
if (bufferID > 0 && buffer == GL_NONE) {
|
||||
/* This is legal for user-created framebuffer objects */
|
||||
srcBuffer = -1;
|
||||
}
|
||||
supportedMask = supported_buffer_bitmask(ctx);
|
||||
if ((srcMask & supportedMask) == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadBuffer(mode)");
|
||||
return;
|
||||
else {
|
||||
/* general case / window-system framebuffer */
|
||||
srcBuffer = read_buffer_enum_to_index(buffer);
|
||||
if (srcBuffer == -1) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glReadBuffer(buffer=0x%x)", buffer);
|
||||
return;
|
||||
}
|
||||
supportedMask = supported_buffer_bitmask(ctx, bufferID);
|
||||
if (((1 << srcBuffer) & supportedMask) == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glReadBuffer(buffer=0x%x)", buffer);
|
||||
return;
|
||||
}
|
||||
}
|
||||
ctx->Pixel._ReadSrcMask = srcMask;
|
||||
ctx->Pixel.ReadBuffer = mode;
|
||||
|
||||
if (bufferID == 0) {
|
||||
ctx->Pixel.ReadBuffer = buffer;
|
||||
}
|
||||
fb->ColorReadBuffer = buffer;
|
||||
fb->_ColorReadBufferIndex = srcBuffer;
|
||||
|
||||
ctx->NewState |= _NEW_PIXEL;
|
||||
|
||||
/*
|
||||
* Call device driver function.
|
||||
*/
|
||||
if (ctx->Driver.ReadBuffer)
|
||||
(*ctx->Driver.ReadBuffer)(ctx, mode);
|
||||
(*ctx->Driver.ReadBuffer)(ctx, buffer);
|
||||
}
|
||||
|
||||
|
||||
#if _HAVE_FULL_GL
|
||||
|
||||
/**
|
||||
* XXX THIS IS OBSOLETE - drivers should take care of detecting window
|
||||
* size changes and act accordingly, likely calling _mesa_resize_framebuffer().
|
||||
*
|
||||
* GL_MESA_resize_buffers extension.
|
||||
*
|
||||
* When this function is called, we'll ask the window system how large
|
||||
@@ -437,56 +588,68 @@ _mesa_ReadBuffer( GLenum mode )
|
||||
* ResizeBuffers function. The driver will then resize its color buffers
|
||||
* as needed, and maybe call the swrast's routine for reallocating
|
||||
* swrast-managed depth/stencil/accum/etc buffers.
|
||||
* \note This function may be called from within Mesa or called by the
|
||||
* user directly (see the GL_MESA_resize_buffers extension).
|
||||
* \note This function should only be called through the GL API, not
|
||||
* from device drivers (as was done in the past).
|
||||
*/
|
||||
|
||||
void _mesa_resizebuffers( GLcontext *ctx )
|
||||
{
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx );
|
||||
|
||||
if (MESA_VERBOSE & VERBOSE_API)
|
||||
_mesa_debug(ctx, "glResizeBuffersMESA\n");
|
||||
|
||||
if (!ctx->Driver.GetBufferSize) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->WinSysDrawBuffer) {
|
||||
GLuint newWidth, newHeight;
|
||||
GLframebuffer *buffer = ctx->WinSysDrawBuffer;
|
||||
|
||||
assert(buffer->Name == 0);
|
||||
|
||||
/* ask device driver for size of output buffer */
|
||||
ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight );
|
||||
|
||||
/* see if size of device driver's color buffer (window) has changed */
|
||||
if (buffer->Width != newWidth || buffer->Height != newHeight) {
|
||||
if (ctx->Driver.ResizeBuffers)
|
||||
ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight );
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->WinSysReadBuffer
|
||||
&& ctx->WinSysReadBuffer != ctx->WinSysDrawBuffer) {
|
||||
GLuint newWidth, newHeight;
|
||||
GLframebuffer *buffer = ctx->WinSysReadBuffer;
|
||||
|
||||
assert(buffer->Name == 0);
|
||||
|
||||
/* ask device driver for size of read buffer */
|
||||
ctx->Driver.GetBufferSize( buffer, &newWidth, &newHeight );
|
||||
|
||||
/* see if size of device driver's color buffer (window) has changed */
|
||||
if (buffer->Width != newWidth || buffer->Height != newHeight) {
|
||||
if (ctx->Driver.ResizeBuffers)
|
||||
ctx->Driver.ResizeBuffers(ctx, buffer, newWidth, newHeight );
|
||||
}
|
||||
}
|
||||
|
||||
ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* XXX THIS IS OBSOLETE
|
||||
*/
|
||||
void GLAPIENTRY
|
||||
_mesa_ResizeBuffersMESA( void )
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
if (MESA_VERBOSE & VERBOSE_API)
|
||||
_mesa_debug(ctx, "glResizeBuffersMESA\n");
|
||||
|
||||
if (ctx) {
|
||||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx );
|
||||
|
||||
if (ctx->DrawBuffer) {
|
||||
GLuint buf_width, buf_height;
|
||||
GLframebuffer *buffer = ctx->DrawBuffer;
|
||||
|
||||
/* ask device driver for size of output buffer */
|
||||
(*ctx->Driver.GetBufferSize)( buffer, &buf_width, &buf_height );
|
||||
|
||||
/* see if size of device driver's color buffer (window) has changed */
|
||||
if (buffer->Width == buf_width && buffer->Height == buf_height)
|
||||
return; /* size is as expected */
|
||||
|
||||
buffer->Width = buf_width;
|
||||
buffer->Height = buf_height;
|
||||
|
||||
ctx->Driver.ResizeBuffers( buffer );
|
||||
}
|
||||
|
||||
if (ctx->ReadBuffer && ctx->ReadBuffer != ctx->DrawBuffer) {
|
||||
GLuint buf_width, buf_height;
|
||||
GLframebuffer *buffer = ctx->ReadBuffer;
|
||||
|
||||
/* ask device driver for size of read buffer */
|
||||
(*ctx->Driver.GetBufferSize)( buffer, &buf_width, &buf_height );
|
||||
|
||||
/* see if size of device driver's color buffer (window) has changed */
|
||||
if (buffer->Width == buf_width && buffer->Height == buf_height)
|
||||
return; /* size is as expected */
|
||||
|
||||
buffer->Width = buf_width;
|
||||
buffer->Height = buf_height;
|
||||
|
||||
ctx->Driver.ResizeBuffers( buffer );
|
||||
}
|
||||
|
||||
ctx->NewState |= _NEW_BUFFERS; /* to update scissor / window bounds */
|
||||
}
|
||||
if (ctx->Extensions.MESA_resize_buffers)
|
||||
_mesa_resizebuffers( ctx );
|
||||
}
|
||||
|
||||
|
||||
@@ -509,7 +672,8 @@ _mesa_SampleCoverageARB(GLclampf value, GLboolean invert)
|
||||
ctx->NewState |= _NEW_MULTISAMPLE;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* _HAVE_FULL_GL */
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -525,20 +689,10 @@ _mesa_SampleCoverageARB(GLclampf value, GLboolean invert)
|
||||
* change flushes the vertices and notifies the driver via
|
||||
* the dd_function_table::Scissor callback.
|
||||
*/
|
||||
void GLAPIENTRY
|
||||
_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
|
||||
void
|
||||
_mesa_set_scissor(GLcontext *ctx,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
||||
if (width < 0 || height < 0) {
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glScissor" );
|
||||
return;
|
||||
}
|
||||
|
||||
if (MESA_VERBOSE & VERBOSE_API)
|
||||
_mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height);
|
||||
|
||||
if (x == ctx->Scissor.X &&
|
||||
y == ctx->Scissor.Y &&
|
||||
width == ctx->Scissor.Width &&
|
||||
@@ -556,56 +710,35 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/** \name State management */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Update screen bounds.
|
||||
*
|
||||
* \param ctx GL context.
|
||||
*
|
||||
* Update gl_frame_buffer::_Xmin, and etc.
|
||||
*/
|
||||
void _mesa_update_buffers( GLcontext *ctx )
|
||||
void GLAPIENTRY
|
||||
_mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
|
||||
{
|
||||
ctx->DrawBuffer->_Xmin = 0;
|
||||
ctx->DrawBuffer->_Ymin = 0;
|
||||
ctx->DrawBuffer->_Xmax = ctx->DrawBuffer->Width;
|
||||
ctx->DrawBuffer->_Ymax = ctx->DrawBuffer->Height;
|
||||
if (ctx->Scissor.Enabled) {
|
||||
if (ctx->Scissor.X > ctx->DrawBuffer->_Xmin) {
|
||||
ctx->DrawBuffer->_Xmin = ctx->Scissor.X;
|
||||
}
|
||||
if (ctx->Scissor.Y > ctx->DrawBuffer->_Ymin) {
|
||||
ctx->DrawBuffer->_Ymin = ctx->Scissor.Y;
|
||||
}
|
||||
if (ctx->Scissor.X + ctx->Scissor.Width < ctx->DrawBuffer->_Xmax) {
|
||||
ctx->DrawBuffer->_Xmax = ctx->Scissor.X + ctx->Scissor.Width;
|
||||
}
|
||||
if (ctx->Scissor.Y + ctx->Scissor.Height < ctx->DrawBuffer->_Ymax) {
|
||||
ctx->DrawBuffer->_Ymax = ctx->Scissor.Y + ctx->Scissor.Height;
|
||||
}
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
ASSERT_OUTSIDE_BEGIN_END(ctx);
|
||||
|
||||
if (width < 0 || height < 0) {
|
||||
_mesa_error( ctx, GL_INVALID_VALUE, "glScissor" );
|
||||
return;
|
||||
}
|
||||
|
||||
if (MESA_VERBOSE & VERBOSE_API)
|
||||
_mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height);
|
||||
|
||||
_mesa_set_scissor(ctx, x, y, width, height);
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/** \name Initialization */
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* Initialize the context scissor data.
|
||||
*
|
||||
* \param ctx GL context.
|
||||
*
|
||||
* Initializes the __GLcontextRec::Scissor and __GLcontextRec::Multisample
|
||||
* attribute groups, and related constants in __GLcontextRec::Const.
|
||||
* Initialize the context's scissor state.
|
||||
* \param ctx the GL context.
|
||||
*/
|
||||
void _mesa_init_buffers( GLcontext * ctx )
|
||||
void
|
||||
_mesa_init_scissor(GLcontext *ctx)
|
||||
{
|
||||
/* Scissor group */
|
||||
ctx->Scissor.Enabled = GL_FALSE;
|
||||
@@ -613,15 +746,22 @@ void _mesa_init_buffers( GLcontext * ctx )
|
||||
ctx->Scissor.Y = 0;
|
||||
ctx->Scissor.Width = 0;
|
||||
ctx->Scissor.Height = 0;
|
||||
}
|
||||
|
||||
/* Multisample */
|
||||
|
||||
/**
|
||||
* Initialize the context's multisample state.
|
||||
* \param ctx the GL context.
|
||||
*/
|
||||
void
|
||||
_mesa_init_multisample(GLcontext *ctx)
|
||||
{
|
||||
ctx->Multisample.Enabled = GL_FALSE;
|
||||
ctx->Multisample.SampleAlphaToCoverage = GL_FALSE;
|
||||
ctx->Multisample.SampleAlphaToOne = GL_FALSE;
|
||||
ctx->Multisample.SampleCoverage = GL_FALSE;
|
||||
ctx->Multisample.SampleCoverageValue = 1.0;
|
||||
ctx->Multisample.SampleCoverageInvert = GL_FALSE;
|
||||
|
||||
}
|
||||
|
||||
/*@}*/
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 3.5
|
||||
* Version: 6.5
|
||||
*
|
||||
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -52,6 +52,10 @@ _mesa_DrawBuffer( GLenum mode );
|
||||
extern void GLAPIENTRY
|
||||
_mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers);
|
||||
|
||||
extern void
|
||||
_mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers,
|
||||
const GLbitfield *destMask);
|
||||
|
||||
extern void GLAPIENTRY
|
||||
_mesa_ReadBuffer( GLenum mode );
|
||||
|
||||
@@ -65,9 +69,15 @@ extern void GLAPIENTRY
|
||||
_mesa_SampleCoverageARB(GLclampf value, GLboolean invert);
|
||||
|
||||
extern void
|
||||
_mesa_init_buffers( GLcontext * ctx );
|
||||
_mesa_init_scissor(GLcontext *ctx);
|
||||
|
||||
extern void
|
||||
_mesa_update_buffers( GLcontext *ctx );
|
||||
_mesa_init_multisample(GLcontext *ctx);
|
||||
|
||||
extern void
|
||||
_mesa_set_scissor(GLcontext *ctx,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
extern void _mesa_resizebuffers( GLcontext *ctx );
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 5.1
|
||||
* Version: 6.3
|
||||
*
|
||||
* Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -68,7 +67,7 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
|
||||
* clipping now takes place. The clip-space equations are recalculated
|
||||
* whenever the projection matrix changes.
|
||||
*/
|
||||
if (ctx->ModelviewMatrixStack.Top->flags & MAT_DIRTY)
|
||||
if (_math_matrix_is_dirty(ctx->ModelviewMatrixStack.Top))
|
||||
_math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
|
||||
|
||||
_mesa_transform_vector( equation, equation,
|
||||
@@ -85,7 +84,7 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
|
||||
* code in _mesa_update_state().
|
||||
*/
|
||||
if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
|
||||
if (ctx->ProjectionMatrixStack.Top->flags & MAT_DIRTY)
|
||||
if (_math_matrix_is_dirty(ctx->ProjectionMatrixStack.Top))
|
||||
_math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
|
||||
|
||||
_mesa_transform_vector( ctx->Transform._ClipUserPlane[p],
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user