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); } }
void NameSelectState::renderBottomScreen(cpp3ds::Window& window) { window.draw(m_keyboard); window.draw(m_text); }
void NameSelectState::renderTopScreen(cpp3ds::Window& window) { window.draw(m_rectangle); }
void LoadingState::renderBottomScreen(cpp3ds::Window& window) { window.draw(m_background); window.draw(m_icon); }
void SyncState::renderBottomScreen(cpp3ds::Window& window) { window.draw(m_textStatus); }
void renderTopScreen(cpp3ds::Window& window) { window.clear(); window.draw(text); }
void TitleState::renderTopScreen(cpp3ds::Window& window) { window.draw(m_textTitle); if (m_showText) window.draw(m_text); }