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

Pages: [1]
1
Graphics / Re: Problem with loading an image.
« on: September 18, 2013, 02:49:22 am »
I get that whenever I try doing this code.
        Texture ptex;
        Sprite pimage;

        ptex.loadFromFile("Player.png");

        pimage.setTexture(ptex);

It also beeps a bunch if that information helps.

2
Graphics / Re: Problem with loading an image.
« on: September 18, 2013, 02:32:37 am »
I did come from those tutorials :P but i did not neglect the SFML reference page. And my problem is not from the events it only happens when i try to load the image.

This is what the command console is giving me, along with beeps.

3
Graphics / Problem with loading an image.
« on: September 18, 2013, 02:14:21 am »
When i try loading an image i get this error.
'SFML.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\atigktxx.dll'
'SFML.exe' (Win32): Loaded 'C:\Windows\SysWOW64\atigktxx.dll'. Cannot find or open the PDB file.
The thread 0x2f3c has exited with code 0 (0x0).
The program '[8956] SFML.exe' has exited with code 0 (0x0).

This is my code.
#include<SFML/Graphics.hpp>
#include<iostream>

using namespace sf;



 
int main()
{

        Texture ptex;
        Sprite pimage;

        ptex.loadFromFile("Player.png");

        pimage.setTexture(ptex);


    RenderWindow Window(VideoMode(800, 600, 32), "Displaying Images");

        int px = 20;
        int py = 20;

        RectangleShape rect1;

        rect1.setSize(Vector2f(50, 50));
        rect1.setPosition(px,py);
        rect1.setOutlineColor(Color::Red);
        rect1.setOutlineThickness(5);
        rect1.setOrigin(25,25);

        RectangleShape shot;

        Clock clock;

        float moveSpeed = 5000.0f;
        float rot = .050f;

    while(Window.isOpen())
    {
                clock.restart();
        Event Event;

                Vector2i mpos = Mouse::getPosition(Window);
               
        while(Window.pollEvent(Event))
        {
            if(Event.type == Event::Closed || Event.key.code == Keyboard::Escape)
                Window.close();
                                        if(Event::MouseMoved)
                        rect1.setPosition(mpos.x,mpos.y);
        }

                if(Keyboard::isKeyPressed(Keyboard::Right))
                        rect1.move(moveSpeed * clock.getElapsedTime().asSeconds(), 0);
                if(Keyboard::isKeyPressed(Keyboard::Left))
                        rect1.move(-moveSpeed * clock.getElapsedTime().asSeconds(), 0);
                if(Keyboard::isKeyPressed(Keyboard::Up))
                        rect1.move(0, -moveSpeed * clock.getElapsedTime().asSeconds());
                if(Keyboard::isKeyPressed(Keyboard::Down))
                        rect1.move(0, moveSpeed * clock.getElapsedTime().asSeconds());
                if(Keyboard::isKeyPressed(Keyboard::D))
                        rect1.rotate(rot);
                if(Keyboard::isKeyPressed(Keyboard::A))
                        rect1.rotate(-rot);

                Window.draw(rect1);
        Window.display();
                Window.clear();
    }
    return 0;
}

Pages: [1]