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

Pages: 1 ... 5 6 [7]
91
Graphics / Board for PacMan
« on: December 24, 2011, 09:42:44 am »
A grid holding solid values would suffice (for both solids and drawing walls), then something like A* path finding could be used.

http://code.google.com/p/a-star-algorithm-implementation/

92
Graphics / passing texture through function
« on: December 24, 2011, 09:35:14 am »
Quote from: "IntoTheBush"
Doh, thanks alot! You're my hero Turbine.  :D

You're mine too. <3 :o

93
Graphics / passing texture through function
« on: December 23, 2011, 04:03:02 am »
Use sf::Texture&

94
General / window is closing
« on: December 23, 2011, 04:01:57 am »
I find that happens with some runtime errors. Tbh I don't mess with 1.6, you could try 2.0?

95
Window / Simple open-window tutorial problem...
« on: December 23, 2011, 03:57:50 am »
Have you got your events set up properly?

In main, somewhere after window create, something like this.
Code: [Select]
  sf::Event event;
   while (window.PollEvent(event))
   {
      switch(event.Type)
      {
      case sf::Event::Closed:
         return EXIT_SUCCESS;
         break;

      case sf::Event::KeyPressed:
         if (event.Key.Code == sf::Keyboard::Escape)
            return EXIT_SUCCESS;
         break;
      }
   }


Or returning from the programs execution window, window.Close().

96
Graphics / Printing Variables
« on: December 19, 2011, 03:39:13 pm »
Can be as easy as:
Code: [Select]
char out[16];
int score = 5;
sprintf(out, "Score: %i", score)
sf::Text text(out);
renderWindow.Draw(text);

97
General / Standalone program in Ubuntu
« on: November 03, 2011, 08:29:14 am »
Full screen?

98
General / Loading Resource
« on: July 22, 2011, 09:18:32 am »
Would copying those dll's into the executables directory or into "\Windows\System" be sufficient? Or do you like them in a separate directory?

99
Graphics / sf::RenderImage::Create extremely slow
« on: July 21, 2011, 09:53:23 pm »
It's good that there's a function which is aware of this limit, very helpful, thanks.

100
Graphics / sf::RenderImage::Create extremely slow
« on: July 21, 2011, 10:10:33 am »
A primitive test to see if it could handle the drawing efficiently when resized in runtime.
Code: [Select]

sf::RenderImage surface;
sf::Sprite surfaceSprite;
sf::Vector2i pos;  //Store mouse position, checks if changed

sf::RenderWindow window(sf::VideoMode(800, 600));
window.SetFramerateLimit(60);

while (window.IsOpened())
{
   sf::Event event;
   while (window.PollEvent(event))
   {
      // Window closed or escape key pressed : exit
      if (event.Type == sf::Event::Closed)
      {
         window.Close();
         break;
      }
   }

   window.Clear();

   //Surface test
   if (pos != sf::Mouse::GetPosition(window))  //Change if mouse moved
   {
      pos = sf::Mouse::GetPosition(window);
      surface.Create(pos.x, pos.y);  //This line
      surface.Clear(sf::Color::White);
      surface.Display();
   }

   surfaceSprite.SetImage(surface.GetImage());
   window.Draw(surfaceSprite);

   //Draw fps
   int temp = window.GetFrameTime();
   if (temp > 0)
   {
      char out[3];
      int fps = 1000 / temp;   //Some computers 1 / time works, for this pc only 1000 gives accurate amount
      itoa(fps, out, 10);
      sf::Text text(out);
      window.Draw(text);
   }

   //
   window.Display();
}


Reallocating an area for a surface per frame may be extreme, but achieving 17-18 of these a second is quite limiting. Just need a way to resize in a reasonable amount of time.

101
Graphics / sf::RenderImage::Create extremely slow
« on: July 21, 2011, 09:20:22 am »
Yes, It is necessary to be able to do this, for this specific task.

I wouldn't be replying here if that faulty line of code weren't RenderImage's Create().

102
Graphics / sf::RenderImage::Create extremely slow
« on: July 21, 2011, 08:23:45 am »
Is there a chance this could be sped up at all?

This does need to be addressed, It's incredibly slow. I can sit at a stable 500fps  then dip all the way down to 17/18 on some quite capable hardware. SDL 1.2 can achieve with its software blitting surfaces nicely.

Pages: 1 ... 5 6 [7]
anything