//Lew Hill II
// MidiVizTrapezoid

#ifndef _MIDI_VIZ_WALL_
#define _MIDI_VIZ_WALL_

#include <GL/gl.h>
#include "MidiEvent.h"
#include "NoteColorLookupTable.h"
#include "math.h"

#include <vrj/Draw/OGL/GlContextData.h>
#include "MidiVizWallContextData.h"


#define WALL_WIDTH  64
#define WALL_HEIGHT 64

using namespace vrj;

class MidiVizWall{

 public:
  MidiVizWall();
  void init();
  void contextInit();

  void draw();
  void frame();
  void generateTexture();
    void processMidiEvent(MidiEvent event);
  
  void setPosition(float x, float y, float z ){
    position[0] = x;
      position[1] = y;
      position[2] = z;
  }
  
  void setRotation(float x, float y, float z){
    rotation[0] = x;
    rotation[1] = y;
    rotation[2] = z;
  }

  void setScale(float x, float y, float z){
    scale[0] = x;
    scale[1] = y;
    scale[2] = z;
  }

 private:

  GLubyte pointsA[WALL_HEIGHT][WALL_WIDTH][3];
  GLubyte pointsB[WALL_HEIGHT][WALL_WIDTH][3];
  int drawPoints; // this is a toggle like flag

  float position[3];
  float rotation[3];
  float scale[3];

  GlContextData<MidiVizWallContextData>  contextData;
  
  NoteColorLookupTable color_table;  

  int doUpdate;
};

#endif



