/* ------------------------------------------------------------------
 * GEM - Graphics Environment for Multimedia
 *
 * SPDX-FileCopyrightText: © 2004, James Tittle II and the GEM contributors
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * ------------------------------------------------------------------
 */

#ifndef _INCLUDE__GEM_OPENGL_GEMGLPROGRAMENVPARAMETER4DARB_H_
#define _INCLUDE__GEM_OPENGL_GEMGLPROGRAMENVPARAMETER4DARB_H_

#include "Base/GemGLBase.h"

/*
 CLASS
        GEMglProgramEnvParameter4dARB
 KEYWORDS
        openGL  0
 DESCRIPTION
        wrapper for the openGL-function
        "glProgramEnvParameter4dARB( GLenum target, GLuint index, GLdouble x,
                                                                        GLdouble y, GLdouble z, GLdouble w)"
 */

class GEM_EXTERN GEMglProgramEnvParameter4dARB : public GemGLBase
{
  CPPEXTERN_HEADER(GEMglProgramEnvParameter4dARB, GemGLBase);

public:
  // Constructor
  GEMglProgramEnvParameter4dARB (int, t_atom*); // CON

protected:
  // Destructor
  virtual ~GEMglProgramEnvParameter4dARB ();
  // check extensions
  virtual bool isRunnable(void);

  // Do the rendering
  virtual void  render (GemState *state);

  // variables
  GLenum        target;         // VAR
  virtual void  targetMess(t_float);    // FUN

  GLuint        index;          // VAR
  virtual void  indexMess(t_float);     // FUN

  GLdouble      m_x, m_y, m_z, m_w;             // VAR
  virtual void  xMess(t_float); // FUN
  virtual void  yMess(t_float); // FUN
  virtual void  zMess(t_float); // FUN
  virtual void  wMess(t_float); // FUN

  // this is protected because subclasses might want to use it
  static void   paramMessCallback(void *data, t_symbol*, int, t_atom*);

private:

  // we need some inlets
  t_inlet *m_inlet[6];

  // static member functions
  static void    targetMessCallback (void*, t_float);
  static void    indexMessCallback (void*, t_float);
  static void    xMessCallback (void*, t_float);
  static void    yMessCallback (void*, t_float);
  static void    zMessCallback (void*, t_float);
  static void    wMessCallback (void*, t_float);
};
#endif // for header file
