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

Pages: [1]
1
Graphics / Re: more beginner graphics questions
« on: March 21, 2013, 07:26:32 pm »
How are you currently handling animation frames ?
What i'd do is have an "update" function in the different objects and pass it the time elapsed since last frame. You can then update the time on your animation with this elapsed time.
Basically in the animation system i developed, i have different times for each animation frame and i change the frames based on the time elapsed. So if you want to have an object autoswitching between animation and idle pose, you could use a loop boolean (which means the animation will restart if it has reached last frame and must change frame) and set the first frame as the "idle" frame with a time of 4 seconds.

I just looked at Foalys Animation Class and it's pretty similar (a bit simpler but still) to what i do. Hence you should be able to do this by adding a time var for each frame and use this to switch your frames instead of a time for all the frames.
(not sure if i'm clear ^^)

2
General / Re: How to handle multiple event for multi player ?
« on: March 20, 2013, 07:04:20 pm »
It wouldn't work anyway. You'd lose the input order.

3
General / Re: How to handle multiple event for multi player ?
« on: March 20, 2013, 02:44:37 am »
What about keeping 2 vectors of player inputs (one for each player). You push keys in them as you unstack events, depending on which player is concerned.
Then you just pop the keys once at a time when dealing with it in your main loop.

If i understood correctly what you want to do, that should do it.

4
General / Re: Issues with codeblocks and sfml 2.0 (link/static lib)
« on: March 19, 2013, 11:30:54 pm »
Yes i'm using the latest version.
I tried recompiling SFML but i'm stuck right now (undefined references errors for some reason).
Going to try the nightly builds and/or another compiler maybe.

edit:
I ended up re-installing visual studio and it works like a charm. I guess i'll stick with it  ;D

5
General / Issues with codeblocks and sfml 2.0 (link/static lib)
« on: March 19, 2013, 07:25:56 pm »
Hi!
I'm trying to use SFML 2.0 with codeblocks ide and mingw. I downloaded the Windows 32 bits - GCC SJLJ (Code::Blocks) (15.7 MB) version of sfml 2.0.
I've set everything exactly like in http://www.sfml-dev.org/tutorials/2.0/start-cb.php except i've added the -s for static libs and defined SFML_STATIC. The main.cpp is the same.
For some reason, the debug won't compile because it doesn't find sf::renderwindow. I've double-checked everything and can't understand why it would compile under release and not under debug...

Also, the release version asks for the .dll files even though i've defined sfml_static and used the -s libs.
Quote:
The program can't start because sfml-graphics-2.dll is missing from your computer. Try reinstalling the program to fix this problem.

Any idea of what i'm doing wrong ?

edit:
For some reason (not sure what changed  :o ). It now compiles in debug.
However, both versions now just crash after having been launched.
I really don't understand what happens.

I guess i'm going to try recompiling sfml.

6
Window / Re: key events in 2.0
« on: October 31, 2012, 07:27:40 pm »
edit:

Bah...found the problem, had nothing to do with sfml.
Sorry for the trouble heh x) i actually accidentally removed something in the code for some reason ~

7
Window / [solved]key events in 2.0
« on: October 31, 2012, 06:58:13 pm »
Hi !
I'm testing out sfml 2.0 on windows (visual studio 2010).
I just switched between polling the keyboard in real time to using events 5even though the result should be the same).
So here's basically what i do now:
  while (isRunning)
    {
      Window.clear(sf::Color(88, 148, 88));

      while (Window.pollEvent(Event))
      {
          switch(Event.type)
                {
                 case sf::Event::Closed:
             isRunning = false;
             break;

                case sf::Event::KeyPressed:
                        player->injectKeyPressed(Event.key.code);
                        break;

            case sf::Event::KeyReleased:
                  player->injectKeyReleased(Event.key.code);
              break;
                }
      }
 
Inside the keypress/released functions of my player object, i just set a boolean value in a map to reflect this.
Here's a code sample:
bool Player::injectKeyPressed(sf::Keyboard::Key key)
{
        keyboardState[keyboardMap[key]] = true;

        return true;
}
 
However, since i changed it, i've been having bugs (up key isn't working properly when it was before and the other keys share the same code).

So is this incorrect behavior ? Or is it just not a good idea in sfml ? Because i've used this kind of keyboard input events in other libs and never had any problem.

8
General discussions / Re: Name changes in 2.0
« on: October 24, 2012, 06:24:49 pm »
Quote
especially with texturerects
They are now defined with <width, height> instead of <right, bottom> ;)
Aaaah this might be my problem...Thanks ;)
This is a sneaky one since it compiles just fine...

edit: yup, that was it.
Might want to put that in bold red in the changelog ^^

9
General discussions / Re: Name changes in 2.0
« on: October 24, 2012, 06:12:03 pm »
While i'm here is there a complete (and accurate) list of the changes ?
I'm trying to port an old animation system i did around 2 years ago and even after changing names and switching images to textures i'm having some weird behavior (especially with texturerects).
And sorry for the initial post, i was just frustrated a bit.  ;)

10
General discussions / Re: Name changes in 2.0
« on: October 24, 2012, 05:57:29 pm »
It was not necessary but it helps with the frustration  :-\
Problem is it makes 1.6 and older code a pain to update.

11
General discussions / Changes in 2.0
« on: October 24, 2012, 05:30:48 pm »
Was it really necessary to change names in 2.0 so that i now have to check every function in my programs ?
I mean..."move" instead of "Move". How is that going to improve anything ?
I know sfml is a lot of work and all but still...sometimes you have to wonder why you make those changes.

Pages: [1]