Exemplo n.º 1
0
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);
	}
}
Exemplo n.º 2
0
void NameSelectState::renderBottomScreen(cpp3ds::Window& window)
{
	window.draw(m_keyboard);
	window.draw(m_text);
}
Exemplo n.º 3
0
void NameSelectState::renderTopScreen(cpp3ds::Window& window)
{
	window.draw(m_rectangle);
}
Exemplo n.º 4
0
void LoadingState::renderBottomScreen(cpp3ds::Window& window)
{
	window.draw(m_background);
	window.draw(m_icon);
}
Exemplo n.º 5
0
void SyncState::renderBottomScreen(cpp3ds::Window& window)
{
	window.draw(m_textStatus);
}
Exemplo n.º 6
0
	void renderBottomScreen(cpp3ds::Window& window) {
		window.clear();
	}
Exemplo n.º 7
0
	void renderTopScreen(cpp3ds::Window& window) {
		window.clear();
		window.draw(text);
	}
Exemplo n.º 8
0
void TitleState::renderTopScreen(cpp3ds::Window& window)
{
	window.draw(m_textTitle);
	if (m_showText)
		window.draw(m_text);
}