this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add basic AGL stub (#506)

authored by

James Urquhart and committed by
Andrew Hyatt
c1a8a7cf 956cca5e

+519
+18
src/AGL/CMakeLists.txt
··· 1 + project(AGL) 2 + 3 + set(DYLIB_COMPAT_VERSION "2.0.0") 4 + set(DYLIB_CURRENT_VERSION "3.3.2") 5 + 6 + add_framework(AGL 7 + FAT 8 + CURRENT_VERSION 9 + VERSION "A" 10 + 11 + SOURCES 12 + src/AGL.c 13 + 14 + DEPENDENCIES 15 + CoreFoundation 16 + Carbon 17 + system 18 + )
+1
src/AGL/include/AGL/AGL.h
··· 1 + // TODO
+498
src/AGL/src/AGL.c
··· 1 + 2 + #pragma GCC visibility push(hidden) 3 + 4 + #include <OpenGL/gl.h> 5 + #include <Carbon/Carbon.h> 6 + #include <CoreGraphics/CGDirectDisplay.h> 7 + #include <stdio.h> 8 + #include <string.h> 9 + #include <stdlib.h> 10 + 11 + #define FW_EXPORT __attribute__ ((visibility ("default"))) 12 + 13 + typedef void* AGLContext; 14 + typedef void* GLMfunctions; 15 + typedef void* AGLRendererInfo; 16 + typedef void* AGLPixelFormat; 17 + typedef void* AGLPbuffer; 18 + typedef void* GDHandle; 19 + typedef void* HIViewRef; 20 + typedef void* WindowRef; 21 + typedef uint32_t AGLDevice; 22 + 23 + typedef void* AGLDrawable; 24 + 25 + uint32_t gFakeContext; 26 + uint32_t gFakePBuffer = 0; 27 + uint32_t gFakePixelFormat = 0; 28 + uint32_t gFakeRenderInfo = 0; 29 + uint32_t gFakeDrawable = 0; 30 + uint32_t gFakeViewRef = 0; 31 + 32 + static int verbose = 0; 33 + 34 + __attribute__((constructor)) 35 + static void initme(void) { 36 + verbose = getenv("STUB_VERBOSE") != NULL; 37 + } 38 + 39 + FW_EXPORT AGLPixelFormat aglChoosePixelFormat(const AGLDevice *dev, GLint a, const GLint *b) 40 + { 41 + if (verbose) puts("STUB: aglChoosePixelFormat called"); 42 + return (AGLPixelFormat)&gFakePixelFormat; 43 + } 44 + 45 + FW_EXPORT AGLPixelFormat aglChoosePixelFormatCFM(const AGLDevice *dev, GLint a, const GLint *b) 46 + { 47 + if (verbose) puts("STUB: aglChoosePixelFormatCFM called"); 48 + return (AGLPixelFormat)&gFakePixelFormat; 49 + } 50 + 51 + FW_EXPORT void aglConfigure(GLenum a, GLuint b) 52 + { 53 + if (verbose) puts("STUB: aglConfigure called"); 54 + } 55 + 56 + FW_EXPORT void aglConfigureCFM(GLenum a, GLuint b) 57 + { 58 + if (verbose) puts("STUB: aglConfigureCFM called"); 59 + } 60 + 61 + FW_EXPORT GLboolean aglCopyContext(AGLContext ctx, AGLContext ctx2, GLuint a) 62 + { 63 + if (verbose) puts("STUB: aglCopyContext called"); 64 + return 0; 65 + } 66 + 67 + FW_EXPORT AGLContext aglCreateContext(AGLPixelFormat fmt, AGLContext ctx) 68 + { 69 + if (verbose) puts("STUB: aglCreateContext called"); 70 + return &gFakeContext; 71 + } 72 + 73 + FW_EXPORT AGLContext aglCreateContextCFM(AGLPixelFormat fmt, AGLContext ctx) 74 + { 75 + if (verbose) puts("STUB: aglCreateContextCFM called"); 76 + return &gFakeContext; 77 + } 78 + 79 + FW_EXPORT GLboolean aglCreatePBuffer(GLint a, GLint b , GLenum c, GLenum d, GLint e, AGLPbuffer *out) 80 + { 81 + if (verbose) puts("STUB: aglCreatePBuffer called"); 82 + *out = &gFakePBuffer; 83 + return GL_TRUE; 84 + } 85 + 86 + FW_EXPORT AGLPixelFormat aglCreatePixelFormat(const GLint *a) 87 + { 88 + if (verbose) puts("STUB: aglCreatePixelFormat called"); 89 + return (AGLPixelFormat)&gFakePixelFormat; 90 + } 91 + 92 + FW_EXPORT AGLPixelFormat aglCreatePixelFormatCFM(const GLint *a) 93 + { 94 + if (verbose) puts("STUB: aglCreatePixelFormatCFM called"); 95 + return (AGLPixelFormat)&gFakePixelFormat; 96 + } 97 + 98 + FW_EXPORT GLboolean aglDescribePBuffer(AGLPbuffer buf, GLint *w, GLint *h, GLenum *t, GLenum *fmt, GLint *ml) 99 + { 100 + if (verbose) puts("STUB: aglDescribePBuffer called"); 101 + *w = 640; 102 + *h = 480; 103 + *t = GL_NONE; 104 + *fmt = GL_NONE; 105 + *ml = 0; 106 + 107 + return GL_TRUE; 108 + } 109 + 110 + FW_EXPORT GLboolean aglDescribePixelFormat(AGLPixelFormat fmt, GLint a, GLint *out) 111 + { 112 + if (verbose) puts("STUB: aglDescribePixelFormat called"); 113 + *out = 0; 114 + return GL_TRUE; 115 + } 116 + 117 + FW_EXPORT GLboolean aglDescribeRenderer(AGLRendererInfo a, GLint b, GLint *out) 118 + { 119 + if (verbose) puts("STUB: aglDescribeRenderer called"); 120 + *out = 0; 121 + return GL_TRUE; 122 + } 123 + 124 + FW_EXPORT GLboolean aglDestroyContext(AGLContext ctx) 125 + { 126 + if (verbose) puts("STUB: aglDestroyContext called"); 127 + return GL_TRUE; 128 + } 129 + 130 + FW_EXPORT GLboolean aglDestroyPBuffer(AGLPbuffer buf) 131 + { 132 + if (verbose) puts("STUB: aglDestroyPBuffer called"); 133 + return GL_TRUE; 134 + } 135 + 136 + FW_EXPORT void aglDestroyPixelFormat(AGLPixelFormat fmt) 137 + { 138 + if (verbose) puts("STUB: aglDestroyPixelFormat called"); 139 + } 140 + 141 + FW_EXPORT void aglDestroyRendererInfo(AGLRendererInfo a) 142 + { 143 + if (verbose) puts("STUB: aglDestroyRendererInfo called"); 144 + } 145 + 146 + FW_EXPORT GDHandle * aglDevicesOfPixelFormat(AGLPixelFormat fmt, GLint *a) 147 + { 148 + if (verbose) puts("STUB: aglDevicesOfPixelFormat called"); 149 + return NULL; 150 + } 151 + 152 + FW_EXPORT GLboolean aglDisable(AGLContext ctx, GLenum a) 153 + { 154 + if (verbose) puts("STUB: aglDisable called"); 155 + return GL_TRUE; 156 + } 157 + 158 + FW_EXPORT CGDirectDisplayID * aglDisplaysOfPixelFormat(AGLPixelFormat fmt, GLint *a) 159 + { 160 + if (verbose) puts("STUB: aglDisplaysOfPixelFormat called"); 161 + return NULL; 162 + } 163 + 164 + FW_EXPORT GLboolean aglEnable(AGLContext ctx, GLenum a) 165 + { 166 + if (verbose) puts("STUB: aglEnable called"); 167 + return GL_TRUE; 168 + } 169 + 170 + FW_EXPORT const GLubyte * aglErrorString(GLenum a) 171 + { 172 + if (verbose) puts("STUB: aglErrorString called"); 173 + return (const GLubyte*)""; 174 + } 175 + 176 + FW_EXPORT GLboolean aglGetCGLContext(AGLContext ctx, void **out) 177 + { 178 + if (verbose) puts("STUB: aglGetCGLContext called"); 179 + return GL_TRUE; 180 + } 181 + 182 + GLboolean aglGetCGLPixelFormat(AGLPixelFormat fmt, void **out) 183 + { 184 + if (verbose) puts("STUB: aglGetCGLPixelFormat called"); 185 + return GL_FALSE; 186 + } 187 + 188 + AGLContext aglGetCurrentContext(void) 189 + { 190 + if (verbose) puts("STUB: aglGetCurrentContext called"); 191 + return NULL; 192 + } 193 + 194 + FW_EXPORT AGLDrawable aglGetDrawable(AGLContext ctx) 195 + { 196 + if (verbose) puts("STUB: aglGetDrawable called"); 197 + return (AGLDrawable)&gFakeDrawable; 198 + } 199 + 200 + FW_EXPORT GLenum aglGetError(void) 201 + { 202 + if (verbose) puts("STUB: aglGetError called"); 203 + return GL_NONE; 204 + } 205 + 206 + FW_EXPORT HIViewRef aglGetHIViewRef(AGLContext ctx) 207 + { 208 + if (verbose) puts("STUB: aglGetHIViewRef called"); 209 + return (HIViewRef)&gFakeViewRef; 210 + } 211 + 212 + FW_EXPORT GLboolean aglGetInteger(AGLContext ctx, GLenum a, GLint *out) 213 + { 214 + if (verbose) puts("STUB: aglGetInteger called"); 215 + *out = 0; 216 + return GL_FALSE; 217 + } 218 + 219 + FW_EXPORT GLboolean aglGetPBuffer(AGLContext ctx, AGLPbuffer *buf, GLint *a, GLint *b, GLint *c) 220 + { 221 + if (verbose) puts("STUB: aglGetPBuffer called"); 222 + return GL_FALSE; 223 + } 224 + 225 + FW_EXPORT void aglGetVersion(GLint *major, GLint *minor) 226 + { 227 + *major = 2; 228 + *minor = 0; 229 + } 230 + 231 + FW_EXPORT GLint aglGetVirtualScreen(AGLContext ctx) 232 + { 233 + if (verbose) puts("STUB: aglGetVirtualScreen called"); 234 + return 0; 235 + } 236 + 237 + FW_EXPORT WindowRef aglGetWindowRef(AGLContext ctx) 238 + { 239 + if (verbose) puts("STUB: aglGetWindowRef called"); 240 + return 0; 241 + } 242 + 243 + FW_EXPORT GLboolean aglIsEnabled(AGLContext ctx, GLenum a) 244 + { 245 + if (verbose) puts("STUB: aglIsEnabled called"); 246 + return GL_FALSE; 247 + } 248 + 249 + FW_EXPORT AGLPixelFormat aglNextPixelFormat(AGLPixelFormat fmt) 250 + { 251 + if (verbose) puts("STUB: aglNextPixelFormat called"); 252 + return NULL; 253 + } 254 + 255 + FW_EXPORT AGLRendererInfo aglNextRendererInfo(AGLRendererInfo a) 256 + { 257 + if (verbose) puts("STUB: aglNextRendererInfo called"); 258 + return NULL; 259 + } 260 + 261 + FW_EXPORT AGLRendererInfo aglQueryRendererInfo(const AGLDevice *dev, GLint a) 262 + { 263 + if (verbose) puts("STUB: aglQueryRendererInfo called"); 264 + return (AGLRendererInfo)&gFakeRenderInfo; 265 + } 266 + 267 + FW_EXPORT AGLRendererInfo aglQueryRendererInfoCFM(const AGLDevice *dev, GLint a) 268 + { 269 + if (verbose) puts("STUB: aglQueryRendererInfoCFM called"); 270 + return (AGLRendererInfo)&gFakeRenderInfo; 271 + } 272 + 273 + FW_EXPORT AGLRendererInfo aglQueryRendererInfoForCGDirectDisplayIDs(const CGDirectDisplayID *a, GLint b) 274 + { 275 + if (verbose) puts("STUB: aglQueryRendererInfoForCGDirectDisplayIDs called"); 276 + return (AGLRendererInfo)&gFakeRenderInfo; 277 + } 278 + 279 + FW_EXPORT void aglResetLibrary(void) 280 + { 281 + if (verbose) puts("STUB: aglResetLibrary called"); 282 + } 283 + 284 + FW_EXPORT GLboolean aglSetCurrentContext(AGLContext ctx) 285 + { 286 + if (verbose) puts("STUB: aglSetCurrentContext called"); 287 + return GL_TRUE; 288 + } 289 + 290 + FW_EXPORT GLboolean aglSetDrawable(AGLContext ctx, AGLDrawable a) 291 + { 292 + if (verbose) puts("STUB: aglSetDrawable called"); 293 + return GL_TRUE; 294 + } 295 + 296 + FW_EXPORT GLboolean aglSetFullScreen(AGLContext ctx, GLsizei a, GLsizei b, GLsizei c, GLint d) 297 + { 298 + if (verbose) puts("STUB: aglSetFullScreen called"); 299 + return GL_TRUE; 300 + } 301 + 302 + FW_EXPORT GLboolean aglSetHIViewRef(AGLContext ctx, HIViewRef a) 303 + { 304 + if (verbose) puts("STUB: aglSetHIViewRef called"); 305 + return GL_TRUE; 306 + } 307 + 308 + FW_EXPORT GLboolean aglSetInteger(AGLContext ctx, GLenum a, const GLint *b) 309 + { 310 + if (verbose) puts("STUB: aglSetInteger called"); 311 + return GL_TRUE; 312 + } 313 + 314 + FW_EXPORT GLboolean aglSetOffScreen(AGLContext ctx, GLsizei a, GLsizei b, GLsizei c, GLvoid *d) 315 + { 316 + if (verbose) puts("STUB: aglSetOffScreen called"); 317 + return GL_TRUE; 318 + } 319 + 320 + FW_EXPORT GLboolean aglSetPBuffer(AGLContext ctx, AGLPbuffer buf, GLint a, GLint b, GLint c) 321 + { 322 + if (verbose) puts("STUB: aglSetPBuffer called"); 323 + return GL_TRUE; 324 + } 325 + 326 + FW_EXPORT GLboolean aglSetVirtualScreen(AGLContext ctx, GLint a) 327 + { 328 + if (verbose) puts("STUB: aglSetVirtualScreen called"); 329 + return GL_TRUE; 330 + } 331 + 332 + GLboolean aglSetWindowRef(AGLContext ctx, WindowRef a) 333 + { 334 + if (verbose) puts("STUB: aglSetWindowRef called"); 335 + return GL_TRUE; 336 + } 337 + 338 + FW_EXPORT void aglSurfaceTexture(AGLContext ctx, GLenum a, GLenum b, AGLContext ctx2) 339 + { 340 + if (verbose) puts("STUB: aglSurfaceTexture called"); 341 + } 342 + 343 + FW_EXPORT void aglSwapBuffers(AGLContext ctx) 344 + { 345 + if (verbose) puts("STUB: aglSwapBuffers called"); 346 + } 347 + 348 + FW_EXPORT GLboolean aglTexImagePBuffer(AGLContext ctx, AGLPbuffer buf, GLint a) 349 + { 350 + if (verbose) puts("STUB: aglTexImagePBuffer called"); 351 + return GL_TRUE; 352 + } 353 + 354 + FW_EXPORT int8_t aglUpdateContext(AGLContext ctx) 355 + { 356 + if (verbose) puts("STUB: aglUpdateContext called"); 357 + return 0; 358 + } 359 + 360 + FW_EXPORT int8_t aglUseFont(AGLContext ctx, int a, int b, int c, int d, int e, void* f) 361 + { 362 + if (verbose) puts("STUB: aglUseFont called"); 363 + return 0; 364 + } 365 + 366 + FW_EXPORT GLvoid * glmCalloc(GLsizei a, GLsizei b) 367 + { 368 + if (verbose) puts("STUB: glmCalloc called"); 369 + return NULL; 370 + } 371 + 372 + FW_EXPORT void glmCopy(const GLubyte a, GLubyte b, GLsizei c, GLsizei d, GLsizei e, GLsizei f) 373 + { 374 + if (verbose) puts("STUB: glmCopy called"); 375 + } 376 + 377 + FW_EXPORT GLvoid * glmDCBAlloc(GLsizei a) 378 + { 379 + if (verbose) puts("STUB: glmDCBAlloc called"); 380 + return NULL; 381 + } 382 + 383 + FW_EXPORT void glmDCBFree(GLvoid * a) 384 + { 385 + if (verbose) puts("STUB: glmDCBFree called"); 386 + } 387 + 388 + FW_EXPORT GLvoid * glmDCBRealloc(GLvoid *a, GLsizei b) 389 + { 390 + if (verbose) puts("STUB: glmDCBRealloc called"); 391 + return NULL; 392 + } 393 + 394 + FW_EXPORT void glmFree(GLvoid *a) 395 + { 396 + if (verbose) puts("STUB: glmFree called"); 397 + } 398 + 399 + FW_EXPORT GLenum glmGetError(void) 400 + { 401 + if (verbose) puts("STUB: glmGetError called"); 402 + return GL_NONE; 403 + } 404 + 405 + FW_EXPORT GLint glmGetInteger(GLenum a) 406 + { 407 + if (verbose) puts("STUB: glmGetInteger called"); 408 + return 0; 409 + } 410 + 411 + FW_EXPORT GLvoid * glmMalloc(GLsizei a) 412 + { 413 + if (verbose) puts("STUB: glmMalloc called"); 414 + return NULL; 415 + } 416 + 417 + FW_EXPORT void glmPageFreeAll(void) 418 + { 419 + if (verbose) puts("STUB: glmPageFreeAll called"); 420 + } 421 + 422 + FW_EXPORT GLvoid * glmRealloc(GLvoid *a, GLsizei b) 423 + { 424 + if (verbose) puts("STUB: glmRealloc called"); 425 + return NULL; 426 + } 427 + 428 + FW_EXPORT void glmReportMemoryStatus() 429 + { 430 + if (verbose) puts("STUB: glmReportMemoryStatus called"); 431 + } 432 + 433 + FW_EXPORT void glmResetMemoryStatus() 434 + { 435 + if (verbose) puts("STUB: glmResetMemoryStatus called"); 436 + } 437 + 438 + FW_EXPORT void glmSetDebugInfo() 439 + { 440 + if (verbose) puts("STUB: glmSetDebugInfo called"); 441 + } 442 + 443 + FW_EXPORT void glmSetDouble(GLdouble *a, GLsizei b, GLsizei c, GLsizei d, GLdouble e) 444 + { 445 + if (verbose) puts("STUB: glmSetDouble called"); 446 + } 447 + 448 + FW_EXPORT void glmSetFunc(GLenum a, GLMfunctions b) 449 + { 450 + if (verbose) puts("STUB: glmSetFunc called"); 451 + } 452 + 453 + FW_EXPORT void glmSetInteger(GLenum a, GLint b) 454 + { 455 + if (verbose) puts("STUB: glmSetInteger called"); 456 + } 457 + 458 + FW_EXPORT void glmSetMode(GLenum a) 459 + { 460 + if (verbose) puts("STUB: glmSetMode called"); 461 + } 462 + 463 + FW_EXPORT void glmSetUByte(GLubyte *a, GLsizei b, GLsizei c, GLsizei d, GLubyte e) 464 + { 465 + if (verbose) puts("STUB: glmSetUByte called"); 466 + } 467 + 468 + FW_EXPORT void glmSetUInt(GLuint *a, GLsizei b, GLsizei c, GLsizei d, GLuint e) 469 + { 470 + if (verbose) puts("STUB: glmSetUInt called"); 471 + } 472 + 473 + FW_EXPORT void glmSetUShort(GLushort *a, GLsizei b, GLsizei c, GLsizei d, GLushort e) 474 + { 475 + if (verbose) puts("STUB: glmSetUShort called"); 476 + } 477 + 478 + FW_EXPORT GLvoid * glmVecAlloc(GLsizei a) 479 + { 480 + if (verbose) puts("STUB: glmVecAlloc called"); 481 + return NULL; 482 + } 483 + 484 + FW_EXPORT void glmVecFree(GLvoid *a) 485 + { 486 + if (verbose) puts("STUB: glmVecFree called"); 487 + } 488 + 489 + FW_EXPORT GLvoid * glmVecRealloc(GLvoid *a, GLsizei b) 490 + { 491 + if (verbose) puts("STUB: glmVecRealloc called"); 492 + return NULL; 493 + } 494 + 495 + FW_EXPORT void glmZero(GLubyte* a, GLsizei b, GLsizei c, GLsizei d) 496 + { 497 + if (verbose) puts("STUB: glmZero called"); 498 + }
+2
src/CMakeLists.txt
··· 199 199 ${CMAKE_CURRENT_SOURCE_DIR}/Accelerate/include 200 200 ${CMAKE_CURRENT_SOURCE_DIR}/IOSurface/include 201 201 ${CMAKE_CURRENT_SOURCE_DIR}/OpenGL/include 202 + ${CMAKE_CURRENT_SOURCE_DIR}/AGL/include 202 203 ${CMAKE_CURRENT_SOURCE_DIR}/libquit/include 203 204 ${CMAKE_CURRENT_SOURCE_DIR}/Spotlight/include 204 205 ${CMAKE_CURRENT_SOURCE_DIR}/SpotlightDaemon/include ··· 405 406 # Just a stub 406 407 add_subdirectory(WebKit) 407 408 add_subdirectory(OpenGL) 409 + add_subdirectory(AGL) 408 410 add_subdirectory(JavaVM) 409 411 add_subdirectory(DirectoryServices) 410 412 add_subdirectory(DrawSprocket)