#ifndef ANIMATEGLCANVAS_H
#define ANIMATEGLCANVAS_H

#include <vector>
#include "wx/defs.h"
#include "wx/app.h"
#include "wx/menu.h"
#include "wx/string.h"
#include "wx/dcclient.h"
#include "wx/glcanvas.h"

#include "vect3.h"


class AnimateGLCanvas: public wxGLCanvas
{
 public:
  AnimateGLCanvas(wxWindow   *parent, 
		  const unsigned int *columns,
		  const unsigned int *rows,
		  vect3<GLfloat>     *background_colour,
		  vect3<GLfloat>     *line_colour,
		  const wxPoint&     pos     =wxDefaultPosition, 
		  const wxSize&      size    =wxDefaultSize);
  ~AnimateGLCanvas(void);
  
  void Paint();
  void OnPaint(wxPaintEvent& event);
  void OnSize(wxSizeEvent& event);
  void OnKeyDown( wxKeyEvent& event );
  void OnEraseBackground(wxEraseEvent& event);
  
  void InitGL();
  void ShowBreeding( unsigned int start_row, unsigned int start_col, 
		     unsigned int target_row, unsigned int target_col, 
		     GLint pic_start_x, GLint pic_start_y, 
		     GLint pic_end_x, GLint pic_end_y, 
		     GLsizei pic_width, GLsizei pic_height, 
		     GLenum pic_format, GLenum pic_type, 
		     GLvoid *pixels, unsigned int frames);

 private:
  bool               Inited;
  const unsigned int *Cols;
  const unsigned int *Rows;
  vect3<GLfloat>     *BGcolour;
  vect3<GLfloat>     *LineColour;

 public: 
  DECLARE_EVENT_TABLE()
};

#endif
