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.


Topics - Khnemu

Pages: [1]
1
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.

2
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.

3
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]