Audio plugin host https://kx.studio/carla
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.

DGL1.cpp 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Carla Tests
  3. * Copyright (C) 2013 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the GPL.txt file
  16. */
  17. #include "dgl/Image.hpp"
  18. #include "dgl/StandaloneWindow.hpp"
  19. #include "DGL1_Artwork.hpp"
  20. USE_NAMESPACE_DGL;
  21. class MyWidget : public Widget
  22. {
  23. public:
  24. MyWidget(StandaloneWindow* win)
  25. : Widget(win->getWindow()),
  26. fWindow(win->getWindow())
  27. {
  28. {
  29. using namespace DGL1_Artwork;
  30. fImage.loadFromMemory(start_here_kxstudioData,
  31. Size<int>(start_here_kxstudioWidth, start_here_kxstudioHeight),
  32. GL_BGRA, GL_UNSIGNED_BYTE);
  33. }
  34. fWindow->setSize(fImage.getWidth(), fImage.getHeight());
  35. fWindow->setWindowTitle("DGL Test");
  36. }
  37. protected:
  38. void onDisplay() override
  39. {
  40. fImage.draw();
  41. }
  42. private:
  43. Window* const fWindow;
  44. Image fImage;
  45. };
  46. int main()
  47. {
  48. StandaloneWindow win;
  49. MyWidget widget(&win);
  50. win.exec();
  51. return 0;
  52. }