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.


Topics - dejavu

Pages: [1]
1
Callstack:
(...)
        appSnakeClient-vc11.exe!sf::GlResource::GlResource() Line 61    C++
        appSnakeClient-vc11.exe!sf::Context::Context() Line 61  C++
        appSnakeClient-vc11.exe!`anonymous namespace'::getInternalContext() Line 155    C++
        appSnakeClient-vc11.exe!sf::priv::GlContext::ensureContext() Line 213   C++
        appSnakeClient-vc11.exe!sf::GlResource::GlResource() Line 61    C++
        appSnakeClient-vc11.exe!sf::Context::Context() Line 61  C++
        appSnakeClient-vc11.exe!`anonymous namespace'::getInternalContext() Line 155    C++
        appSnakeClient-vc11.exe!sf::priv::GlContext::ensureContext() Line 213   C++
        appSnakeClient-vc11.exe!sf::GlResource::GlResource() Line 61    C++
        appSnakeClient-vc11.exe!sf::Context::Context() Line 61  C++
        appSnakeClient-vc11.exe!`anonymous namespace'::getInternalContext() Line 155    C++
        appSnakeClient-vc11.exe!sf::priv::GlContext::ensureContext() Line 213   C++
        appSnakeClient-vc11.exe!sf::GlResource::GlResource() Line 61    C++
        appSnakeClient-vc11.exe!sf::Context::Context() Line 61  C++
        appSnakeClient-vc11.exe!`anonymous namespace'::getInternalContext() Line 155    C++
        appSnakeClient-vc11.exe!sf::priv::GlContext::ensureContext() Line 213   C++
        appSnakeClient-vc11.exe!sf::GlResource::GlResource() Line 61    C++
        appSnakeClient-vc11.exe!sf::Context::Context() Line 61  C++
        appSnakeClient-vc11.exe!`anonymous namespace'::getInternalContext() Line 155    C++
        appSnakeClient-vc11.exe!sf::priv::GlContext::ensureContext() Line 213   C++
        appSnakeClient-vc11.exe!sf::GlResource::GlResource() Line 61    C++
        appSnakeClient-vc11.exe!sf::Context::Context() Line 61  C++
        appSnakeClient-vc11.exe!`anonymous namespace'::getInternalContext() Line 155    C++
        appSnakeClient-vc11.exe!sf::priv::GlContext::ensureContext() Line 213   C++
        appSnakeClient-vc11.exe!sf::GlResource::GlResource() Line 61    C++
 

Some parts of SFML code:
Context::Context() // <== GOES HERE! constructor is calling inherited constructor GlResource::GlResource
{
    m_context = priv::GlContext::create();
    setActive(true);
}

GlResource::GlResource()
{
    {
        // Protect from concurrent access
        Lock lock(mutex);

        // If this is the very first resource, trigger the global context initialization
        if (count == 0)
            priv::GlContext::globalInit();

        // Increment the resources counter
        count++;
    }

    // Now make sure that there is an active OpenGL context in the current thread
    priv::GlContext::ensureContext();  // <== GOES HERE!
}

void GlContext::ensureContext()
{
    // If there's no active context on the current thread, activate an internal one
    if (!currentContext)
        getInternalContext()->setActive(true); // <== GOES HERE!
}


namespace
{
    sf::Context* getInternalContext()
    {
        if (!hasInternalContext())
        {
            internalContext = new sf::Context; // <== GOES HERE!
            sf::Lock lock(internalContextsMutex);
            internalContexts.insert(internalContext);
        }

        return internalContext;
    }
}

 

2
Graphics / [Android] White sprite issue
« on: February 13, 2016, 07:43:24 pm »
I'm trying to make simple Android application with SFML, but I have problems with rendering textures. When I was loading images, they appeared white. I have made simpler example which also reproduces white sprite at emulator:
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>

int main(int argc, char *argv[])
{
        sf::RenderWindow window(sf::VideoMode::getDesktopMode(), "");

        sf::Image img;
        img.create(200,100,sf::Color::Red);

        sf::Texture texture;
        if(!texture.loadFromImage(img))
                return 0;

        sf::Sprite sprite(texture);
        sprite.setPosition(200,200);
        sprite.setOrigin(50,50);

        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event)) {}

                window.clear(sf::Color::Blue);
                window.draw(sprite);// WHY SPRITE IS WHITE?
                window.display();
        }
        return 0;
}

Could you tell me why it's not working correctly? Do I need to add some extra flags while compiling SFML libraries or link extra libraries into final application?

Pages: [1]