MCPcopy Create free account
hub / github.com/SFML/SFML / cyclePreProcessing

Method cyclePreProcessing

examples/text/Text.cpp:509–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507 }
508
509 void cyclePreProcessing()
510 {
511 switch (preProcessingMode)
512 {
513 case PreProcessingMode::None:
514 preProcessingMode = PreProcessingMode::Color;
515 break;
516 case PreProcessingMode::Color:
517 preProcessingMode = PreProcessingMode::Outline;
518 break;
519 case PreProcessingMode::Outline:
520 preProcessingMode = PreProcessingMode::Italicize;
521 break;
522 case PreProcessingMode::Italicize:
523 preProcessingMode = PreProcessingMode::Embolden;
524 break;
525 case PreProcessingMode::Embolden:
526 preProcessingMode = PreProcessingMode::None;
527 break;
528 }
529
530 // Set up glyph pre-processor
531 // Even if one is already set up, calling this rebuilds the text using the new effect
532 text.setGlyphPreProcessor(
533 [this](const sf::Text::ShapedGlyph& shapedGlyph,
534 std::uint32_t& style,
535 sf::Color& fillColor,
536 sf::Color& outlineColor,
537 float& outlineThickness)
538 { preProcessGlyph(shapedGlyph, style, fillColor, outlineColor, outlineThickness); });
539 }
540
541 void updateRainbowText(float delta)
542 {

Callers 1

mainFunction · 0.80

Calls 1

setGlyphPreProcessorMethod · 0.80

Tested by

no test coverage detected