Changeset 846 for trunk/src/opengl/qglextensions_p.h
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/opengl/qglextensions_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 69 69 #endif 70 70 71 #ifndef QT_NO_EGL 72 // Needed for EGLImageKHR definition: 73 #include <QtGui/private/qegl_p.h> 74 #endif 75 71 76 #include <QtCore/qglobal.h> 72 77 73 78 #ifndef GL_ARB_vertex_buffer_object 79 typedef ptrdiff_t GLintptrARB; 74 80 typedef ptrdiff_t GLsizeiptrARB; 75 81 #endif … … 79 85 #endif 80 86 81 // ARB_ pixel_buffer_object87 // ARB_vertex_buffer_object 82 88 typedef void (APIENTRY *_glBindBuffer) (GLenum, GLuint); 83 89 typedef void (APIENTRY *_glDeleteBuffers) (GLsizei, const GLuint *); 84 90 typedef void (APIENTRY *_glGenBuffers) (GLsizei, GLuint *); 85 91 typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); 92 typedef void (APIENTRY *_glBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); 93 typedef void (APIENTRY *_glGetBufferSubData) (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); 94 typedef void (APIENTRY *_glGetBufferParameteriv) (GLenum, GLenum, GLint *); 86 95 typedef GLvoid* (APIENTRY *_glMapBufferARB) (GLenum, GLenum); 87 96 typedef GLboolean (APIENTRY *_glUnmapBufferARB) (GLenum); 97 // We can call the buffer functions directly in OpenGL/ES 1.1 or higher, 98 // but all other platforms need to resolve the extensions. 99 #if defined(QT_OPENGL_ES) 100 #if defined(GL_OES_VERSION_1_0) && !defined(GL_OES_VERSION_1_1) 101 #define QGL_RESOLVE_BUFFER_FUNCS 1 102 #endif 103 #else 104 #define QGL_RESOLVE_BUFFER_FUNCS 1 105 #endif 88 106 89 107 // ARB_fragment_program … … 185 203 GLenum internalformat, GLsizei width, GLsizei height); 186 204 205 // GL_EXT_geometry_shader4 206 typedef void (APIENTRY *_glProgramParameteriEXT)(GLuint program, GLenum pname, GLint value); 207 typedef void (APIENTRY *_glFramebufferTextureEXT)(GLenum target, GLenum attachment, 208 GLuint texture, GLint level); 209 typedef void (APIENTRY *_glFramebufferTextureLayerEXT)(GLenum target, GLenum attachment, 210 GLuint texture, GLint level, GLint layer); 211 typedef void (APIENTRY *_glFramebufferTextureFaceEXT)(GLenum target, GLenum attachment, 212 GLuint texture, GLint level, GLenum face); 213 187 214 // ARB_texture_compression 188 215 typedef void (APIENTRY *_glCompressedTexImage2DARB) (GLenum, GLint, GLenum, GLsizei, 189 216 GLsizei, GLint, GLsizei, const GLvoid *); 217 218 #ifndef QT_NO_EGL 219 // OES_EGL_image 220 // Note: We define these to take EGLImage whereas spec says they take a new GLeglImageOES 221 // type, which the EGL image should be cast to. 222 typedef void (APIENTRY *_glEGLImageTargetTexture2DOES) (GLenum, EGLImageKHR); 223 typedef void (APIENTRY *_glEGLImageTargetRenderbufferStorageOES) (GLenum, EGLImageKHR); 224 #endif 190 225 191 226 QT_BEGIN_NAMESPACE … … 286 321 287 322 // Buffer objects: 288 #if !defined(QT_OPENGL_ES_2)323 #if defined(QGL_RESOLVE_BUFFER_FUNCS) 289 324 qt_glBindBuffer = 0; 290 325 qt_glDeleteBuffers = 0; 291 326 qt_glGenBuffers = 0; 292 327 qt_glBufferData = 0; 328 qt_glBufferSubData = 0; 329 qt_glGetBufferSubData = 0; 330 qt_glGetBufferParameteriv = 0; 293 331 #endif 294 332 qt_glMapBufferARB = 0; 295 333 qt_glUnmapBufferARB = 0; 296 334 335 qt_glProgramParameteriEXT = 0; 336 qt_glFramebufferTextureEXT = 0; 337 qt_glFramebufferTextureLayerEXT = 0; 338 qt_glFramebufferTextureFaceEXT = 0; 297 339 #if !defined(QT_OPENGL_ES) 298 340 // Texture compression 299 341 qt_glCompressedTexImage2DARB = 0; 342 #endif 343 344 #ifndef QT_NO_EGL 345 // OES_EGL_image 346 qt_glEGLImageTargetTexture2DOES = 0; 347 qt_glEGLImageTargetRenderbufferStorageOES = 0; 300 348 #endif 301 349 } … … 398 446 399 447 // Buffer objects 400 #if !defined(QT_OPENGL_ES_2)448 #if defined(QGL_RESOLVE_BUFFER_FUNCS) 401 449 _glBindBuffer qt_glBindBuffer; 402 450 _glDeleteBuffers qt_glDeleteBuffers; 403 451 _glGenBuffers qt_glGenBuffers; 404 452 _glBufferData qt_glBufferData; 453 _glBufferSubData qt_glBufferSubData; 454 _glGetBufferSubData qt_glGetBufferSubData; 455 _glGetBufferParameteriv qt_glGetBufferParameteriv; 405 456 #endif 406 457 _glMapBufferARB qt_glMapBufferARB; 407 458 _glUnmapBufferARB qt_glUnmapBufferARB; 408 459 460 // Geometry shaders... 461 _glProgramParameteriEXT qt_glProgramParameteriEXT; 462 _glFramebufferTextureEXT qt_glFramebufferTextureEXT; 463 _glFramebufferTextureLayerEXT qt_glFramebufferTextureLayerEXT; 464 _glFramebufferTextureFaceEXT qt_glFramebufferTextureFaceEXT; 409 465 #if !defined(QT_OPENGL_ES) 410 466 // Texture compression 411 467 _glCompressedTexImage2DARB qt_glCompressedTexImage2DARB; 412 468 #endif 469 470 #ifndef QT_NO_EGL 471 // OES_EGL_image 472 _glEGLImageTargetTexture2DOES qt_glEGLImageTargetTexture2DOES; 473 _glEGLImageTargetRenderbufferStorageOES qt_glEGLImageTargetRenderbufferStorageOES; 474 #endif 413 475 }; 414 476 415 477 416 478 // OpenGL constants 479 480 #ifndef GL_ARRAY_BUFFER 481 #define GL_ARRAY_BUFFER 0x8892 482 #endif 483 484 #ifndef GL_STATIC_DRAW 485 #define GL_STATIC_DRAW 0x88E4 486 #endif 417 487 418 488 /* NV_texture_rectangle */ … … 429 499 430 500 #ifndef GL_RGB16 431 #define GL_RGB16 32852501 #define GL_RGB16 0x8054 432 502 #endif 433 503 434 504 #ifndef GL_UNSIGNED_SHORT_5_6_5 435 #define GL_UNSIGNED_SHORT_5_6_5 33635505 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 436 506 #endif 437 507 … … 492 562 #ifndef GL_TEXTURE1 493 563 #define GL_TEXTURE1 0x84C1 564 #endif 565 566 #ifndef GL_DEPTH_COMPONENT16 567 #define GL_DEPTH_COMPONENT16 0x81A5 568 #endif 569 570 #ifndef GL_DEPTH_COMPONENT24_OES 571 #define GL_DEPTH_COMPONENT24_OES 0x81A6 494 572 #endif 495 573 … … 600 678 #endif 601 679 680 #ifndef GL_VERSION_1_5 681 #define GL_ARRAY_BUFFER 0x8892 682 #define GL_ELEMENT_ARRAY_BUFFER 0x8893 683 #define GL_STREAM_DRAW 0x88E0 684 #define GL_STREAM_READ 0x88E1 685 #define GL_STREAM_COPY 0x88E2 686 #define GL_STATIC_DRAW 0x88E4 687 #define GL_STATIC_READ 0x88E5 688 #define GL_STATIC_COPY 0x88E6 689 #define GL_DYNAMIC_DRAW 0x88E8 690 #define GL_DYNAMIC_READ 0x88E9 691 #define GL_DYNAMIC_COPY 0x88EA 692 #endif 693 602 694 #ifndef GL_VERSION_2_0 603 695 #define GL_FRAGMENT_SHADER 0x8B30 … … 629 721 #endif 630 722 723 // Geometry shader defines 724 #ifndef GL_GEOMETRY_SHADER_EXT 725 # define GL_GEOMETRY_SHADER_EXT 0x8DD9 726 # define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA 727 # define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB 728 # define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC 729 # define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 730 # define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD 731 # define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE 732 # define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B 733 # define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF 734 # define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 735 # define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 736 # define GL_LINES_ADJACENCY_EXT 0xA 737 # define GL_LINE_STRIP_ADJACENCY_EXT 0xB 738 # define GL_TRIANGLES_ADJACENCY_EXT 0xC 739 # define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD 740 # define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 741 # define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 742 # define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 743 # define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 744 # define GL_PROGRAM_POINT_SIZE_EXT 0x8642 745 #endif 631 746 632 747 #if !defined(QT_OPENGL_ES_2) … … 668 783 669 784 // Buffer objects 670 #if !defined(QT_OPENGL_ES_2)785 #if defined(QGL_RESOLVE_BUFFER_FUNCS) 671 786 #define glBindBuffer QGLContextPrivate::extensionFuncs(ctx).qt_glBindBuffer 672 787 #define glDeleteBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteBuffers 673 788 #define glGenBuffers QGLContextPrivate::extensionFuncs(ctx).qt_glGenBuffers 674 789 #define glBufferData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferData 790 #define glBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glBufferSubData 791 #define glGetBufferSubData QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferSubData 792 #define glGetBufferParameteriv QGLContextPrivate::extensionFuncs(ctx).qt_glGetBufferParameteriv 675 793 #endif 676 794 #define glMapBufferARB QGLContextPrivate::extensionFuncs(ctx).qt_glMapBufferARB … … 746 864 #endif 747 865 866 #define glProgramParameteriEXT QGLContextPrivate::extensionFuncs(ctx).qt_glProgramParameteriEXT 867 #define glFramebufferTextureEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureEXT 868 #define glFramebufferTextureLayerEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureLayerEXT 869 #define glFramebufferTextureFaceEXT QGLContextPrivate::extensionFuncs(ctx).qt_glFramebufferTextureFaceEXT 870 748 871 #if !defined(QT_OPENGL_ES) 749 872 #define glCompressedTexImage2D QGLContextPrivate::extensionFuncs(ctx).qt_glCompressedTexImage2DARB 873 #endif 874 875 #ifndef QT_NO_EGL 876 // OES_EGL_image 877 #define glEGLImageTargetTexture2DOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetTexture2DOES 878 #define glEGLImageTargetRenderbufferStorageOES QGLContextPrivate::extensionFuncs(ctx).qt_glEGLImageTargetRenderbufferStorageOES 750 879 #endif 751 880 … … 760 889 bool qt_resolve_glsl_extensions(QGLContext *ctx); 761 890 891 #ifndef QT_NO_EGL 892 Q_OPENGL_EXPORT bool qt_resolve_eglimage_gl_extensions(QGLContext *ctx); 893 #endif 894 762 895 QT_END_NAMESPACE 763 896
Note:
See TracChangeset
for help on using the changeset viewer.