void ColorPickerState::renderBottomScreen(cpp3ds::Window &window)
{
	window.draw(m_background);
	window.draw(m_vertices);

	if (m_position != cpp3ds::Vector2f(0, 0))
	{
		GLubyte *pixels = (GLubyte*) malloc(3);
		if (pixels) {
			glReadPixels(static_cast<GLint>(m_position.x), static_cast<GLint>(m_position.y), 1, 1, GL_BGR, GL_UNSIGNED_BYTE, pixels);
			cpp3ds::Color color = cpp3ds::Color(pixels[2], pixels[1], pixels[0]);
			free(pixels);

			// Bad solution to ignore black picked up from crosshair image
			if (color != cpp3ds::Color::Black)
				m_selectedColor = color;

			// Set context color and exit this state when color is picked
			if (m_picked) {
				getContext().color = m_selectedColor;
				getContext().client.sendColor(m_selectedColor);
				requestStackPop();
			}

			m_background.setFillColor(m_selectedColor);
		}

		window.draw(m_selector);
	}
}
Exemple #2
0
void NameSelectState::renderBottomScreen(cpp3ds::Window& window)
{
	window.draw(m_keyboard);
	window.draw(m_text);
}
Exemple #3
0
void NameSelectState::renderTopScreen(cpp3ds::Window& window)
{
	window.draw(m_rectangle);
}
Exemple #4
0
void LoadingState::renderBottomScreen(cpp3ds::Window& window)
{
	window.draw(m_background);
	window.draw(m_icon);
}
Exemple #5
0
void SyncState::renderBottomScreen(cpp3ds::Window& window)
{
	window.draw(m_textStatus);
}
Exemple #6
0
	void renderBottomScreen(cpp3ds::Window& window) {
		window.clear();
	}
Exemple #7
0
	void renderTopScreen(cpp3ds::Window& window) {
		window.clear();
		window.draw(text);
	}
Exemple #8
0
void TitleState::renderTopScreen(cpp3ds::Window& window)
{
	window.draw(m_textTitle);
	if (m_showText)
		window.draw(m_text);
}