Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: third_party/glew/src/glew.c

Issue 256037: Ported Chrome's WebGL implementation to Mac OS X. Removed code which... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/glew/README.chromium ('k') | webkit/api/src/GraphicsContext3D.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ** The OpenGL Extension Wrangler Library 2 ** The OpenGL Extension Wrangler Library
3 ** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org> 3 ** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
4 ** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org> 4 ** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
5 ** Copyright (C) 2002, Lev Povalahev 5 ** Copyright (C) 2002, Lev Povalahev
6 ** All rights reserved. 6 ** All rights reserved.
7 ** 7 **
8 ** Redistribution and use in source and binary forms, with or without 8 ** Redistribution and use in source and binary forms, with or without
9 ** modification, are permitted provided that the following conditions are met: 9 ** modification, are permitted provided that the following conditions are met:
10 ** 10 **
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 # define GLEW_CONTEXT_ARG_DEF_INIT void 59 # define GLEW_CONTEXT_ARG_DEF_INIT void
60 # define GLEW_CONTEXT_ARG_VAR_INIT 60 # define GLEW_CONTEXT_ARG_VAR_INIT
61 # define GLEW_CONTEXT_ARG_DEF_LIST void 61 # define GLEW_CONTEXT_ARG_DEF_LIST void
62 # define WGLEW_CONTEXT_ARG_DEF_INIT void 62 # define WGLEW_CONTEXT_ARG_DEF_INIT void
63 # define WGLEW_CONTEXT_ARG_DEF_LIST void 63 # define WGLEW_CONTEXT_ARG_DEF_LIST void
64 # define GLXEW_CONTEXT_ARG_DEF_INIT void 64 # define GLXEW_CONTEXT_ARG_DEF_INIT void
65 # define GLXEW_CONTEXT_ARG_DEF_LIST void 65 # define GLXEW_CONTEXT_ARG_DEF_LIST void
66 #endif /* GLEW_MX */ 66 #endif /* GLEW_MX */
67 67
68 #if defined(__APPLE__) 68 #if defined(__APPLE__)
69 #include <mach-o/dyld.h> 69 #include <dlfcn.h>
70 #include <stdlib.h> 70 #include <stdlib.h>
71 #include <string.h> 71 #include <string.h>
72 72
73 void* NSGLGetProcAddress (const GLubyte *name) 73 void* NSGLGetProcAddress (const GLubyte *name)
74 { 74 {
75 static const struct mach_header* image = NULL; 75 static void* image = NULL;
76 NSSymbol symbol;
77 char* symbolName;
78 if (NULL == image) 76 if (NULL == image)
79 { 77 {
80 image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Cur rent/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); 78 image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current /OpenGL", RTLD_LAZY | RTLD_LOCAL);
81 } 79 }
82 /* prepend a '_' for the Unix C symbol mangling convention */ 80 return image ? dlsym(image, (const char*) name) : NULL;
83 symbolName = malloc(strlen((const char*)name) + 2);
84 strcpy(symbolName+1, (const char*)name);
85 symbolName[0] = '_';
86 symbol = NULL;
87 /* if (NSIsSymbolNameDefined(symbolName))
88 » symbol = NSLookupAndBindSymbol(symbolName); */
89 symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAG E_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL;
90 free(symbolName);
91 return symbol ? NSAddressOfSymbol(symbol) : NULL;
92 } 81 }
93 #endif /* __APPLE__ */ 82 #endif /* __APPLE__ */
94 83
95 #if defined(__sgi) || defined (__sun) 84 #if defined(__sgi) || defined (__sun)
96 #include <dlfcn.h> 85 #include <dlfcn.h>
97 #include <stdio.h> 86 #include <stdio.h>
98 #include <stdlib.h> 87 #include <stdlib.h>
99 88
100 void* dlGetProcAddress (const GLubyte* name) 89 void* dlGetProcAddress (const GLubyte* name)
101 { 90 {
(...skipping 12069 matching lines...) Expand 10 before | Expand all | Expand 10 after
12171 } 12160 }
12172 #endif 12161 #endif
12173 } 12162 }
12174 } 12163 }
12175 ret = (len == 0); 12164 ret = (len == 0);
12176 } 12165 }
12177 return ret; 12166 return ret;
12178 } 12167 }
12179 12168
12180 #endif /* _WIN32 */ 12169 #endif /* _WIN32 */
OLDNEW
« no previous file with comments | « third_party/glew/README.chromium ('k') | webkit/api/src/GraphicsContext3D.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698