Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TTESSELLATOR_H
Toshihiro Shimizu 890ddd
#define TTESSELLATOR_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//#include "tpixel.h"
Toshihiro Shimizu 890ddd
#include "traster.h"
Toshihiro Shimizu 890ddd
#include "tgl.h"
Toshihiro Shimizu 890ddd
#include "tthreadmessage.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TColorFunction;
Toshihiro Shimizu 890ddd
class TRegionOutline;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifdef TVRENDER_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
//==================== TTessellator ===========================================
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
class DVAPI TTessellator {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  virtual ~TTessellator() {}
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  virtual void tessellate(const TColorFunction *cf, const bool antiAliasing,
Shinya Kitaoka 120a6e
                          TRegionOutline &outline, TPixel32 color) = 0;
Shinya Kitaoka 120a6e
  virtual void tessellate(const TColorFunction *cf, const bool antiAliasing,
Shinya Kitaoka 120a6e
                          TRegionOutline &outline, TRaster32P texture) = 0;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Shinya Kitaoka 120a6e
//==================== OpenGL Tessellator
Shinya Kitaoka 120a6e
//===========================================
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class DVAPI TglTessellator final : public TTessellator {
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  // TThread::Mutex m_mutex;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  class DVAPI GLTess {
Shinya Kitaoka 120a6e
  public:
Toshihiro Shimizu 890ddd
#ifdef GLU_VERSION_1_2
Shinya Kitaoka 120a6e
    GLUtesselator *m_tess;
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#ifdef GLU_VERSION_1_1
Shinya Kitaoka 120a6e
    GLUtriangulatorObj *m_tess;
Toshihiro Shimizu 890ddd
#else
Shinya Kitaoka 120a6e
    void *m_tess;
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
    GLTess();
Shinya Kitaoka 120a6e
    ~GLTess();
Shinya Kitaoka 120a6e
  };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Shinya Kitaoka 120a6e
  // static GLTess m_glTess;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void doTessellate(GLTess &glTess, const TColorFunction *cf,
Shinya Kitaoka 120a6e
                    const bool antiAliasing, TRegionOutline &outline);
Shinya Kitaoka 120a6e
  void doTessellate(GLTess &glTess, const TColorFunction *cf,
Shinya Kitaoka 120a6e
                    const bool antiAliasing, TRegionOutline outline,
Shinya Kitaoka 120a6e
                    const TAffine &aff);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  // void tessellate(const TVectorRenderData &rd, TRegionOutline &outline );
Shinya Kitaoka 120a6e
  void tessellate(const TColorFunction *cf, const bool antiAliasing,
Shinya Kitaoka 473e70
                  TRegionOutline &outline, TPixel32 color) override;
Shinya Kitaoka 120a6e
  void tessellate(const TColorFunction *cf, const bool antiAliasing,
Shinya Kitaoka 473e70
                  TRegionOutline &outline, TRaster32P texture) override;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=============================================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif