1 // 2 // Copyright 2015 The ANGLE Project Authors. All rights reserved. 3 // Use of this source code is governed by a BSD-style license that can be 4 // found in the LICENSE file. 5 // 6 7 // platform_glx.h: Includes specific to GLX. 8 9 #ifndef LIBANGLE_RENDERER_GL_GLX_PLATFORMGLX_H_ 10 #define LIBANGLE_RENDERER_GL_GLX_PLATFORMGLX_H_ 11 12 #if !defined(ANGLE_SKIP_GLX_DEFINES) 13 // GLX 1.0 14 # define GLX_USE_GL 1 15 # define GLX_BUFFER_SIZE 2 16 # define GLX_LEVEL 3 17 # define GLX_RGBA 4 18 # define GLX_DOUBLEBUFFER 5 19 # define GLX_STEREO 6 20 # define GLX_AUX_BUFFERS 7 21 # define GLX_RED_SIZE 8 22 # define GLX_GREEN_SIZE 9 23 # define GLX_BLUE_SIZE 10 24 # define GLX_ALPHA_SIZE 11 25 # define GLX_DEPTH_SIZE 12 26 # define GLX_STENCIL_SIZE 13 27 # define GLX_ACCUM_RED_SIZE 14 28 # define GLX_ACCUM_GREEN_SIZE 15 29 # define GLX_ACCUM_BLUE_SIZE 16 30 # define GLX_ACCUM_ALPHA_SIZE 17 31 32 # define GLX_BAD_SCREEN 1 33 # define GLX_BAD_ATTRIBUTE 2 34 # define GLX_NO_EXTENSION 3 35 # define GLX_BAD_VISUAL 4 36 # define GLX_BAD_CONTEXT 5 37 # define GLX_BAD_VALUE 6 38 # define GLX_BAD_ENUM 7 39 40 // GLX 1.1 41 # define GLX_VENDOR 1 42 # define GLX_VERSION 2 43 # define GLX_EXTENSIONS 3 44 45 // GLX 1.3 46 # define GLX_CONFIG_CAVEAT 0x20 47 # define GLX_DONT_CARE 0xFFFFFFFF 48 # define GLX_X_VISUAL_TYPE 0x22 49 # define GLX_TRANSPARENT_TYPE 0x23 50 # define GLX_TRANSPARENT_INDEX_VALUE 0x24 51 # define GLX_TRANSPARENT_RED_VALUE 0x25 52 # define GLX_TRANSPARENT_GREEN_VALUE 0x26 53 # define GLX_TRANSPARENT_BLUE_VALUE 0x27 54 # define GLX_TRANSPARENT_ALPHA_VALUE 0x28 55 # define GLX_WINDOW_BIT 0x00000001 56 # define GLX_PIXMAP_BIT 0x00000002 57 # define GLX_PBUFFER_BIT 0x00000004 58 # define GLX_AUX_BUFFERS_BIT 0x00000010 59 # define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 60 # define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 61 # define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 62 # define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 63 # define GLX_DEPTH_BUFFER_BIT 0x00000020 64 # define GLX_STENCIL_BUFFER_BIT 0x00000040 65 # define GLX_ACCUM_BUFFER_BIT 0x00000080 66 # define GLX_NONE 0x8000 67 # define GLX_SLOW_CONFIG 0x8001 68 # define GLX_TRUE_COLOR 0x8002 69 # define GLX_DIRECT_COLOR 0x8003 70 # define GLX_PSEUDO_COLOR 0x8004 71 # define GLX_STATIC_COLOR 0x8005 72 # define GLX_GRAY_SCALE 0x8006 73 # define GLX_STATIC_GRAY 0x8007 74 # define GLX_TRANSPARENT_RGB 0x8008 75 # define GLX_TRANSPARENT_INDEX 0x8009 76 # define GLX_VISUAL_ID 0x800B 77 # define GLX_SCREEN 0x800C 78 # define GLX_NON_CONFORMANT_CONFIG 0x800D 79 # define GLX_DRAWABLE_TYPE 0x8010 80 # define GLX_RENDER_TYPE 0x8011 81 # define GLX_X_RENDERABLE 0x8012 82 # define GLX_FBCONFIG_ID 0x8013 83 # define GLX_RGBA_TYPE 0x8014 84 # define GLX_COLOR_INDEX_TYPE 0x8015 85 # define GLX_MAX_PBUFFER_WIDTH 0x8016 86 # define GLX_MAX_PBUFFER_HEIGHT 0x8017 87 # define GLX_MAX_PBUFFER_PIXELS 0x8018 88 # define GLX_PRESERVED_CONTENTS 0x801B 89 # define GLX_LARGEST_PBUFFER 0x801C 90 # define GLX_WIDTH 0x801D 91 # define GLX_HEIGHT 0x801E 92 # define GLX_EVENT_MASK 0x801F 93 # define GLX_DAMAGED 0x8020 94 # define GLX_SAVED 0x8021 95 # define GLX_WINDOW 0x8022 96 # define GLX_PBUFFER 0x8023 97 # define GLX_PBUFFER_HEIGHT 0x8040 98 # define GLX_PBUFFER_WIDTH 0x8041 99 # define GLX_RGBA_BIT 0x00000001 100 # define GLX_COLOR_INDEX_BIT 0x00000002 101 # define GLX_PBUFFER_CLOBBER_MASK 0x08000000 102 103 // GLX 1.4 104 # define GLX_SAMPLE_BUFFERS 0x186a0 105 # define GLX_SAMPLES 0x186a1 106 107 // GLX_ARB_create_context 108 # define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 109 # define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 110 # define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 111 # define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 112 # define GLX_CONTEXT_FLAGS_ARB 0x2094 113 114 // GLX_ARB_create_context_profile 115 # define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 116 # define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 117 # define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 118 119 // GLX_ARB_create_context_robustness 120 # define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 121 # define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 122 # define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 123 # define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 124 125 // GLX_EXT_create_context_es2_profile 126 # define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 127 128 // GLX_EXT_texture_from_pixmap 129 # define GLX_TEXTURE_1D_BIT_EXT 0x00000001 130 # define GLX_TEXTURE_2D_BIT_EXT 0x00000002 131 # define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 132 # define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 133 # define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 134 # define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 135 # define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 136 # define GLX_Y_INVERTED_EXT 0x20D4 137 # define GLX_TEXTURE_FORMAT_EXT 0x20D5 138 # define GLX_TEXTURE_TARGET_EXT 0x20D6 139 # define GLX_MIPMAP_TEXTURE_EXT 0x20D7 140 # define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 141 # define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 142 # define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA 143 # define GLX_TEXTURE_1D_EXT 0x20DB 144 # define GLX_TEXTURE_2D_EXT 0x20DC 145 # define GLX_TEXTURE_RECTANGLE_EXT 0x20DD 146 # define GLX_FRONT_LEFT_EXT 0x20DE 147 # define GLX_FRONT_RIGHT_EXT 0x20DF 148 # define GLX_BACK_LEFT_EXT 0x20E0 149 # define GLX_BACK_RIGHT_EXT 0x20E1 150 # define GLX_FRONT_EXT 0x20DE 151 # define GLX_BACK_EXT 0x20E0 152 # define GLX_AUX0_EXT 0x20E2 153 # define GLX_AUX1_EXT 0x20E3 154 # define GLX_AUX2_EXT 0x20E4 155 # define GLX_AUX3_EXT 0x20E5 156 # define GLX_AUX4_EXT 0x20E6 157 # define GLX_AUX5_EXT 0x20E7 158 # define GLX_AUX6_EXT 0x20E8 159 # define GLX_AUX7_EXT 0x20E9 160 # define GLX_AUX8_EXT 0x20EA 161 # define GLX_AUX9_EXT 0x20EB 162 163 // GLX_EXT_swap_control 164 # define GLX_SWAP_INTERVAL_EXT 0x20F1 165 # define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 166 #endif // !defined(ANGLE_SKIP_GLX_DEFINES) 167 168 // GLX typedefs depend on the X headers 169 #include <X11/Xlib.h> 170 #include <X11/Xresource.h> 171 #include <X11/Xutil.h> 172 173 // GLX typedefs 174 namespace glx 175 { 176 177 typedef void *Context; 178 typedef void *FBConfig; 179 typedef XID FBConfigID; 180 typedef XID ContextID; 181 typedef XID Window; 182 typedef XID Pbuffer; 183 typedef XID Pixmap; 184 typedef XID Drawable; 185 186 } // namespace glx 187 188 typedef void *(*PFNGETPROCPROC)(const char *name); 189 190 #endif // LIBANGLE_RENDERER_GL_GLX_PLATFORMGLX_H_ 191