DPF OpenGL examples
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.1KB

  1. /*
  2. * DISTRHO Plugin Framework (DPF)
  3. * Copyright (C) 2012-2014 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. * or without fee is hereby granted, provided that the above copyright notice and this
  7. * permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  10. * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  11. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  12. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  13. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. // ------------------------------------------------------
  17. // DGL Stuff
  18. #include "ntk/NtkApp.hpp"
  19. #include "ntk/NtkWidget.hpp"
  20. #include "ntk/NtkWindow.hpp"
  21. // ------------------------------------------------------
  22. #include "DistrhoUI.hpp"
  23. #include "DistrhoUIMain.cpp"
  24. START_NAMESPACE_DISTRHO
  25. // ------------------------------------------------------
  26. // NTK UI Test
  27. class NtkUiTest : public UI
  28. {
  29. public:
  30. NtkUiTest()
  31. : UI()
  32. {
  33. }
  34. ~NtkUiTest()
  35. {
  36. }
  37. protected:
  38. uint d_getWidth() const noexcept override
  39. {
  40. return 300;
  41. }
  42. uint d_getHeight() const noexcept override
  43. {
  44. return 300;
  45. }
  46. void d_parameterChanged(uint32_t, float) override
  47. {
  48. }
  49. private:
  50. //
  51. };
  52. // ------------------------------------------------------
  53. UI* createUI()
  54. {
  55. return new NtkUiTest();
  56. }
  57. // ------------------------------------------------------
  58. END_NAMESPACE_DISTRHO
  59. // ------------------------------------------------------
  60. int main()
  61. {
  62. USE_NAMESPACE_DISTRHO;
  63. USE_NAMESPACE_DGL;
  64. d_lastUiSampleRate = 44100.0;
  65. UI* const ui(createUI());
  66. delete ui;
  67. NtkApp app;
  68. NtkWindow window(app);
  69. window.show();
  70. app.exec();
  71. return 0;
  72. }
  73. // ------------------------------------------------------