X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fgraphics%2Femugl%2FRenderable.h;fp=src%2Ftype3_AndroidCloud%2Fanbox-master%2Fsrc%2Fanbox%2Fgraphics%2Femugl%2FRenderable.h;h=96c7f056e2995c0e92aa41dc469d258269a77091;hb=e26c1ec581be598521517829adba8c8dd23a768f;hp=0000000000000000000000000000000000000000;hpb=6699c1aea74eeb0eb400e6299079f0c7576f716f;p=iec.git diff --git a/src/type3_AndroidCloud/anbox-master/src/anbox/graphics/emugl/Renderable.h b/src/type3_AndroidCloud/anbox-master/src/anbox/graphics/emugl/Renderable.h new file mode 100644 index 0000000..96c7f05 --- /dev/null +++ b/src/type3_AndroidCloud/anbox-master/src/anbox/graphics/emugl/Renderable.h @@ -0,0 +1,69 @@ +/* +* Copyright (C) 2016 Simon Fels +* +* 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. +*/ + +#ifndef ANBOX_GRAPHICS_EMUGL_RENDERABLE_H_ +#define ANBOX_GRAPHICS_EMUGL_RENDERABLE_H_ + +#include "anbox/graphics/rect.h" + +#include +#include + +#include + +#include + +class Renderable { + public: + Renderable(const std::string &name, const std::uint32_t &buffer, float alpha, + const anbox::graphics::Rect &screen_position, + const anbox::graphics::Rect &crop = {}, + const glm::mat4 &transformation = glm::mat4(1.0f)); + ~Renderable(); + + std::string name() const; + std::uint32_t buffer() const; + anbox::graphics::Rect screen_position() const; + anbox::graphics::Rect crop() const; + glm::mat4 transformation() const; + float alpha() const; + + void set_screen_position(const anbox::graphics::Rect &screen_position); + + inline bool operator==(const Renderable &rhs) const { + return (name_ == rhs.name() && buffer_ == rhs.buffer() && + screen_position_ == rhs.screen_position() && crop_ == rhs.crop() && + transformation_ == rhs.transformation() && alpha_ == rhs.alpha()); + } + + inline bool operator!=(const Renderable &rhs) const { + return !operator==(rhs); + } + + private: + std::string name_; + std::uint32_t buffer_; + anbox::graphics::Rect screen_position_; + anbox::graphics::Rect crop_; + glm::mat4 transformation_; + float alpha_; +}; + +std::ostream &operator<<(std::ostream &out, const Renderable &r); + +typedef std::vector RenderableList; + +#endif