BrickApplication.hpp
Default mainpageExamplesBrickApplicationBrickApplication.hpp
Description Overview Included files Included by Source
/*
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef _BRICK_APPLICATION_HPP_
#define _BRICK_APPLCIATION_HPP_

// Includes all the files for the library
#include "GLSL.hpp"

class BrickApplication : public Application
{
    public:
        BrickApplication();
        virtual ~BrickApplication();

        // The onEntry and onClose methods should always be overloaded.
        // In the onEntry method put any initialization of data members.
        // In the onClose method put any deletion of data members.
        // Each method is only called once on entering the graphics loop
        // and upon leaving it respectively.
        virtual void onEntry();
        virtual void onClose();

        // The onIdle and onDisplay methods should also be overloaded.
        // Within the onIdle method put the logic of the application.
        // The onDisplay method is for any drawing code.
        virtual void onIdle();
        virtual void onDisplay();

        // The onKeyDown method handles keyboard input that are standard ASCII keys
        virtual void onKeyDown(unsigned char key, int x, int y);

        // Override any additional methods needed for controlling input here
        // Review the documentation for the Application class for information on the other methods

    private:
        enum Shape {SPHERE, CUBE, TEAPOT};
        VertexShader*   brickVertex;
        FragmentShader* brickFragment;
        ProgramObject*  brickShader;
        Shape shape;
        float rotation;
} ;

#endif