VirtualBox

source: vbox/trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/get_components.py@ 43233

最後變更 在這個檔案從43233是 36052,由 vboxsync 提交於 14 年 前

crOpenGL: use PBO to get texture data in offscreen rendering mode

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 5.8 KB
 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6num_components = {
7 'GL_AMBIENT' : 4,
8 'GL_DIFFUSE' : 4,
9 'GL_SPECULAR' : 4,
10 'GL_POSITION' : 4,
11 'GL_SPOT_DIRECTION' : 3,
12 'GL_SPOT_EXPONENT' : 1,
13 'GL_SPOT_CUTOFF' : 1,
14 'GL_CONSTANT_ATTENUATION' : 1,
15 'GL_LINEAR_ATTENUATION' : 1,
16 'GL_QUADRATIC_ATTENUATION' : 1,
17 'GL_EMISSION' : 4,
18 'GL_SHININESS' : 1,
19 'GL_COLOR_INDEXES' : 3,
20 'GL_TEXTURE_ENV_MODE' : 1,
21 'GL_TEXTURE_ENV_COLOR' : 4,
22 'GL_TEXTURE_GEN_MODE' : 1,
23 'GL_OBJECT_PLANE' : 4,
24 'GL_EYE_PLANE' : 4,
25 'GL_TEXTURE_MAG_FILTER' : 1,
26 'GL_TEXTURE_MIN_FILTER' : 1,
27 'GL_TEXTURE_WRAP_S' : 1,
28 'GL_TEXTURE_WRAP_T' : 1,
29 'GL_TEXTURE_BORDER_COLOR' : 4,
30 'GL_TEXTURE_WIDTH': 1,
31 'GL_TEXTURE_HEIGHT': 1,
32 'GL_TEXTURE_DEPTH': 1,
33 # 'GL_TEXTURE_INTERNAL_FORMAT': 1, THIS CONFLICTS WITH GL_TEXTURE_COMPONENTS!
34 'GL_TEXTURE_BORDER': 1,
35 'GL_TEXTURE_RED_SIZE': 1,
36 'GL_TEXTURE_GREEN_SIZE': 1,
37 'GL_TEXTURE_BLUE_SIZE': 1,
38 'GL_TEXTURE_ALPHA_SIZE': 1,
39 'GL_TEXTURE_LUMINANCE_SIZE': 1,
40 'GL_TEXTURE_INTENSITY_SIZE': 1,
41 'GL_TEXTURE_COMPONENTS': 1,
42 'GL_TEXTURE_RESIDENT': 1
43}
44
45num_extended_components = {
46 'GL_TEXTURE_MAX_ANISOTROPY_EXT': ( 1, 'CR_EXT_texture_filter_anisotropic' ),
47 'GL_TEXTURE_WRAP_R': ( 1, 'CR_OPENGL_VERSION_1_2'),
48 'GL_TEXTURE_PRIORITY': ( 1, 'CR_OPENGL_VERSION_1_2'),
49 'GL_TEXTURE_MIN_LOD': ( 1, 'CR_OPENGL_VERSION_1_2'),
50 'GL_TEXTURE_MAX_LOD': ( 1, 'CR_OPENGL_VERSION_1_2'),
51 'GL_TEXTURE_BASE_LEVEL': ( 1, 'CR_OPENGL_VERSION_1_2'),
52 'GL_TEXTURE_MAX_LEVEL': ( 1, 'CR_OPENGL_VERSION_1_2'),
53 'GL_COMBINER_INPUT_NV': ( 1, 'CR_NV_register_combiners'),
54 'GL_COMBINER_MAPPING_NV': ( 1, 'CR_NV_register_combiners'),
55 'GL_COMBINER_COMPONENT_USAGE_NV': ( 1, 'CR_NV_register_combiners'),
56 'GL_COMBINER_AB_DOT_PRODUCT_NV': ( 1, 'CR_NV_register_combiners'),
57 'GL_COMBINER_CD_DOT_PRODUCT_NV': ( 1, 'CR_NV_register_combiners'),
58 'GL_COMBINER_MUX_SUM_NV': ( 1, 'CR_NV_register_combiners'),
59 'GL_COMBINER_SCALE_NV': ( 1, 'CR_NV_register_combiners'),
60 'GL_COMBINER_BIAS_NV': ( 1, 'CR_NV_register_combiners'),
61 'GL_COMBINER_AB_OUTPUT_NV': ( 1, 'CR_NV_register_combiners'),
62 'GL_COMBINER_CD_OUTPUT_NV': ( 1, 'CR_NV_register_combiners'),
63 'GL_COMBINER_SUM_OUTPUT_NV': ( 1, 'CR_NV_register_combiners'),
64 'GL_COMBINER_INPUT_NV': ( 1, 'CR_NV_register_combiners'),
65 'GL_COMBINER_INPUT_NV': ( 1, 'CR_NV_register_combiners'),
66 'GL_COMBINER_MAPPING_NV': ( 1, 'CR_NV_register_combiners'),
67 'GL_COMBINER_COMPONENT_USAGE_NV': ( 1, 'CR_NV_register_combiners'),
68 'GL_CONSTANT_COLOR0_NV': ( 4, 'CR_NV_register_combiners'),
69 'GL_CONSTANT_COLOR1_NV': ( 4, 'CR_NV_register_combiners'),
70 'GL_COMBINE_RGB_ARB': (1, 'CR_ARB_texture_env_combine'),
71 'GL_COMBINE_ALPHA_ARB': (1, 'CR_ARB_texture_env_combine'),
72 'GL_SOURCE0_RGB_ARB': (1, 'CR_ARB_texture_env_combine'),
73 'GL_SOURCE1_RGB_ARB': (1, 'CR_ARB_texture_env_combine'),
74 'GL_SOURCE2_RGB_ARB': (1, 'CR_ARB_texture_env_combine'),
75 'GL_SOURCE0_ALPHA_ARB': (1, 'CR_ARB_texture_env_combine'),
76 'GL_SOURCE1_ALPHA_ARB': (1, 'CR_ARB_texture_env_combine'),
77 'GL_SOURCE2_ALPHA_ARB': (1, 'CR_ARB_texture_env_combine'),
78 'GL_OPERAND0_RGB_ARB': (1, 'CR_ARB_texture_env_combine'),
79 'GL_OPERAND1_RGB_ARB': (1, 'CR_ARB_texture_env_combine'),
80 'GL_OPERAND2_RGB_ARB': (1, 'CR_ARB_texture_env_combine'),
81 'GL_OPERAND0_ALPHA_ARB': (1, 'CR_ARB_texture_env_combine'),
82 'GL_OPERAND1_ALPHA_ARB': (1, 'CR_ARB_texture_env_combine'),
83 'GL_OPERAND2_ALPHA_ARB': (1, 'CR_ARB_texture_env_combine'),
84 'GL_RGB_SCALE_ARB': (1, 'CR_ARB_texture_env_combine'),
85 'GL_ALPHA_SCALE': (1, 'CR_ARB_texture_env_combine'),
86 'GL_DEPTH_TEXTURE_MODE_ARB': (1, 'CR_ARB_depth_texture'),
87 'GL_TEXTURE_DEPTH_SIZE_ARB': (1, 'CR_ARB_depth_texture'),
88 'GL_TEXTURE_COMPARE_MODE_ARB': (1, 'CR_ARB_shadow'),
89 'GL_TEXTURE_COMPARE_FUNC_ARB': (1, 'CR_ARB_shadow'),
90 'GL_TEXTURE_COMPARE_FAIL_VALUE_ARB': (1, 'CR_ARB_shadow_ambient'),
91 'GL_GENERATE_MIPMAP_SGIS': (1, 'CR_SGIS_generate_mipmap'),
92 'GL_TEXTURE_LOD_BIAS_EXT': (1, 'CR_EXT_texture_lod_bias'),
93 'GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB': (1, 'CR_any_vertex_program'),
94 'GL_CURRENT_VERTEX_ATTRIB_ARB': (4, 'CR_any_vertex_program'),
95 'GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB': (1, 'CR_any_vertex_program'),
96 'GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB': (1, 'CR_any_vertex_program'),
97 'GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB': (1, 'CR_any_vertex_program'),
98 'GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB': (1, 'CR_any_vertex_program'),
99 'GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB': (1, 'CR_any_vertex_program'),
100 'GL_TRACK_MATRIX_NV': (24, 'CR_any_vertex_program'),
101 'GL_TRACK_MATRIX_TRANSFORM_NV': (24, 'CR_any_vertex_program'),
102 'GL_BUFFER_SIZE_ARB': (1, 'CR_ARB_vertex_buffer_object'),
103 'GL_BUFFER_USAGE_ARB': (1, 'CR_ARB_vertex_buffer_object'),
104 'GL_BUFFER_ACCESS_ARB': (1, 'CR_ARB_vertex_buffer_object'),
105 'GL_BUFFER_MAPPED_ARB': (1, 'CR_ARB_vertex_buffer_object'),
106 'GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB': (1, 'CR_ARB_vertex_buffer_object'),
107 'GL_QUERY_COUNTER_BITS_ARB': (1, 'CR_ARB_occlusion_query'),
108 'GL_QUERY_RESULT_AVAILABLE_ARB': (1, 'CR_ARB_occlusion_query'),
109 'GL_QUERY_RESULT_ARB': (1, 'CR_ARB_occlusion_query'),
110 'GL_CURRENT_QUERY_ARB': (1, 'CR_ARB_occlusion_query'),
111 'GL_TEXTURE_COMPRESSED_IMAGE_SIZE': (1, 'CR_ARB_texture_compression'),
112 'GL_TEXTURE_COMPRESSED': (1, 'CR_ARB_texture_compression'),
113 'GL_COORD_REPLACE_ARB': (1, 'CR_ARB_point_sprite'),
114}
115
116print """static unsigned int lookupComponents( GLenum pname )
117{
118 switch( pname )
119 {
120"""
121comps = num_components.keys();
122comps.sort();
123for comp in comps:
124 print '\t\t\tcase %s: return %d;' % (comp,num_components[comp])
125
126comps = num_extended_components.keys();
127comps.sort();
128for comp in comps:
129 (nc, ifdef) = num_extended_components[comp]
130 print '#ifdef %s' % ifdef
131 print '\t\t\tcase %s: return %d;' % (comp,nc)
132 print '#endif /* %s */' % ifdef
133
134print """
135 default:
136 crError( "Unknown parameter name in lookupComponents: %d", (int) pname );
137 break;
138 }
139 /* NOTREACHED */
140 return 0;
141}
142"""
143
144
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette