glcontext_eagl.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
  3. * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
  4. */
  5. #ifndef BGFX_GLCONTEXT_EAGL_H_HEADER_GUARD
  6. #define BGFX_GLCONTEXT_EAGL_H_HEADER_GUARD
  7. #if BX_PLATFORM_IOS
  8. namespace bgfx { namespace gl
  9. {
  10. struct SwapChainGL;
  11. struct GlContext
  12. {
  13. GlContext()
  14. : m_current(0)
  15. , m_context(0)
  16. , m_fbo(0)
  17. , m_colorRbo(0)
  18. , m_depthStencilRbo(0)
  19. {
  20. }
  21. void create(uint32_t _width, uint32_t _height);
  22. void destroy();
  23. void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
  24. uint64_t getCaps() const;
  25. SwapChainGL* createSwapChain(void* _nwh);
  26. void destroySwapChain(SwapChainGL* _swapChain);
  27. void swap(SwapChainGL* _swapChain = NULL);
  28. void makeCurrent(SwapChainGL* _swapChain = NULL);
  29. void import();
  30. GLuint getFbo()
  31. {
  32. return m_fbo;
  33. }
  34. bool isValid() const
  35. {
  36. return 0 != m_context;
  37. }
  38. SwapChainGL* m_current;
  39. void* m_context;
  40. GLuint m_fbo;
  41. GLuint m_colorRbo;
  42. GLuint m_depthStencilRbo;
  43. };
  44. } /* namespace gl */ } // namespace bgfx
  45. #endif // BX_PLATFORM_IOS
  46. #endif // BGFX_GLCONTEXT_EAGL_H_HEADER_GUARD