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

Pages: [1]
1
General / Possible to use Ogre3D with SFML?
« on: July 22, 2009, 03:43:35 am »
Quote from: "Lynix"
You need to get the SFML window handle to use it with ogre.

I've write a function for that, but it need to recompile the library.

Laurent told me that he was maybe going to add it.


I thought so, but I was having trouble finding a way to get that through SFML's documentation. Is it possible to get that without digging into SFML's source?

Thanks!

2
General / Possible to use Ogre3D with SFML?
« on: July 18, 2009, 11:51:28 pm »
Hey everyone,
I'm trying to find if it is possible/a way to use Ogre3D for rendering, but SFML for everything else(like input and such). I found this article for using Ogre3D with SDL, http://www.ogre3d.org/wiki/index.php/Using_SDL_Input  but I haven't been able to find a way to do this with SFML. Any help or pointers in the right direction would be greatly appreciated.

Thanks

3
Graphics / Unhandled exceptions thrown from sprite tutorial
« on: March 23, 2009, 08:29:13 pm »
Quote from: "Laurent"
Quote
do the debug libs HAVE to be used if you are compiling with Visual Studio in debug mode?

Yes.

Quote
If I missed that in the tutorial I apologize, but if it isn't in there it might be something useful to add

Actually, it is explained in the tutorials:
Quote
For the Debug configuration, you can link with the debug versions of the libraries, which have the "-d" suffix (sfml-system-d.lib in this case)

I should probably say "you must" instead of "you can" :)

Yep, that was the part that confused me, I thought the "can" implied it was an option. That change would make it a lot clearer.

Thanks a lot for your help I appreciate it!

4
Graphics / Unhandled exceptions thrown from sprite tutorial
« on: March 23, 2009, 02:34:41 pm »
Quote from: "Laurent"
You're probably mixing different configurations (debug / release), or using the wrong libraries (VS2008 instead of VS2005, for example).


Ahhh, You are right. I was linking in sfml-system.lib, sfml-Window.lib, and sfml-graphics-d.lib. Once I changed system and Window to -d.lib it worked perfectly.

I must ask, since using all of the non-debug libs at the same time didn't work, do the debug libs HAVE to be used if you are compiling with Visual Studio in debug mode? If I missed that in the tutorial I apologize, but if it isn't in there it might be something useful to add.

Thanks a lot for your help!

5
Graphics / Unhandled exceptions thrown from sprite tutorial
« on: March 23, 2009, 07:10:07 am »
Hey, I'm having some issues with the code from the Image and Sprite tutorial. Basically here is my code:

Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>


////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");

    // Load the sprite image from a file
    sf::Image Image;
    if (!Image.LoadFromFile("sprite.bmp"))
        return EXIT_FAILURE;

    // Create the sprite
    sf::Sprite Sprite(Image);

    // Change its properties
    Sprite.SetColor(sf::Color(0, 255, 255, 128));
    Sprite.SetPosition(200.f, 100.f);
    Sprite.SetScale(2.f, 2.f);

    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Get elapsed time
        float ElapsedTime = App.GetFrameTime();

        // Move the sprite
        if (App.GetInput().IsKeyDown(sf::Key::Left))  Sprite.Move(-100 * ElapsedTime, 0);
        if (App.GetInput().IsKeyDown(sf::Key::Right)) Sprite.Move( 100 * ElapsedTime, 0);
        if (App.GetInput().IsKeyDown(sf::Key::Up))    Sprite.Move(0, -100 * ElapsedTime);
        if (App.GetInput().IsKeyDown(sf::Key::Down))  Sprite.Move(0,  100 * ElapsedTime);

        // Rotate the sprite
        if (App.GetInput().IsKeyDown(sf::Key::Add))      Sprite.Rotate(- 100 * ElapsedTime);
        if (App.GetInput().IsKeyDown(sf::Key::Subtract)) Sprite.Rotate(+ 100 * ElapsedTime);

        // Clear screen
        App.Clear();

        // Display sprite in our window
        App.Draw(Sprite);

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}

The only part of the code I changed was the file name for the sprite. If I build this linking sfml-graphics.lib I get an unhandled Access violation at the ReadFromFile() call, and a bunch of jibberish is spit out of the console. If I like with sfml-graphics-d.lib, I get by the image loading part fine, but at the App.GetEvent(Event) call, I get another Access violation unhandled exception.

Am I doing something wrong? Is this a bug? Whats the deal? Thanks a lot for your help.

Pages: [1]