Jason Sams | 1aa5a4e | 2009-06-22 17:15:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 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 | #ifndef ANDROID_LIGHT_H |
| 18 | #define ANDROID_LIGHT_H |
| 19 | |
| 20 | |
| 21 | #include "rsObjectBase.h" |
| 22 | |
| 23 | // --------------------------------------------------------------------------- |
| 24 | namespace android { |
| 25 | namespace renderscript { |
| 26 | |
| 27 | |
| 28 | // An element is a group of Components that occupies one cell in a structure. |
| 29 | class Light : public ObjectBase |
| 30 | { |
| 31 | public: |
Jason Sams | e514b45 | 2009-09-25 14:51:22 -0700 | [diff] [blame] | 32 | Light(Context *, bool isLocal, bool isMono); |
Jason Sams | 1aa5a4e | 2009-06-22 17:15:15 -0700 | [diff] [blame] | 33 | virtual ~Light(); |
| 34 | |
| 35 | // Values, mutable after creation. |
| 36 | void setPosition(float x, float y, float z); |
| 37 | void setColor(float r, float g, float b); |
| 38 | |
Jason Sams | b5909ce | 2009-07-21 12:20:54 -0700 | [diff] [blame] | 39 | void setupGL(uint32_t num) const; |
| 40 | |
Jason Sams | 1aa5a4e | 2009-06-22 17:15:15 -0700 | [diff] [blame] | 41 | protected: |
Jason Sams | b5909ce | 2009-07-21 12:20:54 -0700 | [diff] [blame] | 42 | float mColor[4]; |
| 43 | float mPosition[4]; |
Jason Sams | 1aa5a4e | 2009-06-22 17:15:15 -0700 | [diff] [blame] | 44 | bool mIsLocal; |
| 45 | bool mIsMono; |
| 46 | }; |
| 47 | |
| 48 | |
| 49 | class LightState { |
| 50 | public: |
| 51 | LightState(); |
| 52 | ~LightState(); |
| 53 | |
| 54 | void clear(); |
| 55 | |
| 56 | bool mIsMono; |
| 57 | bool mIsLocal; |
| 58 | }; |
| 59 | |
| 60 | |
| 61 | } |
| 62 | } |
| 63 | #endif //ANDROID_LIGHT_H |
| 64 | |