blob: bd58979bc931533eb722b67a7e39b4451c4ffa38 [file] [log] [blame]
Jason Sams4b962e52009-06-22 17:15:15 -07001/*
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// ---------------------------------------------------------------------------
24namespace android {
25namespace renderscript {
26
27
28// An element is a group of Components that occupies one cell in a structure.
29class Light : public ObjectBase
30{
31public:
Jason Samsa9e7a052009-09-25 14:51:22 -070032 Light(Context *, bool isLocal, bool isMono);
Jason Sams4b962e52009-06-22 17:15:15 -070033 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 Samsee411122009-07-21 12:20:54 -070039 void setupGL(uint32_t num) const;
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070040 virtual void serialize(OStream *stream) const;
Alex Sakhartchoukaae74ad2010-06-04 10:06:50 -070041 virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_LIGHT; }
Alex Sakhartchoukaa7d2882010-05-21 12:53:13 -070042 static Light *createFromStream(Context *rsc, IStream *stream);
Jason Samsee411122009-07-21 12:20:54 -070043
Jason Sams4b962e52009-06-22 17:15:15 -070044protected:
Jason Samsee411122009-07-21 12:20:54 -070045 float mColor[4];
46 float mPosition[4];
Jason Sams4b962e52009-06-22 17:15:15 -070047 bool mIsLocal;
48 bool mIsMono;
49};
50
51
52class LightState {
53public:
54 LightState();
55 ~LightState();
56
57 void clear();
58
59 bool mIsMono;
60 bool mIsLocal;
61};
62
63
64}
65}
66#endif //ANDROID_LIGHT_H
67