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

Author Topic: [SOLVED] No content is drawn.  (Read 1313 times)

0 Members and 2 Guests are viewing this topic.

PearCoding

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Pear3DEngine
    • Email
[SOLVED] No content is drawn.
« on: June 26, 2013, 07:17:25 pm »
Hi everyone!  :)

I'm developing a game and after porting my code from 1.6 to 2.0 (need some font internals, blablabla). Nothing of the content is visible anymore. The window is still drawn, and I can change the clear color and the changes are also visible, but the content is always invisible.
I'm using an ATI Radeon HD 3200 Graphics with a 3.3.11672 Compatibility Profile Context on Ubuntu Release 12.04 (precise) 64-bit - Kernel Linux 3.2.0-48-generic with GNOME 3.4.2.
My application runs with OpenGL 3.3 (ContextSettings) and without the Network or Audio module.
So I first thought it would be the mighty ATI-Bug, but my application did not crash as described in several bug reports. But AMD CodeXL gives me that:

But to be honestly, I did not trust CodeXL. It always gives me the same error, even in applications and projects without problems or "bugs" like described above.

The window just looks like this without CodeXL:


If I close the application, the application did not crash. Everything works as "planned", except the rendering.
Just to be sure, I did one test and included a circle shape in the render method (everything else was commented). Still nothing visible.
mWindow->clear(sf::Color::Black);
mWindow->draw(mShape);//Circle Shape
mWindow->display();

The shape is initialized in the Class constructor like this:
mShape.setFillColor(sf::Color(0,0,255));
mShape.setOrigin(20, 20);
mShape.setRadius(4);

The circle shape is always on context. It does not get lost.



By the way. Every SFML 2.0 example works, but I can not use the STATIC libraries. Somehow some dependencies are missing, even when I'm linking them with cmake and using -DSFML_STATIC:
`sf::priv::WindowImplX11::setMouseCursorVisible(bool)':
WindowImplX11.cpp:(.text+0x51): undefined reference to `XDefineCursor'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libsfml-window-s.a(WindowImplX11.cpp.o): In function `sf::priv::WindowImplX11::setVisible(bool)':
WindowImplX11.cpp:(.text+0x88): undefined reference to `XUnmapWindow'
WindowImplX11.cpp:(.text+0xa1): undefined reference to `XMapWindow'
(...)
(The whole log is in the attachments)

I hope you guys understand my problem. I can give you more internal information but did not think that they really matter.  :-[

Regards,
PearCoding
« Last Edit: June 26, 2013, 08:39:40 pm by PearCoding »
Developer of the Pear3DEngine project...
http://sourceforge.net/projects/pear3dengine/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: No content is drawn.
« Reply #1 on: June 26, 2013, 07:21:28 pm »
You should provide a complete and minimal example that reproduces the problem.
Laurent Gomila - SFML developer

PearCoding

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Pear3DEngine
    • Email
Re: No content is drawn.
« Reply #2 on: June 26, 2013, 07:34:59 pm »
sf::RenderWindow window(sf::VideoMode(800, 600),
                                        "The great Journey");

sf::CircleShape shape;
shape.setFillColor(sf::Color(0,0,255));
shape.setPosition(20, 20);//<--- was setOrigin... :(
shape.setRadius(4);

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

        window.clear();
        window.draw(shape);
        window.display();
}

That gives me the black screen, but with the little blue circle. I mismatched setOrigin with setPosition :(
But my other content is still not visible on the main application.

I think it is a big internal reference problem with my own code. The blue circle is visible now, so don't think that the problem is from SFML. Damn... even after nearly 8 years of experience I do that kind of simple failures...

Thanks for the support. Will post the possible solution later when I found it... maybe someone is interested.

EDIT:
Got the problem. The resize-event code is a bit different to SFML 1.6. I changed my own resize code to the SFML 2.0 supported one and the content is now visible.
Thanks for the support. Thread can be closed. :)
« Last Edit: June 26, 2013, 07:48:13 pm by PearCoding »
Developer of the Pear3DEngine project...
http://sourceforge.net/projects/pear3dengine/