glcontext_ppapi.h 1023 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_PPAPI_H_HEADER_GUARD
  6. #define BGFX_GLCONTEXT_PPAPI_H_HEADER_GUARD
  7. #if BX_PLATFORM_NACL
  8. # include <ppapi/gles2/gl2ext_ppapi.h>
  9. # include <ppapi/c/pp_completion_callback.h>
  10. # include <ppapi/c/ppb_instance.h>
  11. # include <ppapi/c/ppb_graphics_3d.h>
  12. namespace bgfx { namespace gl
  13. {
  14. struct SwapChainGL;
  15. struct GlContext
  16. {
  17. GlContext()
  18. {
  19. }
  20. void create(uint32_t _width, uint32_t _height);
  21. void destroy();
  22. void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
  23. uint64_t getCaps() const;
  24. SwapChainGL* createSwapChain(void* _nwh);
  25. void destroySwapChain(SwapChainGL* _swapChain);
  26. void swap(SwapChainGL* _swapChain = NULL);
  27. void makeCurrent(SwapChainGL* _swapChain = NULL);
  28. void import();
  29. bool isValid() const;
  30. };
  31. } /* namespace gl */ } // namespace bgfx
  32. #endif // BX_PLATFORM_NACL
  33. #endif // BGFX_GLCONTEXT_PPAPI_H_HEADER_GUARD