本文整理汇总了C++中Renderable::setColor方法的典型用法代码示例。如果您正苦于以下问题:C++ Renderable::setColor方法的具体用法?C++ Renderable::setColor怎么用?C++ Renderable::setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Renderable
的用法示例。
在下文中一共展示了Renderable::setColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KeyboardButtonHandler
SoundSystem::SoundSystem(Game *game){
this->game = game;
Renderable* entity = game->scene->getWorld()->createRenderable("box");
entity->setPosition(glm::vec3(0,0,0));
entity->setColor(glm::vec3(1.0,1.0,1.0));
Renderable* entity2 = game->scene->getWorld()->createRenderable("cube");
entity2->setPosition(glm::vec3(2.0, 0, 0));
entity2->setColor(glm::vec3(0.5, 1.0, 1.0));
Renderable* entity3 = game->scene->getWorld()->createRenderable("cube");
entity3->setPosition(glm::vec3(-2.0, 0.0, 0));
entity3->setColor(glm::vec3(0.5, 0.5, 1.0));
soundcube = game->scene->getWorld()->createRenderable("cube");
soundcube->setPosition(glm::vec3(0.0, 0.0, 0));
soundcube->setColor(glm::vec3(0.2, 0.2, 0.2));
Renderable* floorEntity = game->scene->getWorld()->createRenderable("floor");
floorEntity->setPosition(glm::vec3(0, -2.0f, 0));
floorEntity->setColor(glm::vec3(1.0, 1.0, 1.0));
game->input->mapButton("W", new KeyboardButtonHandler(SDL_SCANCODE_W, game->input));
game->input->mapButton("A", new KeyboardButtonHandler(SDL_SCANCODE_A, game->input));
game->input->mapButton("S", new KeyboardButtonHandler(SDL_SCANCODE_S, game->input));
game->input->mapButton("D", new KeyboardButtonHandler(SDL_SCANCODE_D, game->input));
game->input->mapButton("Up", new KeyboardButtonHandler(SDL_SCANCODE_UP, game->input));
game->input->mapButton("Left", new KeyboardButtonHandler(SDL_SCANCODE_LEFT, game->input));
game->input->mapButton("Right", new KeyboardButtonHandler(SDL_SCANCODE_RIGHT, game->input));
game->input->mapButton("Down", new KeyboardButtonHandler(SDL_SCANCODE_DOWN, game->input));
game->input->mapButton("Escape", new KeyboardButtonHandler(SDL_SCANCODE_ESCAPE, game->input));
game->input->mapButton("Left Click", new MouseButtonHandler(SDL_BUTTON_LEFT, game->input));
game->input->mapButton("Right Click", new MouseButtonHandler(SDL_BUTTON_RIGHT, game->input));
generalShader = new ShaderProgram();
generalShader->load("./shaders/quad_vertex.glsl", "./shaders/quad_fragment.glsl");
vbo = VertexBuffer::createQuad();
game->scene->camera->position = glm::vec3(0.0f,0.0f,5.0f);
game->scene->camera->focus = glm::vec3(0.0f,0.0f,0.0f);
sound_1 = game->sounds->open("assets/sounds/beep-01a.wav");
game->sounds->loop(sound_1, true);
game->sounds->play(sound_1);
}
示例2: draw
void ClosestHud::draw(const Matrix& mat, double wdt, double hgt)
{
if (!m_bValid) return;
Renderable rend = Renderable::temporary();
rend.setImageName(L"sphere.png");
rend.setScale(0.1);
rend.setFixedSizeDistance(100);
Gosu::Color col = Gosu::Colors::green;
rend.setColor(col);
rend.setPosition(m_vecPos);
rend.draw(mat, wdt, hgt);
}