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

Pages: [1]
1
System / For newcomers to Parallel Computing/Threading
« on: January 16, 2012, 02:47:36 am »
I believe link to "old movie" is broken, although I've found this and I believe THIS is the same

2
Graphics / Sprites Collision- how to stop them from moving?
« on: January 15, 2012, 02:40:48 am »
From what I understand in your code you are changing location of your sprite by 32 at time that means it will jump, you would need some additional functionality to move your object from A->B with chosen speed.
Something like move sprite by 32px over 1 sec (32/sec) in chosen direction till your sprite is in position you want it to be

3
Graphics / Blinking/shaking screen(buffer?)
« on: January 13, 2012, 02:25:48 pm »
Thanks got it working now
Although couldn't get
Code: [Select]
Window.Draw(Meh); to work, used texture=>sprite=>window instead

4
Graphics / Blinking/shaking screen(buffer?)
« on: January 13, 2012, 01:03:57 am »
Hello there
Recently I've started toying with SFML and encountered problem. Hope I can get some help/explanation here.
First off I'm using SFML 2 fresh build (like 2 days old) with MinGW, win7 x64 if that matters.

I wanted to move dot around screen without removing its trail but even when its not supposed to move anymore(moved out of screen - stopped drawing) I can see whole window content blinking and dot trail "animating". It's almost as if buffers were different and were constantly swapped.
Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
    sf::VideoMode Vmode(800, 600, 32);
    sf::RenderWindow Window(Vmode,"");
    sf::Vector2f ppos;
    sf::Vector2f vec;
    sf::Event Event;
    vec.x = 5;
    vec.y = -1.5;

   sf::CircleShape D;
   D.SetRadius(3.0f);
   D.SetFillColor(sf::Color(255,0,0));

    while (Window.IsOpened())
   {
      if(ppos.x+vec.x<800 && ppos.y+vec.y<600 &&(ppos.x+vec.x)>1 && (ppos.y+vec.y)>1)
      {
         ppos.x=ppos.x+vec.x;
         ppos.y=ppos.y+vec.y;
         D.SetPosition(ppos);
      }

      while (Window.PollEvent(Event))
      {
         switch (Event.Type)
         {
            case sf::Event::Closed:
               Window.Close();
               break;
            case sf::Event::KeyPressed:
               if(Event.Key.Code == sf::Keyboard::Escape)
                  Window.Close();
               break;
            case sf::Event::MouseButtonPressed:
               if(sf::Mouse::IsButtonPressed(sf::Mouse::Right))
               {
                  ppos.x=Event.MouseButton.X;
                  ppos.y=Event.MouseButton.Y;
               }
               break;
            default:
               break;
         }
      }
      Window.Draw(D);
      Window.Display();
   }
   return 0;
}


any idea what is real cause and how to prevent it?

Pages: [1]