• Immutable Page
  • Info
  • Attachments

Cube Hooking Interface

class CubeScreenInterface :
    public WrapableInterface<CubeScreen, CubeScreenInterface>
{
    public:

        /**
         * Hookable function to get the current state of rotation
         *
         * @param x X rotation
         * @param v Y Rotation
         * @param progress
         */
        virtual void cubeGetRotation (float &x, float &v, float &progress);
        virtual void cubeClearTargetOutput (float xRotate, float vRotate);
        virtual void cubePaintTop (const GLScreenPaintAttrib &sAttrib,
                                   const GLMatrix            &transform,
                                   CompOutput                *output,
                                   int                       size);
        virtual void cubePaintBottom (const GLScreenPaintAttrib &sAttrib,
                                      const GLMatrix            &transform,
                                      CompOutput                *output,
                                      int                       size);
        virtual void cubePaintInside (const GLScreenPaintAttrib &sAttrib,
                                      const GLMatrix            &transform,
                                      CompOutput                *output,
                                      int                       size);
        virtual bool cubeCheckOrientation (const GLScreenPaintAttrib &sAttrib,
                                           const GLMatrix            &transform,
                                           CompOutput                *output,
                                           std::vector<GLVector>     &points);
        virtual void cubePaintViewport (const GLScreenPaintAttrib &sAttrib,
                                        const GLMatrix            &transform,
                                        const CompRegion          &region,
                                        CompOutput                *output,
                                        unsigned int              mask);
        virtual bool cubeShouldPaintViewport (const GLScreenPaintAttrib &sAttrib,
                                              const GLMatrix            &transform,
                                              CompOutput                *output,
                                              PaintOrder                order);
        virtual bool cubeShouldPaintAllViewports ();

};

Painting the cube caps

Both cubePaintTop and cubePaintBottom are overloadable functions in CubeScreenInterface and allow you to modify how the caps are drawn. If you hook this function, your plugin should be responsible for drawing the cap itself, since the internal cubePaintTop and cubePaintBottom will otherwise draw an unmodified cap.

You'll notice in this function that a transform is given, however, it is not correctly set up so that you can just start setting the vertexes and textures for the cap. You need to adjust it to account for cube rotation

Development/zero-nine/PluginsClasses/Cube (last edited 2010-10-19 10:55:08 by 130)