2 * Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include "anbox/graphics/emugl/Renderable.h"
19 Renderable::Renderable(const std::string &name, const std::uint32_t &buffer, float alpha,
20 const anbox::graphics::Rect &screen_position,
21 const anbox::graphics::Rect &crop,
22 const glm::mat4 &transformation)
25 screen_position_(screen_position),
27 transformation_(transformation),
30 Renderable::~Renderable() {}
32 std::string Renderable::name() const { return name_; }
34 std::uint32_t Renderable::buffer() const { return buffer_; }
36 anbox::graphics::Rect Renderable::screen_position() const {
37 return screen_position_;
40 anbox::graphics::Rect Renderable::crop() const { return crop_; }
42 glm::mat4 Renderable::transformation() const { return transformation_; }
44 float Renderable::alpha() const { return alpha_; }
46 void Renderable::set_screen_position(
47 const anbox::graphics::Rect &screen_position) {
48 screen_position_ = screen_position;
51 std::ostream &operator<<(std::ostream &out, const Renderable &r) {
52 return out << "{ name " << r.name() << " buffer " << r.buffer()
53 << " screen position " << r.screen_position() << " crop "
54 << r.crop() << " alpha " << r.alpha();