UiPainterDevice.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #include "UiPainterDevice.h"
  2. #include "rsrc/Texture.h"
  3. //==============================================================================
  4. // Constructor =
  5. //==============================================================================
  6. UiPainterDevice::UiPainterDevice(Texture& colorFai_)
  7. : colorFai(colorFai_)
  8. {}
  9. //==============================================================================
  10. // getSize =
  11. //==============================================================================
  12. Vec2 UiPainterDevice::getSize() const
  13. {
  14. return Vec2(colorFai.getWidth(), colorFai.getHeight());
  15. }
  16. //==============================================================================
  17. // create =
  18. //==============================================================================
  19. void UiPainterDevice::create()
  20. {
  21. Fbo::create();
  22. bind();
  23. setNumOfColorAttachements(1);
  24. glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
  25. colorFai.getGlId(), 0);
  26. unbind();
  27. }