Gorgon Game Engine
CGI.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Graphics/Color.h"
4 
5 namespace Gorgon { namespace CGI {
6 
10  template<class Color_ = Graphics::RGBA>
11  class SolidFill {
12  public:
13  typedef Color_ ColorType;
14 
16  SolidFill(Color_ color) : color(color) { }
17 
19  void SetColor(Color_ value) {
20  color = value;
21  }
22 
24  Color_ GetColor() const {
25  return color;
26  }
27 
28  Color_ operator()(Geometry::Pointf /* relative */, Geometry::Point /* absolute */, Color_ underlying, float alpha) {
29  underlying.Blend(color, alpha);
30  return underlying;
31  }
32 
33  private:
34  Color_ color;
35  };
36 
37 } }
Gorgon::Audio::Initialize
void Initialize()
Starts audio subsystem with the default device.
Definition: Filesystem.cpp:14
Gorgon::Audio::Channel::Center
@ Center
Gorgon::CGI::SolidFill::GetColor
Color_ GetColor() const
Returns the color.
Definition: CGI.h:24
Gorgon::swap
void swap(Event< Source_, Args_... > &l, Event< Source_, Args_... > &r)
Swaps two events.
Definition: Event.h:351
Gorgon::CGI::SolidFill
Fills a drawing with a solid color.
Definition: CGI.h:11
Gorgon::Audio::internal::audiothread
std::thread audiothread
Definition: Audio.cpp:29
Gorgon::Time::GetTime
unsigned long GetTime()
Returns current time in milliseconds.
Definition: Linux.cpp:34
Gorgon::CGI::SolidFill::SolidFill
SolidFill(Color_ color)
Implicit typecast from a solid color.
Definition: CGI.h:16
Gorgon::Audio::Device::Refresh
static void Refresh()
Refreshes the list of audio devices. Calling this function triggers ChangedEvent.
Gorgon::Audio::IsAvailable
bool IsAvailable()
Whether the audio is available.
Gorgon::Audio::internal::BufferSize
int BufferSize
Definition: Audio.cpp:32
Color.h
Gorgon
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
Gorgon::Audio::Device::Find
static Device Find(const std::string &id)
Name based device lookup.
Definition: Audio.h:110
Gorgon::Audio::internal::volume
std::vector< float > volume
Definition: Audio.cpp:35
Gorgon::GetSystemName
std::string GetSystemName()
Returns the name of the current system.
Definition: Main.h:38
Gorgon::Audio::Current
Device Current
Definition: Audio.cpp:24
Gorgon::String::ToLower
std::string ToLower(std::string str)
Converts the given string to lowercase.
Definition: String.h:416
Gorgon::Utils::Logger::Success
@ Success
Definition: Logging.h:112
Gorgon::Audio::AudioLoop
void AudioLoop()
Definition: Audio.cpp:76
Gorgon::Audio::internal::BufferDuration
float BufferDuration
Definition: Audio.cpp:31
Gorgon::Audio::Device::IsHeadphones
bool IsHeadphones() const
Returns if this device is connected to headphones.
Definition: Audio.h:91
Gorgon::Geometry::basic_Point
This class represents a 2D point.
Definition: Point.h:32
Controllers.h
Gorgon::Utils::Logger::Log
helper Log(const T_ &v, State state=Error)
Streams out the given value to the underlying stream.
Definition: Logging.h:200
Gorgon::Audio::Log
Utils::Logger Log
Gorgon::Audio::Device::GetSampleRate
int GetSampleRate() const
Returns number of samples per second.
Definition: Audio.h:56
Gorgon::Audio::Channel
Channel
Names for channels.
Definition: Basic.h:16
Gorgon::CGI::SolidFill::operator()
Color_ operator()(Geometry::Pointf, Geometry::Point, Color_ underlying, float alpha)
Definition: CGI.h:28
Gorgon::CGI::SolidFill::ColorType
Color_ ColorType
Definition: CGI.h:13
Gorgon::Audio::Format::PCM8
@ PCM8
Gorgon::Audio::Device::GetChannelCount
int GetChannelCount() const
Returns the number of channels available.
Definition: Audio.h:67
Gorgon::Audio::Device::Devices
static const std::vector< Device > & Devices()
Returns the devices in the current system.
Definition: Audio.h:96
Gorgon::CGI::SolidFill::SetColor
void SetColor(Color_ value)
Sets the color.
Definition: CGI.h:19
Gorgon::Input::Keyboard::Keycodes::GetName
std::string GetName(Key key)
Returns the name of the key.
Definition: Keyboard.cpp:11
Gorgon::Audio::Device::Default
static Device Default()
Returns the default device of the current system.
Definition: Audio.h:101
Gorgon::Audio::Channel::Unknown
@ Unknown
Gorgon::Audio::Format
Format
Sample format.
Definition: Basic.h:9