1 /* 2 * Copyright (C) 2018 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 */ 17 18 #ifndef ANDROID_GAMECORE_CIRCLE_H 19 #define ANDROID_GAMECORE_CIRCLE_H 20 21 #include "vecmath.h" 22 #include <GLES2/gl2.h> 23 24 namespace android { 25 namespace gamecore { 26 27 class Circle { 28 private: 29 float mRadius; 30 GLuint mProgram; 31 32 GLuint mVPositionHandle; 33 GLuint mMvpMatrixHandle; 34 GLuint mRadiusHandle; 35 GLuint mColorHandle; 36 GLfloat mColor[3]; 37 Vec3 mPosition; 38 Mat4 mViewProjectionMatrix; 39 40 public: 41 Circle(float radius); 42 43 void setColor(float r, float g, float b); 44 45 const Vec3& getPosition() const; 46 void setPosition(const Vec3& position); 47 48 void updateViewProjection(const Mat4& vpMatrix); 49 void draw() const; 50 51 }; 52 53 } // end of namespace gamecore 54 } // end of namespace android 55 56 #endif // ANDROID_GAMECORE_CIRCLE_H 57