~ubuntu-branches/ubuntu/trusty/openscenegraph/trusty

« back to all changes in this revision

Viewing changes to OpenSceneGraph/include/osg/Drawable

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-07-29 04:34:38 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080729043438-no1h9h0dpsrlzp1y
* Non-maintainer upload.
* No longer try to detect (using /proc/cpuinfo when available) how many
  CPUs are available, fixing the FTBFS (due to -j0) on various platforms
  (Closes: #477353). The right way to do it is to support parallel=n in
  DEB_BUILD_OPTIONS (see Debian Policy §4.9.1), and adequate support has
  been implemented.
* Add patch to fix FTBFS due to the build system now refusing to handle
  whitespaces (Policy CMP0004 say the logs), thanks to Andreas Putzo who
  provided it (Closes: #482239):
   - debian/patches/fix-cmp0004-build-failure.dpatch
* Remove myself from Uploaders, as requested a while ago, done by Luk in
  his 2.2.0-2.1 NMU, which was never acknowledged.

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
        virtual const Geometry* asGeometry() const { return 0; }
126
126
 
127
127
 
128
 
        /** Compute the DataVariance based on an assestment of callback etc.*/
 
128
        /** Compute the DataVariance based on an assessment of callback etc.*/
129
129
        virtual void computeDataVariance();
130
130
 
131
131
 
310
310
        virtual void resizeGLObjectBuffers(unsigned int maxSize);
311
311
 
312
312
        /** If State is non-zero, this function releases OpenGL objects for
313
 
          * the specified graphics context. Otherwise, releases OpenGL objexts
 
313
          * the specified graphics context. Otherwise, releases OpenGL objects
314
314
          * for all graphics contexts. */
315
315
        virtual void releaseGLObjects(State* state=0) const;
316
316
 
420
420
        /** drawImplementation(RenderInfo&) is a pure virtual method for the actual implementation of OpenGL drawing calls, such as vertex arrays and primitives, that
421
421
          * must be implemented in concrete subclasses of the Drawable base class, examples include osg::Geometry and osg::ShapeDrawable.
422
422
          * drawImplementation(RenderInfo&) is called from the draw(RenderInfo&) method, with the draw method handling management of OpenGL display lists,
423
 
          * and drawImplementation(RenderInfo&) handling the actuall drawing itself.  
424
 
          * @param renderInfo The osg::RenderInfo object that encapulates the current rendering information including the osg::State OpenGL state for the current graphics context. */
 
423
          * and drawImplementation(RenderInfo&) handling the actual drawing itself.  
 
424
          * @param renderInfo The osg::RenderInfo object that encapsulates the current rendering information including the osg::State OpenGL state for the current graphics context. */
425
425
        virtual void drawImplementation(RenderInfo& renderInfo) const = 0;
426
426
 
427
427
 
444
444
          * in the OpenGL context related to contextID.*/
445
445
        static void flushAllDeletedDisplayLists(unsigned int contextID);
446
446
 
 
447
        /** Flush all the cached display list which need to be deleted
 
448
          * in the OpenGL context related to contextID.
 
449
          * Note, unlike flush no OpenGL calls are made, instead the handles are all removed.
 
450
          * this call is useful for when an OpenGL context has been destroyed. */
 
451
        static void discardAllDeletedDisplayLists(unsigned int contextID);
 
452
 
447
453
        /** Flush the cached display list which need to be deleted
448
454
          * in the OpenGL context related to contextID.*/
449
455
        static void flushDeletedDisplayLists(unsigned int contextID,double& availableTime);
450
456
 
451
 
        /** Use deleteVertexBufferObject instead of glDeleteBuffers to allow
452
 
          * OpenGL buffer objects to be cached until they can be deleted
453
 
          * by the OpenGL context in which they were created, specified
454
 
          * by contextID.*/
455
 
        static void deleteVertexBufferObject(unsigned int contextID,GLuint globj);
456
 
 
457
 
        /** Flush all the cached vertex buffer objects which need to be deleted
458
 
          * in the OpenGL context related to contextID.*/
459
 
        static void flushDeletedVertexBufferObjects(unsigned int contextID,double currentTime, double& availableTime);
460
 
 
461
457
        typedef unsigned int AttributeType;
462
458
 
463
459
        enum AttributeTypes
479
475
            TEXTURE_COORDS_5    = TEXTURE_COORDS_0+5,
480
476
            TEXTURE_COORDS_6    = TEXTURE_COORDS_0+6,
481
477
            TEXTURE_COORDS_7    = TEXTURE_COORDS_0+7
482
 
            // only eight texture coord examples provided here, but underlying code can handle any no of texure units,
 
478
            // only eight texture coord examples provided here, but underlying code can handle any no of texture units,
483
479
            // simply co them as (TEXTURE_COORDS_0+unit).
484
480
        };
485
481
 
501
497
            virtual void apply(AttributeType,unsigned int,Vec3*) {}
502
498
            virtual void apply(AttributeType,unsigned int,Vec4*) {}
503
499
            virtual void apply(AttributeType,unsigned int,Vec4ub*) {}
 
500
 
 
501
            virtual void apply(AttributeType,unsigned int,double*) {}
 
502
            virtual void apply(AttributeType,unsigned int,Vec2d*) {}
 
503
            virtual void apply(AttributeType,unsigned int,Vec3d*) {}
 
504
            virtual void apply(AttributeType,unsigned int,Vec4d*) {}
504
505
        };
505
506
 
506
507
 
532
533
            virtual void apply(AttributeType,unsigned int,const Vec3*) {}
533
534
            virtual void apply(AttributeType,unsigned int,const Vec4*) {}
534
535
            virtual void apply(AttributeType,unsigned int,const Vec4ub*) {}
 
536
 
 
537
            virtual void apply(AttributeType,unsigned int,const double*) {}
 
538
            virtual void apply(AttributeType,unsigned int,const Vec2d*) {}
 
539
            virtual void apply(AttributeType,unsigned int,const Vec3d*) {}
 
540
            virtual void apply(AttributeType,unsigned int,const Vec4d*) {}
535
541
        };
536
542
 
537
543
        /** Return true if the Drawable subclass supports accept(ConstAttributeFunctor&).*/
608
614
            void glMultiTexCoord3fv(GLenum target,const GLfloat* coord) const;
609
615
            void glMultiTexCoord4fv(GLenum target,const GLfloat* coord) const;
610
616
 
 
617
            void glMultiTexCoord1d(GLenum target,GLdouble coord) const;
 
618
            void glMultiTexCoord2dv(GLenum target,const GLdouble* coord) const;
 
619
            void glMultiTexCoord3dv(GLenum target,const GLdouble* coord) const;
 
620
            void glMultiTexCoord4dv(GLenum target,const GLdouble* coord) const;
 
621
 
611
622
            void glVertexAttrib1s(unsigned int index, GLshort s) const;
612
623
            void glVertexAttrib1f(unsigned int index, GLfloat f) const;
 
624
            void glVertexAttrib1d(unsigned int index, GLdouble f) const;
613
625
            void glVertexAttrib2fv(unsigned int index, const GLfloat * v) const;
614
626
            void glVertexAttrib3fv(unsigned int index, const GLfloat * v) const;
615
627
            void glVertexAttrib4fv(unsigned int index, const GLfloat * v) const;
 
628
            void glVertexAttrib2dv(unsigned int index, const GLdouble * v) const;
 
629
            void glVertexAttrib3dv(unsigned int index, const GLdouble * v) const;
 
630
            void glVertexAttrib4dv(unsigned int index, const GLdouble * v) const;
616
631
            void glVertexAttrib4ubv(unsigned int index, const GLubyte * v) const;
617
632
            void glVertexAttrib4Nubv(unsigned int index, const GLubyte * v) const;
618
633
 
654
669
 
655
670
            typedef void (APIENTRY * VertexAttrib1sProc) (unsigned int index, GLshort s);
656
671
            typedef void (APIENTRY * VertexAttrib1fProc) (unsigned int index, GLfloat f);
 
672
            typedef void (APIENTRY * VertexAttrib1dProc) (unsigned int index, GLdouble f);
657
673
            typedef void (APIENTRY * VertexAttribfvProc) (unsigned int index, const GLfloat * v);
 
674
            typedef void (APIENTRY * VertexAttribdvProc) (unsigned int index, const GLdouble * v);
658
675
            typedef void (APIENTRY * VertexAttribubvProc) (unsigned int index, const GLubyte * v);
659
676
 
660
677
            typedef void (APIENTRY * SecondaryColor3ubvProc) (const GLubyte* coord);
662
679
 
663
680
            typedef void (APIENTRY * MultiTexCoord1fProc) (GLenum target,GLfloat coord);
664
681
            typedef void (APIENTRY * MultiTexCoordfvProc) (GLenum target,const GLfloat* coord);
 
682
            typedef void (APIENTRY * MultiTexCoord1dProc) (GLenum target,GLdouble coord);
 
683
            typedef void (APIENTRY * MultiTexCoorddvProc) (GLenum target,const GLdouble* coord);
665
684
 
666
685
 
667
686
            typedef void (APIENTRY * GenBuffersProc) (GLsizei n, GLuint *buffers);
712
731
 
713
732
            VertexAttrib1sProc _glVertexAttrib1s;
714
733
            VertexAttrib1fProc _glVertexAttrib1f;
 
734
            VertexAttrib1dProc _glVertexAttrib1d;
715
735
            VertexAttribfvProc _glVertexAttrib2fv;
716
736
            VertexAttribfvProc _glVertexAttrib3fv;
717
737
            VertexAttribfvProc _glVertexAttrib4fv;
 
738
            VertexAttribdvProc _glVertexAttrib2dv;
 
739
            VertexAttribdvProc _glVertexAttrib3dv;
 
740
            VertexAttribdvProc _glVertexAttrib4dv;
718
741
            VertexAttribubvProc _glVertexAttrib4ubv;
719
742
            VertexAttribubvProc _glVertexAttrib4Nubv;
720
743
 
722
745
            MultiTexCoordfvProc _glMultiTexCoord2fv;
723
746
            MultiTexCoordfvProc _glMultiTexCoord3fv;
724
747
            MultiTexCoordfvProc _glMultiTexCoord4fv;
 
748
            MultiTexCoord1dProc _glMultiTexCoord1d;
 
749
            MultiTexCoorddvProc _glMultiTexCoord2dv;
 
750
            MultiTexCoorddvProc _glMultiTexCoord3dv;
 
751
            MultiTexCoorddvProc _glMultiTexCoord4dv;
725
752
 
726
753
            GenBuffersProc          _glGenBuffers;
727
754
            BindBufferProc          _glBindBuffer;