Changeset 3598 for trunk/src/opengl/mesa/config.c
- Timestamp:
- May 23, 2000, 10:41:28 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/opengl/mesa/config.c
r2938 r3598 1 /* $Id: config.c,v 1. 1 2000-02-29 00:50:00 sandervlExp $ */1 /* $Id: config.c,v 1.2 2000-05-23 20:40:25 jeroen Exp $ */ 2 2 3 3 /* 4 4 * Mesa 3-D graphics library 5 * Version: 3. 15 * Version: 3.3 6 6 * 7 7 * Copyright (C) 1999 Brian Paul All Rights Reserved. … … 32 32 */ 33 33 34 #ifndef XFree86Server 35 #include <stdio.h> 36 #include <stdlib.h> 37 #include <ctype.h> 38 #else 39 #include "GL/xf86glx.h" 40 #endif 41 34 #include "glheader.h" 42 35 #include "enums.h" 43 36 #include "config.h" … … 45 38 #include "extensions.h" 46 39 #include "simple_list.h" 47 #include "glmisc.h" 40 #include "mem.h" 41 #include "hint.h" 48 42 49 43 typedef enum { nil_t, list_t, word_t } node_type; … … 70 64 switch (n->data.l.head->type) { 71 65 case list_t: 72 73 66 print_list( n->data.l.head, indent + 2 ); 67 break; 74 68 case word_t: 75 76 69 printf( n->data.l.head->data.w.text ); 70 break; 77 71 case nil_t: 78 79 72 printf("()"); 73 break; 80 74 default: 81 75 puts("***"); 82 76 } 83 77 n = n->data.l.tail; … … 140 134 int c = getc(file); 141 135 if (len == sz) 142 136 text = (char *) realloc( text, sizeof(char) * (sz *= 2) ); 143 137 if (c == EOF || isspace(c) || c == ')') { 144 145 146 147 148 149 150 138 struct cnode *n = MALLOC_STRUCT(cnode); 139 ungetc(c, file); 140 text[len] = 0; 141 n->type = word_t; 142 n->line = line; 143 n->data.w.text = text; 144 return n; 151 145 } 152 146 else 153 147 text[len++] = c; 154 148 } 155 149 } … … 172 166 case '\n': (*line)++; continue; 173 167 case '(': 174 175 168 n = get_list( line, file ); 169 break; 176 170 default: 177 178 179 180 171 if (isspace(c)) continue; 172 ungetc(c, file); 173 n = get_word( *line, file ); 174 break; 181 175 } 182 176 … … 207 201 { 208 202 if (gl_extensions_disable( ctx, c ) != 0) 209 203 error( head, "unknown extension" ); 210 204 } 211 205 else 212 error( args, "bad args for disable-extension" ); 206 error( args, "bad args for disable-extension" ); 213 207 } 214 208 … … 218 212 struct cnode *hint, *tail, *value; 219 213 const char *hname, *vname; 220 GLenum h, v;221 214 222 215 if (is_list(args, &hint, &tail) && … … 226 219 is_word(value, &vname)) 227 220 { 228 if ((h = (GLenum) gl_lookup_enum_by_name(hname)) != -1 && 229 (v = (GLenum) gl_lookup_enum_by_name(vname)) != -1) 221 GLint h = gl_lookup_enum_by_name(hname); 222 GLint v = gl_lookup_enum_by_name(vname); 223 if (h != -1 && v != -1) 230 224 { 231 232 if (!gl_Hint( ctx, h,v ))233 234 235 225 printf("calling glHint(%s=%d, %s=%d)\n", hname, h, vname, v); 226 if (!_mesa_try_Hint( ctx, (GLenum) h, (GLenum) v )) 227 error( hint, "glHint failed"); 228 printf("allow draw mem: %d\n", ctx->Hint.AllowDrawMem); 229 return; 236 230 } 237 231 else 238 232 error( hint, "unknown or illegal value for default-hint" ); 239 233 } 240 234 else 241 error( args, "bad args for default-hint" ); 235 error( args, "bad args for default-hint" ); 242 236 } 243 237 … … 250 244 251 245 /* error( args, */ 252 /* 253 /* 246 /* "fx-catch-signals deprecated, use " */ 247 /* "(set-variable fx-catch-signals ...) instead"); */ 254 248 255 249 if (is_list(args, &head, &tail) && … … 402 396 void gl_read_config_file( GLcontext *ctx ) 403 397 { 404 const char *default_config = "mesa3. 1";398 const char *default_config = "mesa3.3"; 405 399 406 400 #if defined(__WIN32__) || defined(__MSDOS__)
Note:
See TracChangeset
for help on using the changeset viewer.