1 /* 2 * Copyright (C) 2013 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except 5 * in compliance with the License. You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software distributed under the License 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 11 * or implied. See the License for the specific language governing permissions and limitations under 12 * the License. 13 */ 14 #ifndef GLOWINGSCENE_H 15 #define GLOWINGSCENE_H 16 17 #include <graphics/Program.h> 18 19 #include "../Scene.h" 20 21 class GlowingScene: public Scene { 22 public: 23 GlowingScene(int width, int height); ~GlowingScene()24 virtual ~GlowingScene() {}; 25 bool setUpContext(); 26 bool setUpTextures(); 27 bool setUpMeshes(); 28 bool tearDown(); 29 bool draw(); 30 protected: 31 bool setUpPrograms(); 32 Matrix* setUpModelMatrix(); 33 Matrix* setUpViewMatrix(); 34 Matrix* setUpProjectionMatrix(float width, float height); 35 bool updateSceneGraphs(int frame); 36 private: 37 GLuint mFboId; 38 Program* mMainProgram; 39 Program* mBlurProgram; 40 float mFboWidth; 41 float mFboHeight; 42 float mFboRatio; 43 Matrix* mFboModelMatrix; 44 Matrix* mFboViewMatrix; 45 Matrix* mFboProjectionMatrix; 46 }; 47 #endif 48