GLExtensions.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright (C) 2010 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef ANDROID_SF_GLEXTENSION_H
  17. #define ANDROID_SF_GLEXTENSION_H
  18. #include <stdint.h>
  19. #include <sys/types.h>
  20. #include <utils/String8.h>
  21. #include <utils/SortedVector.h>
  22. #include <utils/Singleton.h>
  23. #include <EGL/egl.h>
  24. #include <EGL/eglext.h>
  25. #include <GLES/gl.h>
  26. #include <GLES/glext.h>
  27. namespace android {
  28. // ---------------------------------------------------------------------------
  29. class GLExtensions : public Singleton<GLExtensions>
  30. {
  31. friend class Singleton<GLExtensions>;
  32. bool mHaveFramebufferObject : 1;
  33. String8 mVendor;
  34. String8 mRenderer;
  35. String8 mVersion;
  36. String8 mExtensions;
  37. SortedVector<String8> mExtensionList;
  38. GLExtensions(const GLExtensions&);
  39. GLExtensions& operator = (const GLExtensions&);
  40. protected:
  41. GLExtensions();
  42. public:
  43. inline bool haveFramebufferObject() const {
  44. return mHaveFramebufferObject;
  45. }
  46. void initWithGLStrings(
  47. GLubyte const* vendor,
  48. GLubyte const* renderer,
  49. GLubyte const* version,
  50. GLubyte const* extensions);
  51. char const* getVendor() const;
  52. char const* getRenderer() const;
  53. char const* getVersion() const;
  54. char const* getExtension() const;
  55. bool hasExtension(char const* extension) const;
  56. };
  57. // ---------------------------------------------------------------------------
  58. }; // namespace android
  59. #endif // ANDROID_SF_GLEXTENSION_H