1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
/**************************************************************************
*
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
* 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
* TUNGSTEN GRAPHICS 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.
**************************************************************************/
#include "main/mtypes.h"
#include "main/context.h"
#include "main/imports.h"
#include "main/get.h"
extern const GLubyte * GLAPIENTRY _es_GetString(GLenum name);
static const char *
compute_es_version(void)
{
static const char es_1_0[] = "OpenGL ES-CM 1.0";
static const char es_1_1[] = "OpenGL ES-CM 1.1";
(void) es_1_0;
return es_1_1;
}
/**
* Note: a more dynamic solution would be query the underlying GL
* and translate extension names...
*/
static const char *
extension_string(void)
{
return
/* Core additions */
"GL_OES_byte_coordinates "
"GL_OES_fixed_point "
"GL_OES_single_precision "
"GL_OES_matrix_get "
/* 1.1 required extensions */
"GL_OES_read_format "
"GL_OES_compressed_paletted_texture "
"GL_OES_point_size_array "
"GL_OES_point_sprite "
/* 1.1 optional extensions */
"GL_OES_draw_texture "
/* 1.1 deprecated extensions */
"GL_OES_query_matrix "
/* Newer extensions */
"GL_OES_blend_equation_separate "
"GL_OES_blend_func_separate "
"GL_OES_blend_subtract "
"GL_OES_depth24 "
"GL_OES_depth32 "
"GL_OES_element_index_uint "
"GL_OES_fbo_render_mipmap "
"GL_OES_framebuffer_object "
"GL_OES_mapbuffer "
"GL_OES_rgb8_rgba8 "
"GL_OES_stencil1 "
"GL_OES_stencil4 "
"GL_OES_stencil8 "
"GL_OES_texture_cube_map "
"GL_OES_texture_env_crossbar "
"GL_OES_texture_mirrored_repeat "
"GL_EXT_texture_filter_anisotropic "
;
}
const GLubyte * GLAPIENTRY
_es_GetString(GLenum name)
{
switch (name) {
case GL_VERSION:
return (const GLubyte *) compute_es_version();
case GL_EXTENSIONS:
return (const GLubyte *) extension_string();
default:
return _mesa_GetString(name);
}
}
void
_mesa_initialize_context_extra(GLcontext *ctx)
{
/* FEATURE_es2_glsl is on */
ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE;
ctx->VertexProgram._MaintainTnlProgram = GL_TRUE;
}
|