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

Pages: [1]
1
Audio / Can't play MP3s with <SFML/Audio>?
« on: July 25, 2014, 08:49:02 pm »
So, first I'll post the code, then explain:

#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <Windows.h>

int main()
{
        ShowWindow(GetConsoleWindow(), SW_HIDE);
        sf::Music music;
        if (!music.openFromFile("C:\Users\Public\Music\Sample Music\Kalimba.mp3"))
                return -1; // error
        music.play();
        return 0;
}

I am using Visual Studio 2013 Express, and when I run this program, I get an irritating beeping noise and get this message:
Quote
Unhandled exception at 0x0F26DEF8 (msvcr110.dll) in sfmoDemo.exe: 0xC0000005: Access violation reading location 0x00297000.

I don't really know what that means. Is there anything wrong with the code? I got it from the resources page - http://www.sfml-dev.org/tutorials/2.1/audio-sounds.php - so I assume it isn't that. Is there a way that I setup SFML wrong? I'd appreciate any help I can get! Thanks!

2
Window / Help with creating a window?
« on: June 06, 2014, 04:56:04 pm »
So, I finally got SFML to work, and I am trying to use the tutorials on the site
http://sfml-dev.org/tutorials/1.6/window-window.php

Well, the code at the top doesn't work for me. Am I missing something? My code:

#include <iostream>
#include <SFML/Window.hpp>
using namespace std;

int main(int argc, char** argv)
{
    sf::Window window(sf::VideoMode(800, 600, 32), "SFML Window");
   
    while(window.isOpen()){
        sf::Event event;
        while(window.pollEvent(event)){

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

    return 0;
}


 

Pages: [1]