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

Pages: [1]
1
Window / Delayed input when key is held down
« on: November 29, 2010, 11:44:02 pm »
Ahh yes, it works now, thanks very much :)

2
Window / Delayed input when key is held down
« on: November 29, 2010, 11:22:58 pm »
Thanks for the quick response. I'm already using sf::input though, I initially checked the documentation and switched from checking window events to using sf::input, but for some reason it still behaves the same way. Here's the code:

Code: [Select]
void ProcessKeyboard(sf::Event Event)
{
const sf::Input& input = window.GetInput();
if (input.IsKeyDown(sf::Key::Escape))
window.Close();

        //old code
//if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code   == sf::Key::W))
//{

// new code
if (input.IsKeyDown(sf::Key::W))
{

Am I missing something?
Thanks,
Stephen

3
Window / Delayed input when key is held down
« on: November 29, 2010, 10:47:15 pm »
Hi, I'm writing a game atm using SFML and I want WSAD to be the movement keys. The problem is that when they are held down to move forwards/backwards etc there is a delay. The player initially moves one iteration forward and then pauses momentarily before the repeated input kicks in and he starts moving forward smoothly. Is there a way to turn this delay off? Or some other solution? I'm used to using XNA where there isn't a delay of this sort.

Thanks!
Stephen

4
Graphics / graphics tutorial code not working - Image.LoadFromFile
« on: November 01, 2010, 04:56:00 pm »
That fixed it, thanks :)

5
Window / Window tutorial code freezes when run
« on: October 31, 2010, 10:04:18 pm »
Ahhh I was pulling my hair out over nothing... thanks a lot! :)

6
Graphics / graphics tutorial code not working - Image.LoadFromFile
« on: October 31, 2010, 10:02:09 pm »
I've downloaded the graphics-sprite tutorial source code but when I run it with an image of my own the program crashes. The only change I've made to the code is:

if (!Image.LoadFromFile("sprite.tga"))
        return EXIT_FAILURE;

if (!Image.LoadFromFile("C:\\zorg_logo.png"))
        return EXIT_FAILURE;

Replacing the sprite.tga file with one of my own. I originally put the zorg_logo image in the folder containing the project file. I also put it in all other folders I thought it might read it from, including the folder containing the solution, and the debug folder containing the executable. And as you can see I've now tried just putting the image in the C:\\ directory to try loading it from there but that doesn't work either.

When I run debug in VS2008 it points to the "if (!Image.LoadFromFile("C:\\zorg_logo.png"))" line and gives the error:

"First-chance exception at 0x72e065af in sfmlGraphicsSprite.exe: 0xC0000005: Access violation reading location 0xcccccccc.
A buffer overrun has occurred in sfmlGraphicsSprite.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program."

The strange thing is that when I run the code from the previous tutorial (graphics-window) it also gives a similar error, however this time pointing to the "App.Display();" line. This is particularly strange because in the tutorial code there is no image being loaded. So I don't know why I can successfully run the previous tutorial code in the Window section but not this code in the graphics section.

Ideas are much appreciated - thanks!

7
Window / Window tutorial code freezes when run
« on: October 30, 2010, 12:48:52 pm »
Hi all, I've just started using SFML but for some reason when I run the Window-Window.cpp tutorial code the window freezes as soon as it appear. I can't minimize it or anything and have to end it throug task manager.  I've tried running the very first SFML clock code and that runs fine inside a consol window so it seems that I've set SFML up okay.

I'm using visual studio 2008 and running on Windows 7 64bit btw.

I've tried putting the code in different types of projects, I've tried a Win32 project, and just a basic consol project. I've also put the code in a blank project of both types (window and consol) and that doesn't work. I'm linking to the sfml-window-s.lib, sfml-system-s.lib and sfml-main.lib. I've tried linking to the first two non-statically, I've tried switching between debug and release mode and adding the -d suffix accordingly.

Any ideas would be much appreciated - thanks!

Pages: [1]