Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - meta_leap

Pages: [1]
1
Graphics / Re: Scaling no-repeat-textured full-window rectangle on resize
« on: December 11, 2023, 02:51:00 pm »
Wow, thanks for this rich wealth of detail and of course also the solution to acute issue  =)  I'll follow these reads, merci!

2
Graphics / Scaling no-repeat-textured full-window rectangle on resize
« on: December 08, 2023, 04:49:31 pm »
Using 2.6.1. With this init code:

    myTex.loadFromFile("mypic.jpg");
    myRect.setTexture(&myTex);

consider this update/render loop:


    void onRender(sf::RenderWindow &window) {
        const auto size_tex = myTex.getSize();
        const auto size_window = window.getSize();

        myRect.setTextureRect({0, 0, (int)size_tex.x, (int)size_tex.y});
        myRect.setSize({(float)size_window.x, (float)size_window.y});

        window.draw(myRect);
    }


Initially the code creates the unbordered window at 1920x1080 on a 3840x2160 screen. There, all the 4 texture corners are in the 4 rect corners and thus the 4 window corners.

The problem: "maximizing" it (fullscreen since window is borderless with no decorations/titlebars etc), the window/screen-as-a-whole only shows exactly the top-left quarter of the texture. (Same when I explicitly set myRect's position and origin to 0,0 every time.)

What might I be missing here?

3
Window / Re: Beginner mistake? No video modes listed
« on: December 05, 2023, 11:31:18 am »
Well I run-via-gdb it through a VSCode extension, so I guess it must be doing that part, because the window shows, the main loop enters and works, etc =)

4
SFML projects / Re: TGUI: GUI library for SFML
« on: December 05, 2023, 08:17:00 am »
Good to see this is alive & kicking!

No kidding. Came here searching for SFML GUI, saw "last post 2019" and automatically thought "ah, yet-another-Thing-of-the-Past" but then the tiny footnote: "last edited Oct '23". And the repo shows an impressive lack of unresolved issues, no old open stale PRs (0 open, 85 merged — kudos!) and also: fresh Releases from only just a few weeks ago! All good news to me. Attempting adoption today   :P

Yeehah, just to save any similar-searchers like me with an over-tendency to reflexively dismiss "aged threads" as equiv to "abandon-ware" — not always the case  =)

5
Window / Re: Beginner mistake? No video modes listed
« on: December 05, 2023, 07:36:48 am »
Merci, knowing now that it worked fine for you, I just got the idea to run the executable directly from my terminal, rather than as-usual via gdb (usually only F5-run my code from the editor) and voila, it works fine!  ;D  wonder what's missing under gdb runs but well, it's not mission-critical  =)

6
Window / Beginner mistake? No video modes listed
« on: December 04, 2023, 08:31:32 pm »
Still a bit new to C++ but years of coding in plenty other langs.

I'm really stumped on this mysterious phenomenon — the brief & simple portion of code:

    auto modes = sf::VideoMode::getFullscreenModes();
    if (modes.empty())
        modes.push_back(sf::VideoMode::getDesktopMode());
    std::printf(">>>>>>>>%d>>>\n", (int)(modes.size()));
    for (auto it = modes.begin(); it != modes.end(); it++)
        std::printf("- %dx%d @ %dbits/px\n", it->width, it->height, it->bitsPerPixel);
    std::printf("<<<<<<<<<\n");
    std::fflush(stdout);


And the baffling output:

>>>>>>>>210>>>
<<<<<<<<<


Not a single iteration with allegedly 210 vector items. Surely this must be some newbie mistake on my part?  =)

Thanks for pointers!

This is Linux with X11 (and tiled window manager i3). Compiling with gcc's g++ and SFML 2.5.1 libs. (My distro lags a bit with that kinda stuff.)

Pages: [1]
anything