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

Pages: [1]
1
General / sfml2 with clang difference?
« on: February 20, 2013, 09:08:01 pm »
Hi,

I very recently installed SFML2.0 with clang. Earlier I used with gcc. And now I can see that the code, which used to work well when compiled with gcc now works only 80% correctly.

For example, if I don't import a system font earlier, the following code still produced results (it must be fetching default font somewhere), but with clang, the screen remains blank :(


sf::RenderWindow window(sf::VideoMode(1600,900), "Test");

sf::Text text("print me");
text.setPosition(sf::Vector2f(100, 100));
text.setCharacterSize(30);
text.setColor(sf::Color::Blue);

while (window.isOpen()) {
        sf::Event e;
        while (window.pollEvent(e)) {
            if (e.type == sf::Event::Closed) {
                window.close();
            }
        }
       
        window.clear();
        window.draw(text);      
        window.display();      
}
 

Also, if I have a static texture, and in some class method, I prepare a temporary sprite out of it and draw on the window, I get nothing. It used to print that texture-image with gcc.

Are there any subtle differences I am missing?
(Of course, while I now use the SFML2.0 snapshot to compile for clang, I used the binary for mac osx for gcc earlier)

Thanks in advanced,
Nikhil

2
General / simultaneous animations in a single (render)window
« on: December 17, 2012, 07:32:30 pm »
Hi,

I am developing a game with SFML2.0 in which I need to show two simultaneously running related, but not necessarily same scenes in the same window. For example, let's say I want to show a player navigating a maze in the upper part of the window, while the lower (Say 1/3rd) part of the same window shows what interactions are happening inside the brain of the player. How should I do it? Can someone post a small example snippet for the same? What I have for now is something like this:


while (window.isOpen()) {
      sf::Event event;
      while (window.pollEvent(event)){
           if (event.type == sf::Event::Closed)
                  window.close();
           else { .... perform some configuration update and go.}
      }

     // clear earlier scene
    window.clear();

    // animate scene A in the upper half
   sceneA.animate(window, areaSceneA);

    // animate scene B in the lower half
    sceneB.animate(window, areaSceneB);

}
   
 

Right now, what happens (which is clear from the way it is designed) is that first the scene A animation is displayed frame by frame and only then scene B animation starts in the lower part.

What I want is something like:


sceneA, animInstr1
sceneB, animInstr1

sceneA, animInstr2
sceneB, animInstr2
...

Is it possible to do this way?

TIA,
Nikhil

3
General / Re: HTML table rendering to a window
« on: December 12, 2012, 10:20:11 pm »
Hi G. and gyscos,

Thanks a lot for the suggestions :). I will try them soon. For now, I have written a small table class which does almost all that is needed from an HTML table renderer to SFML :)

Thanks,
Nikhil

4
General / HTML table rendering to a window
« on: December 11, 2012, 05:59:50 pm »
Hi,

I wish to generate a table with different cells colored differently, following some coloring convention. I guess that would be done best with generating an HTML table and rendering it to the SFML window. (Something similar to pgu html in pygame.) Can someone help me how to do it using c++ and SFML?

If not HTML table, is there a way to generate nice/pretty tables, to be displayed on a window?

regards,
Nikhil

Pages: [1]
anything