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

Pages: [1]
1
General / Getting around automatic key-pauses?
« on: October 20, 2010, 04:48:23 am »
You don't have to put
Code: [Select]
if (Input.IsKeyDown(sf::Key::Left))
Game.player->Move("Left");

within the Get Event loop. You can use it outside of that loop. I imagine that would fix your problem.

2
General / Crash at app run
« on: October 12, 2010, 10:56:27 pm »
Not sure what to say then, it should work.

I would create another project, enter all the linker settings and try again. If that still doesn't work, I would download vs 2008, and try using the precompiled version of SFML.

3
Graphics / Variables as colors
« on: October 12, 2010, 08:46:32 pm »
Yes, it should be possible.

It would also only take like two seconds to test it yourself.  :)

4
General / Crash at app run
« on: October 12, 2010, 08:44:09 pm »
The code I posted is from the first graphics tutorial. I guess its not technically the first tut.

Anyway, I'm guessing you have some linking problems. That was what I struggled with at first. (I was also getting unresolved external)

I'll just go through the linking steps again. I have vs 2008, but it should work in the same way in vs 2010.

Go to View/ "Your Project Name" Properties. (You can also press ALT + f7 in vs2008).

Go to
Configuration Properties
C/C++
Preprocessor
Add SFML_DYNAMIC to the end of "Preprocessor Definitions"

Go to
Configuration Properties
Linker
Input
Add "sfml-window-d.lib sfml-graphics-d.lib sfml-system-d.lib" into "Additional dependencies".


Make sure you have all the required .dll files in your project folder.

That should be it. I assumed you already added the folder locations for for Visual C++ to find. (I'm referring to the first part of this tutorial: http://www.sfml-dev.org/tutorials/1.6/start-vc.php )

5
General / Crash at app run
« on: October 12, 2010, 05:50:25 pm »
Maybe try running the code from one of the tutorials?

Here's the code from the first tut.
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");

    // 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();

            // A key has been pressed
            if (Event.Type == sf::Event::KeyPressed)
            {
                // Escape key : exit
                if (Event.Key.Code == sf::Key::Escape)
                    App.Close();

                // F1 key : capture a screenshot
                if (Event.Key.Code == sf::Key::F1)
                {
                    sf::Image Screen = App.Capture();
                    Screen.SaveToFile("screenshot.jpg");
                }
            }
        }

        // Clear the screen with red color
        App.Clear(sf::Color(200, 0, 0));

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

    return EXIT_SUCCESS;
}


I'm new to SFML so maybe I'm missing something, but in your code I noticed you used sf::window App(...); Shouldn't it be sf::RenderWindow App(...) ?

Also not sure what the WINAPI WinMain (...) stuff is, but as I said I'm a very new to SFML and programming.

Pages: [1]