Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SFML/Graphics.hpp>
- #include <string>
- using namespace sf;
- int main(void) {
- ContextSettings settings;
- settings.antiAliasingLevel = 4;
- RenderWindow window (RenderWindow(VideoMode({1280, 720}), "Окно", Style::Close, State::Windowed, settings));
- window.setFramerateLimit(120);
- Font font;
- font.openFromFile("../data/Roboto-Regular.ttf");
- //const std::u8string u { u8"Текст" };
- auto s=L"Текст zZaAяЯёЁбБ";
- uint8_t* arr=(uint8_t*)s;
- for (int i=0;i<40;i++){
- printf("%d, ",int8_t(arr[i]));
- }
- sf::Text text(font,s);
- //text.setString(L"Привет, мир!");
- text.setPosition({100, 100});
- text.setCharacterSize(100);
- while (window.isOpen()) {
- while (const std::optional event = window.pollEvent()) {
- if (event->is<Event::Closed>()) {
- window.close();
- }
- }
- window.clear(Color(52, 38, 86));
- window.draw(text);
- window.display();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment