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

Pages: [1]
1
General / Re: Linking errors when trying to use audio.
« on: November 22, 2020, 11:35:12 pm »
ok, I found the problem, I was missing openal32.lib

2
General / Linking errors when trying to use audio.
« on: November 22, 2020, 11:29:26 pm »


I added everything to the Input area to link with those libs:

sfml-graphics-s-d.lib
sfml-window-s-d.lib
sfml-network-s-d.lib
sfml-system-s-d.lib
sfml-audio-s-d.lib
opengl32.lib
freetype.lib
winmm.lib
gdi32.lib
flac.lib
vorbisenc.lib
vorbisfile.lib
vorbis.lib
ogg.lib
ws2_32.lib

I am using the x86 ( 32 bit ) version yet it seems that it does not want to work.. I am getting linking errors about the sfml-audio-s-d.lib If I remove all the code about the sound stuff, it works with no problem.

I am also including "#include <SFML/Audio.hpp>".

Thanks!


3
General / Re: Simple rotation does not work
« on: November 22, 2020, 01:11:45 am »
Now it makes perfect sense, thank you!  ;D

4
General / Simple rotation does not work
« on: November 21, 2020, 09:47:36 pm »
#include <iostream>
#include <SFML/Graphics.hpp>

const int WIDTH = 1024;
const int HEIGHT = 860;
const int W_CENTER = WIDTH / 2;
const int H_CENTER = HEIGHT / 2;

int main()
{
        sf::RenderWindow window(sf::VideoMode(1024, 860), "Asteroids");

        sf::RectangleShape rectangle(sf::Vector2f(50.0f, 50.0f));
        rectangle.setFillColor(sf::Color(200, 0, 200));
        rectangle.setPosition(sf::Vector2f(W_CENTER, H_CENTER));
        rectangle.setOrigin(25, 25);

        float angle = 1;

        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                        {
                                window.close();
                        }

                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
                        {

                                rectangle.rotate(-angle);
                        }
                       
                        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
                        {

                                rectangle.rotate(angle);
                        }

                }



                window.clear(sf::Color::Black);
                window.draw(rectangle);
                window.display();
        }

        return 0;
}
 

Very simple, but if I mouse the mouse around at the same time I press either the Left or Right key, the rotation goes nuts and you see that I don't have any work to do with the mouse, just with the keys. Maybe I am missing something, anyway, makes no snese tp me.

Thank you!

Pages: [1]
anything