SimpleGLSLUnit.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef SimpleGLSLUnitH
  2. #define SimpleGLSLUnitH
  3. //---------------------------------------------------------------------------
  4. #include <Classes.hpp>
  5. #include <Controls.hpp>
  6. #include <StdCtrls.hpp>
  7. #include <Forms.hpp>
  8. #include <ExtCtrls.hpp>
  9. #include "GLBitmapFont.hpp"
  10. #include "GLCadencer.hpp"
  11. #include "GLGeomObjects.hpp"
  12. #include "GLHUDObjects.hpp"
  13. #include "GLObjects.hpp"
  14. #include "GLScene.hpp"
  15. #include "GLTexture.hpp"
  16. #include "GLUserShader.hpp"
  17. #include "GLVectorFileObjects.hpp"
  18. #include "GLWin32Viewer.hpp"
  19. #include "GLWindowsFont.hpp"
  20. #include "GLBaseClasses.hpp"
  21. #include "GLCoordinates.hpp"
  22. #include "GLCrossPlatform.hpp"
  23. #include "GLMaterial.hpp"
  24. //#include "OpenGLTokens.hpp"
  25. #include "GLContext.hpp"
  26. //#include "OpenGL1x.hpp"
  27. #include <gl\gl.h>
  28. #include <gl\glu.h>
  29. //---------------------------------------------------------------------------
  30. #define MAXSHADERS 10
  31. class TForm1 : public TForm
  32. {
  33. __published: // IDE-managed Components
  34. TGLSceneViewer *GLSceneViewer1;
  35. TGLScene *GLScene1;
  36. TGLDirectOpenGL *GLDOInitialize;
  37. TGLDummyCube *Scene;
  38. TGLCube *GLCube1;
  39. TGLSphere *GLSphere1;
  40. TGLCone *GLCone1;
  41. TGLFreeForm *GLFreeForm1;
  42. TGLDummyCube *DummyLight;
  43. TGLLightSource *Light;
  44. TGLHUDText *GLHUDText1;
  45. TGLCamera *Cam;
  46. TGLCadencer *GLCadencer1;
  47. TGLUserShader *GLUserShader1;
  48. TTimer *Timer1;
  49. TGLWindowsBitmapFont *GLWindowsBitmapFont1;
  50. TGLMaterialLibrary *MatLib;
  51. void __fastcall GLCadencer1Progress(TObject *Sender,
  52. const double deltaTime, const double newTime);
  53. void __fastcall GLUserShader1DoApply(TObject *Sender,
  54. TGLRenderContextInfo &rci);
  55. void __fastcall GLUserShader1DoUnApply(TObject *Sender, int Pass,
  56. TGLRenderContextInfo &rci, bool &Continue);
  57. void __fastcall Timer1Timer(TObject *Sender);
  58. void __fastcall GLSceneViewer1MouseDown(TObject *Sender,
  59. TMouseButton Button, TShiftState Shift, int X, int Y);
  60. void __fastcall GLSceneViewer1MouseMove(TObject *Sender,
  61. TShiftState Shift, int X, int Y);
  62. void __fastcall FormCreate(TObject *Sender);
  63. void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
  64. void __fastcall GLDOInitializeRender(TObject *Sender,
  65. TGLRenderContextInfo &rci);
  66. void __fastcall FormMouseWheel(TObject *Sender, TShiftState Shift, int WheelDelta,
  67. TPoint &MousePos, bool &Handled);
  68. private: // User declarations
  69. bool ShaderActived;
  70. int mx,my;
  71. public: // User declarations
  72. TGLProgramHandle *GLSLProg[MAXSHADERS-1];
  73. __fastcall TForm1(TComponent* Owner);
  74. };
  75. //---------------------------------------------------------------------------
  76. extern PACKAGE TForm1 *Form1;
  77. //---------------------------------------------------------------------------
  78. #endif