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

Pages: [1]
1
General / sf::Sleep doesn't do it's job on SFML 2
« on: July 13, 2011, 04:45:29 am »
Due to the fact that SFML 1.6. didn't work on my PC anymore because of the known conflict with the ATI GraphicsCard Driver...
http://www.sfml-dev.org/forum/viewtopic.php?t=4550&highlight=
...i have to use SFML 2 since i don't want to use old drivers.

So I compiled the files for dynamic linking according to the "Tutorials for Version 2.0"

I use MS C++ 2010.
I compiled the example from "Compiling your first program":
http://www.sfml-dev.org/tutorials/1.6/start-vc.php

My Problem is that sf::Sleep doesn't do it's job.
There isn't a compiler error. Well there WAS a warning saying something like flout isn't the same as sf::Unit32. But this warning magically disappeared.

I can execute the Program und it shows me:
0, 1, 1, 1, 2, 2, 3, 4, 4, 4, 4, 4, 4, 4

Not what you would expect. Furthermore it shows me all this numbers right at the start since sf::Sleep doesn't do it's job.
    -may be because of this float != sf::Unit32 thing?




When I try to compile the "Graphics - Drawing simple shapes" graphics-shape.cpp  it tells me that "GetEvent" is not a element of "sf::RenderWindow" and it doesn't compile.

When I delete some of this lines it tells me that  "SetOutlineWidth" isn't a element of "sf::Shape". When I delete this line too it leaves me with:

Code: [Select]

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


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

// Clear screen
        App.Clear();

        // Draw predefined shapes
        App.Draw(sf::Shape::Line(10, 10, 710, 100, 15, sf::Color::Red));
        App.Draw(sf::Shape::Circle(200, 200, 100, sf::Color::Yellow, 10, sf::Color::Blue));
        App.Draw(sf::Shape::Rectangle(350, 200, 600, 350, sf::Color::Green));

        // Build a custom convex shape
        sf::Shape Polygon;
        Polygon.AddPoint(0, -50,  sf::Color(255, 0, 0),     sf::Color(0, 128, 128));
        Polygon.AddPoint(50, 0,   sf::Color(255, 85, 85),   sf::Color(0, 128, 128));
        Polygon.AddPoint(50, 50,  sf::Color(255, 170, 170), sf::Color(0, 128, 128));
        Polygon.AddPoint(0, 100,  sf::Color(255, 255, 255), sf::Color(0, 128, 128));
        Polygon.AddPoint(-50, 50, sf::Color(255, 170, 170), sf::Color(0, 128, 128));
        Polygon.AddPoint(-50, 0,  sf::Color(255, 85, 85),   sf::Color(0, 128, 128));

        // Disable filling and enable the outline
        Polygon.EnableFill(false);
        Polygon.EnableOutline(true);

        // We can still use the functions common to all SFML drawable objects
        Polygon.SetColor(sf::Color(255, 255, 255, 200));
        Polygon.Move(300, 300);
        Polygon.Scale(3, 2);
        Polygon.Rotate(45);

        // Draw it
        App.Draw(Polygon);

        // Finally, display the rendered frame on screen
        App.Display();

    return EXIT_SUCCESS;
}



This actually compiles and also runns. I can see that it draws all the Shapes as it is supposed to.

What could be the problem?
Could it be that I made a mistake when i compiled SFML2?

2
Graphics / Would a buffer help me?
« on: July 14, 2010, 12:30:26 am »
Hey.
I'm sorry but i couldn't think of a better subject.
Here is my Porblem:

Code: [Select]

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow App(sf::VideoMode(800,600),"lala");
    App.UseVerticalSync(true);

    sf::Event Event;
    sf::Image Image;
    Image.LoadFromFile("E:/again_i_try_to/test/bin/Debug/x.bmp");

    sf::Sprite Sprite;
    Sprite.SetImage(Image);

    while(App.IsOpened())
    {
        while(App.GetEvent(Event))
        {
            if((Event.Type== sf::Event::KeyPressed) && (Event.Key.Code==sf::Key::Escape))
            App.Close();

            if(Event.Type==sf::Event::Closed)
            App.Close();
        }
        App.Clear(sf::Color(120,21,34));
        Sprite.SetPosition(Event.MouseMove.X,Event.MouseMove.Y);
        App.SetCursorPosition(100,100);

        App.Draw(Sprite);
        App.Display();
    }

    return EXIT_SUCCESS;
}


For some reason the cursor is moving around if you move your mouse. Thats not very surprising since I move it before I Set it back to (100,100). But why can I actually SEE this? Is there a way to fix this problem? Maybe a Buffersystem like in SDL?
I'm aware of the the fact, that I simly could delete the liene "Sprite.SetPosition(Event.MouseMove.X,Event.MouseMove.Y);" but i would like to fix this problem rather to learn than to produce a working code.

Thank you all.

3
System / No sf::Input without checking for Events?
« on: June 24, 2009, 10:39:17 pm »
Hallo world :]

I just started out with SFML. On my way I had a problem. I'm sure you can help me ;-)

Code: [Select]

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow App(sf::VideoMode(600,300),"test");

    sf::Image Image;
    Image.LoadFromFile("lol.JPG");
    const sf::Input& Input = App.GetInput();

    sf::Sprite Sprite(Image);

    sf::Event Event;

    while (App.IsOpened())
    {
/*
      while (App.GetEvent(Event))
        {
            if (Event.Type==sf::Event::Closed)
              App.Close();

            if ((Event.Type==sf::Event::KeyPressed) && (Event.Key.Code==sf::Key::D))
              Sprite.Move(1.5,0);
        }
*/

bool Rechts = Input.IsKeyDown(sf::Key::Right);
    if(Rechts)
      Sprite.Move(1.5,0);
        App.Clear(sf::Color(231,32,111));
        App.Draw(Sprite);
        App.Display();
    }
    return 0;
}


I comiles and it runs but it doesn't do what I expact it to do.
It doesn't react if I prss the Right key.

How ever...when I also compile the comments ( between /*  */) it works.
Why? IsKeyDown doesn't depend on GetEvent does it?

BorisDieKlinge

4
General / SFML is bucking
« on: February 10, 2009, 11:22:39 pm »
Hi there
I've got a problem with SFML I already wrote about in the German forum. Now I've been told by Tank to tell you guys about my problem. Here we go...

My System:
Windows-XP-32-Professional
HD4850
Q6700
3GB Memory

SFML is not running smoothly on my computer. When I launch the pre-compiled examples provided with SFML (like opengl.exe), they do run with an effective FPS of 75. But approx. every second my mouse cursor judders, aswell as the graphics in the SFML application (like the cube in the opengl.exe example).

Compiler issues aren't an option, since I'm using the pre-compiled binaries. I've already got the latest video driver (Catalyst) for my graphics card. I also tested OpenGL with CS 1.6 (OpenGL mode) and several NeHe examples from http://nehe.gamedev.net/.

I hope this description is detailed enough to give you an idea of my problem. If you're speaking German, you could also check out the original discussion at the German forums.

BorisDieKlinge

5
General / compiler error
« on: February 07, 2009, 08:24:13 pm »
Hallo :-)
I've got a problem with the sf::Sprite class using the IDE code::blocks 8.02.

When I compile the graphics-sprite.cpp i downloaded from the tutorial the following error will appear:

main.cpp: variable 'vtable for sf::Sprite' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.

I would be happy if anybody could help me. thx for reading.
BorisDieKlinge

Pages: [1]