OpenGLES.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * cocos2d-x http://www.cocos2d-x.org
  3. *
  4. * Copyright (c) 2010-2014 - cocos2d-x community
  5. *
  6. * Portions Copyright (c) Microsoft Open Technologies, Inc.
  7. * All Rights Reserved
  8. *
  9. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
  15. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and limitations under the License.
  17. */
  18. #pragma once
  19. // OpenGL ES includes
  20. #include <GLES3/gl3.h>
  21. // EGL includes
  22. #include <EGL/egl.h>
  23. #include <EGL/eglext.h>
  24. #include <EGL/eglplatform.h>
  25. #include <angle_windowsstore.h>
  26. class OpenGLES
  27. {
  28. public:
  29. OpenGLES();
  30. ~OpenGLES();
  31. EGLSurface CreateSurface(Windows::UI::Xaml::Controls::SwapChainPanel^ panel, const Windows::Foundation::Size* renderSurfaceSize, const float* renderResolutionScale);
  32. void GetSurfaceDimensions(const EGLSurface surface, EGLint *width, EGLint *height);
  33. void DestroySurface(const EGLSurface surface);
  34. void MakeCurrent(const EGLSurface surface);
  35. EGLBoolean SwapBuffers(const EGLSurface surface);
  36. void Reset();
  37. void Cleanup();
  38. private:
  39. void Initialize();
  40. private:
  41. EGLDisplay mEglDisplay;
  42. EGLContext mEglContext;
  43. EGLConfig mEglConfig;
  44. };