2013-08-15 01:20:17 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2013 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2013-08-27 03:42:07 +00:00
|
|
|
#include <ui/mat4.h>
|
2013-08-15 01:20:17 +00:00
|
|
|
|
|
|
|
#ifndef SF_RENDER_ENGINE_TEXTURE_H
|
|
|
|
#define SF_RENDER_ENGINE_TEXTURE_H
|
|
|
|
|
|
|
|
namespace android {
|
|
|
|
|
|
|
|
class Texture {
|
|
|
|
uint32_t mTextureName;
|
|
|
|
uint32_t mTextureTarget;
|
|
|
|
size_t mWidth;
|
|
|
|
size_t mHeight;
|
|
|
|
bool mFiltering;
|
2013-08-27 03:42:07 +00:00
|
|
|
mat4 mTextureMatrix;
|
2013-08-15 01:20:17 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
enum Target { TEXTURE_2D = 0x0DE1, TEXTURE_EXTERNAL = 0x8D65 };
|
|
|
|
|
|
|
|
Texture();
|
|
|
|
Texture(Target textureTarget, uint32_t textureName);
|
|
|
|
~Texture();
|
|
|
|
|
|
|
|
void init(Target textureTarget, uint32_t textureName);
|
|
|
|
|
|
|
|
void setMatrix(float const* matrix);
|
|
|
|
void setFiltering(bool enabled);
|
|
|
|
void setDimensions(size_t width, size_t height);
|
|
|
|
|
|
|
|
uint32_t getTextureName() const;
|
|
|
|
uint32_t getTextureTarget() const;
|
|
|
|
|
2013-08-27 03:42:07 +00:00
|
|
|
const mat4& getMatrix() const;
|
2013-08-15 01:20:17 +00:00
|
|
|
bool getFiltering() const;
|
|
|
|
size_t getWidth() const;
|
|
|
|
size_t getHeight() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
} /* namespace android */
|
|
|
|
#endif /* SF_RENDER_ENGINE_TEXTURE_H */
|