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

Pages: [1]
1
Feature requests / Sending 3D Vector to Sprite's Position
« on: April 17, 2010, 05:38:53 am »
You could do this with STL rather easily.

Code: [Select]
struct depthdrawable
  {
  sf::Drawable* todraw;
  int depth;
  };

int sortdepth(depthdrawable x, depthdrawable y)
  {
  if (x.depth==y.depth)
    {
    return 0;
    }
  else if (x.depth<y.depth)
    {
    return -1;
    }
  else
    {
    return 1;
    }
  }

// other code

std::list<depthdrawable> draw;
// pretend that I add stuff to that
draw.sort(sortdepth);


That is, if you're using C++.  This won't be available in C.

2
Graphics / Scrolling Background
« on: March 08, 2010, 10:27:10 pm »
Another possibility would be creating four sprites and an image that's the size of the window.  Draw the four sprites in a square-like pattern, like:

12
34

And then whenever Sprite #4 moves to the width/height of the window, set it back to 0 for that axis.  Just make 1, 2, and 3 all keep the same positions relative to the original background.  I use this method, and it works very well.

3
Feature requests / Multi-sized Window Icon
« on: March 08, 2010, 01:34:15 am »
Well, I wouldn't expect it to be done immediately; there are obviously more important things.  But I was just pointing it out, possibly for SFML 3 or something. :P

4
General / Global vars
« on: March 07, 2010, 10:10:30 pm »
It's perfectly fine to define a RenderWindow outside of the main() function.  You just can't actually do anything with it until it's within the functions.

5
Feature requests / Multi-sized Window Icon
« on: March 07, 2010, 09:31:39 pm »
Another request for sf::Window.  It should be possible to set the window icon for multiple sizes (16x16, 32x32).  I know that both X11 and WinAPI support this, and it really does seem like a useful feature.

Basically, SetIcon() should set different images depending on the given widths/heights, and there should be the ability to unset these various icons.  Possibly, a function like sf::Window::UnSetIcon(unsigned int,unsigned int).

6
Graphics / Creating std::vector of sf::Image/Sound
« on: March 07, 2010, 06:59:56 pm »
The main reason that I asked was because of std::vector's capacity allocation; I wasn't sure if in doing that, it would create tons of unused images, taking up a load of memory.

Anyways, thanks for the help.  I'll look into seeing if std::list is a better solution, as well.

7
Window / Detecting if a key was pressed, not if it is always down
« on: March 07, 2010, 06:57:13 pm »
...oh, wow.  I didn't realize that this topic was that old.  Sorry about that.

8
Feature requests / Getting/setting title of sf::Window?
« on: March 07, 2010, 06:55:46 pm »
GetTitle() is just something that may be useful in a few situations and if you're going to add SetTitle(), it might as well be added, as well.

I find it odd that you would be able to set the title but not know what title that you had just set.

9
General / Using SFML on an XBOX, Wii, PS3
« on: March 07, 2010, 04:06:39 am »
There are quite a few problems with this.

1) None of them draw windows; they just have a full screen to display the "application."  This would require modifications to how SFML operates.
2) The Xbox 360 uses DirectX, not OpenGL.  I don't even know if the graphics card that it uses supports OpenGL.
3) You can't exactly "compile" an executable for these platforms.  And if you do, it would require homebrew, which is illegal (and won't be made official, nor will anyone likely make it).

10
Window / Detecting if a key was pressed, not if it is always down
« on: March 07, 2010, 03:51:40 am »
Just one thing that could be used as an alternate solution: make a bool that is set to true or false depending on whether or not the key is detected as being pressed with sf::Input, and then it is considered "pressed" once the key is pressed when it was not previously pressed in the last frame.

For example:
Code: [Select]
bool spacepressed=false'
const sf::Input &input=App.GetInput();
...
 // Do something on space bar press
 if (input.IsKeyDown(sf::Key::Space) && !spacepressed)
  {
  ...
  spacepressed=true;
  }
...

11
General / Installing SFML with gcc (on ubuntu)
« on: March 07, 2010, 03:48:14 am »
Ubuntu already has pre-built packages for SFML.  You should just run apt-get:
Code: [Select]
apt-get install libsfml-dev libsfml-system1.5 libsfml-window1.5 libsfml-graphics1.5 libsfml-audio1.5

12
Feature requests / Getting/setting title of sf::Window?
« on: March 07, 2010, 03:44:28 am »
Probably been asked for before, but it seems like one of the very few features in SFML that is really needed.  And while it can be done, the only solutions are not cross-platform.

Basically would be something like:
void sf::Window::SetTitle(std::string Title)
std::string sf::Window::GetTitle()

13
Graphics / Creating std::vector of sf::Image/Sound
« on: March 07, 2010, 03:36:22 am »
This is probably a frowned-upon method of doing things.

Would it be considered "safe" to create an std::vector of sf::Image, to act as an array?  I use it as a way to store dynamically-sized arrays of loaded images, but after reading the tutorial, it warns on Image-loading and the like, and I'd like to just ask for a general opinion.  It hasn't caused any problems on my new box (3.4GHz x4, 4GB, Arch Linux/Win7) or my old box (1.2GHz x1, 512MB, Arch Linux/Win2k).

For example, the following code:
Code: [Select]
std::vector<sf::Image> array;
array.resize(2);
if (!array[0].LoadFromFile("image.png") || !array[1].LoadFromFile("image2.png"))
 {
 exit(EXIT_FAILURE);
 }

(obviously, in this case, you'd just use sf::Image array[2], but as a concept)

I have no idea how std::vector or sf::Image work, so, I figured that I'd ask this.

Pages: [1]
anything