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 - Saadin Dassum

Pages: [1] 2
1
Window / Re: 32 bit to 64 bit
« on: November 22, 2014, 09:33:59 pm »
Or even simpler: just remove those options that the compiler/linker does not know, as TDM already links statically without them.

I just tried that.  Codeblocks gave me something that looks like this:
||=== Build: Debug in MPlayer (compiler: GNU GCC Compiler) ===|
C:\SFML-2.1\lib\libsfml-audio-s.a(Music.cpp.obj):Music.cpp|| undefined reference to `_Unwind_Resume'|
(.text$_ZN2sf4TextD0Ev[__ZN2sf4TextD0Ev]+0xa6)||undefined reference to `_Unwind_Resume'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===|

I deleted all the build log errors that were repeated or similair.  All of them were undefined references.
I also tried downloading mingw-w64.  The program still won't compile.  I'll run some experiments on my program and then come back after I have deduced more.  Thank you all for trying to help.

2
Window / Re: 32 bit to 64 bit
« on: November 21, 2014, 09:41:18 pm »
The error you're getting about -static-xyz is becausr your using the awful TDM compiler, which links the runtine libs statically by default.

What compiler would you recommend for me?  I've used codeblocks for everything I have learned in C++.  Should I use Visual C++?

3
Window / Re: 32 bit to 64 bit
« on: November 19, 2014, 02:36:42 am »
Hi again everyone.  I might have found another clue to why my program isn't working.  What I found out another clue (yeah, I'll call it that) as to what is going on in my new system.  I tried to change the window size and realized that this was not working either.  The program that was running in my new computer was probably just compiled in my old computer and being executed in my new one.  The program is not actually compiling.  When trying to build the program from scratch, the build log gives me this:
mingw32-g++.exe: error: unrecognized command line option '-static-libstdc++'
mingw32-g++.exe: error: unrecognized command line option '-static-libstdc++'

By the way, in Code::Blocks's, my Build Options Linker Settings has this:
"
-static-libgcc
-static-libstdc++
-std=c++11
"
in other linker settings.  These lines are the ones I used to be able to compile SFML from the beginning.  Do they have something to do with my problem?

4
Window / Re: 32 bit to 64 bit
« on: October 26, 2014, 06:51:11 pm »
Gambit, my OS is recognizing the gamepad exactly as it was before.  The way I tested it was with GTA: San Andreas.  I've tested it and it still works with San Andreas.  The only thing that it's not working is my program.  The only difference I can spot between both of my comoputers is that the HP is bluetooth compatible with the Dualshock 3, but the Alienware isn't.

5
Window / Sorry, here's the material
« on: October 26, 2014, 01:19:13 am »
Okay... Sorry about not posting everything that was needed.  I just thought it might have been a problem that was more typical and appeared more commonly when working with both 32-bit and 64-bit operations.
  Anyway, for you guys to understand what my code is supposed to do, there are different playlists.  You can switch to different playlists, and within those playlists, you can pause, play and go to the next or previous song.  You can also raise and lower the volume.  If a song is switched within a playlist, the program loads another file onto the sf::Music object that already exists and simply begins to play the sf::Music object again.  If a playlist is switched, the current sf::Music object's volume is set to 0, and the next playlist's sf::Music object's volume is raised to the user volume.
  All of this worked perfectly on my 32-bit HP.  I don't get why it's not working on my new computer.  None of the controls are working, and the code is the exact same on both systems.  The only other detail that might be important is that for a joypad, I'm using a Dualshock 3 (Playstation controller) with the DS3 tool, which is software to make it act like a joypad.
if (sf::Joystick::isButtonPressed(0, 12)) {  //Up button
        if (userVolume < 100)
            userVolume++;
        else
            userVolume = 100;

        switch (playlist) {
//set current playlist to new user volume
}
//A similar code for the Down button is placed here

    if (sf::Joystick::isButtonPressed(0, 13)) { //Right button
        switch (playlist) {
//set the current playlist's volume to 0 and the new one to userVolume
}
//A similar code for the Left button is placed here

if (playlist == genre1)    {  //While the radio station is set to genre1
        if (sf::Joystick::isButtonPressed(0, 1)) { //X button
                if (genre1Playlist.getStatus() == sf::Music::Playing) {
            genre1playlist.pause(); //Pause
                }
                else{
                genre1playlist.play(); //Play or resume
                }
        }
        if (sf::Joystick::isButtonPressed(0, 7)) { //R1 button
           if (genre1Number < grenre1Max) {
            genre1TrackNumber++;
           }
       //Reload song and play  (Next)
       }
//A similar code for the L1 button is placed here.
}
 

  That's it.  The code seems fine.  I have no idea why this isn't working.

6
Window / 32 bit to 64 bit
« on: October 24, 2014, 05:58:51 am »
I recently made a program with SFML.  It involved a "music player" type interaction with the user.  The main difference was that the user could change the music through a joypad.  A while after completing the first version of my program, I switched from a really incapable intel core i3 32 bit HP to an i7 64 bit Alienware.  Unfortunately, I can't use my new computer's great potential to continue making my program better.  The program seems to run perfectly.  The problem is that when I try to change the music, nothing will happen.  It's as if the program was completely ignoring the controller input.  The input I'm using is exactly the same as in my last computer.  Does my problem have to do with the software and specs?  Do you guys know what my problem might be?  Is it because my new computer is 64 bits? Forgive my ignorance.  I'm a little bit new to all of this.  I can give you guys more information if you need it to help me.  Thank you.

7
Graphics / Re: Keeping a font, but filling up its missing characters.
« on: August 15, 2014, 04:27:50 am »
Alright.  Thanks guys.

8
Graphics / Keeping a font, but filling up its missing characters.
« on: August 13, 2014, 05:13:37 am »
A few months ago, I finished a prototype music player program using SFML.  I ended up using Base 02 as its main font for the music player.  Unfortunately, Base 02 is very limited and it barely contains any characters other outside the range of the alphabet and numbers.  It looks very great with the program, so I really want to keep it, but I can't use any special characters to display the song titles, as an empty box will appear instead.  Is there any way to replace certain characters in an instance/object of sf::font?  For example, let's say I have:
sf::font base;
base.loadFromFile("base02.ttf");
 
I know an opening parenthesis text "(" is number 0040, but Base 02 lacks parenthesis characters, so writing an open parenthesis at any time would give me an empty box.  Is there any way to replace number 0040 (and other specific ones) with a character from another font?  Obviously I'd look for a similair font, but what I need to do now is just fill the blanks in so that the
base
object would stay as one instead of having to mess with multiple fonts for one string.  Thanks in advance for answers.

9
System / Re: I need urgent help with a project's music player
« on: January 28, 2014, 03:56:59 pm »
Guys, I think this is it.  I successfully created a playlist.  I feel like I should share in case other people have the same problem.  I fixed it by placing my music.openFromFile() outside of the window loop, and my first music.play() outside of the window loop.  Inside the window loop, my condition was:
if (music.getStatus() == sf::Music::Stopped)
  if (trackNumber <= 2) {
trackNumber++;
}
else
trackNumber = 0;

music.openFromFile(testingFiles.at(trackNumber));
music.play
}
 

All I did was make the music load again after every track was changed.  Thanks for all your help guys.  I'll give credit to all of you when presenting my project! ( If you want me to).

10
System / Re: I need urgent help with a project's music player
« on: January 27, 2014, 03:06:29 am »
Thanks, but that's not necessarily my problem.  Both the switch and the if statement do absolutely the same thing.  My problem is that the music will not start playing again after the track number goes up.  Do you think there's a reason for that?

11
System / Re: I need urgent help with a project's music player
« on: January 24, 2014, 08:36:49 pm »
It's okay.  It's not rude.  It's true.  I have to master C++ in a better way, but for now I do need some hints.  Guys, thank you all for your help.  I figured out one of the problems.  The reason that the music wouldn't play without the glitchy drawing loop was that it was inside the window loop.  Now, I moved the music outside of the drawing loop, but the music won't switch.  I've tried a lot of things, but no matter what, the track number won't move on when outside of the window loop.  This is what my code looks like now (I simplified it to focus on the basic music problem:

#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/Audio.hpp>


int main()
{
//Rendering the Window
            sf::RenderWindow window(sf::VideoMode(1200, 400), "Smart Fast Multimedia Library Helmet");
            window.setVerticalSyncEnabled(true);
            window.setFramerateLimit(30);
//Music Status Text
            sf::Text playingText;
            sf::Font base;
            if (!base.loadFromFile("Base 02.ttf")) {
                return -1;
            }
            playingText.setFont(base);
            playingText.setString("Music is Playing");
            playingText.setCharacterSize(24);
            playingText.setColor(sf::Color::Green);
            sf::Text pausedText;
            pausedText.setString("Music is Paused");
            pausedText.setCharacterSize(24);
            pausedText.setColor(sf::Color::Green);
//Vector Container
std::vector <std::string> testingFiles;
testingFiles.push_back("Title Screen.wav");
testingFiles.push_back("firstTrack.wav");
testingFiles.push_back("secondTrack.wav");
testingFiles.push_back("thirdTrack.wav");
//Playlist track number
int trackNumber = 0;
//Opening the music file
    sf::Music testingPlaylist;
    testingPlaylist.openFromFile(testingFiles.at(trackNumber));
        //Playing Music
        testingPlaylist.play();
        //Making sure that the track moves on
        testingPlaylist.getStatus();
 if (testingPlaylist.getStatus() == sf::Music::Stopped) {
    switch (trackNumber) {
    case 0:
        trackNumber++;
    case 1:
        trackNumber++;
        break;
    case 2:
        trackNumber++;
        break;
    default:
        trackNumber = 0;
        break;
    }
    testingPlaylist.play();
 }
//Window, sprites, and textures
    while (window.isOpen())
{
    sf::Texture mainMenuTexture;
    mainMenuTexture.loadFromFile("titleScreen.png");
    sf::Sprite mainMenuSprite;
    mainMenuSprite.setTexture(mainMenuTexture);
//Main Window Loop
        sf::Event windowIsClosed;
        while (window.pollEvent(windowIsClosed))  //Making sure that the Window can close
        {
            if (windowIsClosed.type == sf::Event::Closed)
                window.close();
        }
        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Space) && testingPlaylist.getStatus() == sf::Music::Playing) {
            testingPlaylist.pause();
        }
        //Drawing the window
        window.clear();
        window.draw(mainMenuSprite);
        window.display();
        }  /*Window Loop Ending*/

    return 0;
}  /*Main Function ending*/

 

12
System / Re: I need urgent help with a project's music player
« on: January 13, 2014, 12:12:48 am »
Quote
Ever tried if?
Yup.  I tried.  The music simply won't start.  Isn't there something that I could modify within those loops so that I could still get paused text and playing text?

13
System / Re: I need urgent help with a project's music player
« on: January 12, 2014, 02:43:29 am »
I tried deleting the while (testingPlaylist.getStatus() == sf::Music::Stopped) loop but it wouldn't really work after that.  The music simply wouldn't start

14
System / Re: I need urgent help with a project's music player
« on: January 08, 2014, 02:50:12 am »
My program is freezing and functioning terribly.  I'm not sure what's wrong or what's causing this.  I finally successfully got the music to move on, but I still have that one major issue.  Trying to click on the window will allow the program to keep on playing the music, but the window will freeze and stop working.  Might there be something in my code that causes this?  I've already tried to make the window smaller than the desktop so I doubt that it has to do with that.  I also tried adding a testing interaction (pausing the music when the space key is pressed) to see if that made  What do you think is causing my program to do this?
My current code:
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/Audio.hpp>


int main()
{
//Rendering the Window
            sf::RenderWindow window(sf::VideoMode(1200, 400), "Smart Fast Multimedia Library Helmet");
            window.setVerticalSyncEnabled(true);
            window.setFramerateLimit(30);
//Music Status Text
            sf::Text playingText;
            sf::Font base;
            if (!base.loadFromFile("Base 02.ttf")) {
                return -1;
            }
            playingText.setFont(base);
            playingText.setString("Music is Playing");
            playingText.setCharacterSize(24);
            playingText.setColor(sf::Color::Green);
            sf::Text pausedText;
            pausedText.setString("Music is Paused");
            pausedText.setCharacterSize(24);
            pausedText.setColor(sf::Color::Green);
//Playlist track number
int trackNumber = 3;
while (trackNumber == 4) {
    trackNumber = 0;
}
while (trackNumber == -1) {
    trackNumber == 3;
}
//Vector Container
std::vector <std::string> testingFiles;
testingFiles.push_back("BitterSweetSymphony.wav");
testingFiles.push_back("Helicopter.wav");
testingFiles.push_back("CheckYoSelf.wav");
testingFiles.push_back("LevelsGoodFeeling.wav");
//Window, sprites, and textures
    while (window.isOpen())
{
    sf::Texture mainMenuTexture;
    mainMenuTexture.loadFromFile("titleScreen.png");
    sf::Sprite mainMenuSprite;
    mainMenuSprite.setTexture(mainMenuTexture);
//Opening the music file
    sf::Music testingPlaylist;
    testingPlaylist.openFromFile(testingFiles.at(trackNumber));
//Main Window Loop
        sf::Event windowIsClosed;
        while (window.pollEvent(windowIsClosed))  //Making sure that the Window can close
        {
            if (windowIsClosed.type == sf::Event::Closed)
                window.close();
        }
        //Playing Music
        testingPlaylist.play();
        if (sf::Keyboard::isKeyPressed(sf::Keyboard::Space)) {
            testingPlaylist.pause();
        }
        //Making sure the track moves on
                while (testingPlaylist.getStatus() == sf::Music::Playing) {
          window.clear();
            window.draw(mainMenuSprite);
            window.draw(playingText);
            window.display();
        }
                while (testingPlaylist.getStatus() == sf::Music::Paused) {
          window.clear();
            window.draw(mainMenuSprite);
            window.draw(pausedText);
            window.display();
                }
         while (testingPlaylist.getStatus() == sf::Music::Stopped) {
            trackNumber++;
            testingPlaylist.play();
        }
        //Drawing the window
        window.clear();
        window.draw(mainMenuSprite);
        window.display();
        }  /*Window Loop Ending*/

    return 0;
}  /*Main Function ending*/

 

15
System / Re: I need urgent help with a project's music player
« on: January 07, 2014, 01:33:25 am »
Nevermind.  Sorry, I realize the stupidity in my question.  I thought you were saying I didn't have to use testingplaylist.play() again.  My bad! :-[

Pages: [1] 2
anything