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 - gryczany

Pages: [1]
1
In debug mode, nothing is being shown in the console.

I realised that my old integrated Intel GPU or buggy drivers cause this issue. I ran my application on my desktop computer with a dedicated GPU and everything went right - I could load the texture and draw the sprite without any problems.

Thanks for help to you and to the guys on IRC.

2
I meant, I used this function with these values as the first argument (limit).

EDIT: Partially solved.

I moved the texture loading code before creating the RendererWindow, like this:

Code: [Select]
int main()
{
    /* ... */
    sf::Texture txt;
    txt.loadFromFile("txt.png");
   
    sf::RenderWindow window(sf::VideoMode(800, 600), "test");

    /* ... */
}

But I've encountered another problem.
When I load a texture, create a sprite and set the texture for it, then draw it,  the window becomes same as described before (it's transparent).

Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
    sf::Texture char_txt;
    if(!char_txt.loadFromFile("char.png"))
    {
        std::cout << "Failed to load char.png... exitting" << std::endl;
        return -1;
    }
    sf::Sprite char_sprite;
    char_sprite.setTexture(char_txt);

    sf::RenderWindow window(sf::VideoMode(800, 600), "test");
    window.setFramerateLimit(60);

    while(window.isOpen())
    {
        sf::Event ev;
        while(window.pollEvent(ev))
        {
            if(ev.type == sf::Event::Closed)
                 window.close();

            if(ev.type == sf::Event::KeyPressed && ev.key.code == sf::Keyboard::Escape)
                 window.close();
        }

        window.clear();
        window.draw(char_sprite);
        window.display();
    }
    return 0;
}
Any ideas?

3
Still same, I used following values: 0, 1, 60.

4
Hello,
just started learning SFML. I tried to make my first testing application.
Here's my code
Code: [Select]
#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "test");
    sf::Texture char_txt;
    if(!char_txt.loadFromFile("char.png"))
    {
        std::cout << "Failed to load char.png... exitting" << std::endl;
        return -1;
    }

    while(window.isOpen())
    {
        sf::Event ev;
        while(window.pollEvent(ev))
        {
            if(ev.type == sf::Event::Closed)
                 window.close();

            if(ev.type == sf::Event::KeyPressed && ev.key.code == sf::Keyboard::Escape)
                 window.close();
        }

        window.clear();
        window.display();
    }
    return 0;
}

After loading any texture, the RendererWindow becomes unusable - it's transparent, even the .clear() method doesn't work (see the picture in the attachment). Any suggestions how to fix this strange issue?

I'm using the latest SMFL version. My IDE is Code::Blocks 13.12, GCC version: 4.7.1 TDM.

Thanks in advance.

Pages: [1]