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

Pages: [1]
1
Audio / SoundBuffer error "Incomplete type not allowed"
« on: December 10, 2020, 03:28:39 am »
Hello guys,

I am trying to load a losing sound for minesweeper, and I achieved this in the main window first. I then moved my function to a class and I am getting an incomplete type not allowed on my buffer object. Any ideas? My code is below:

void Board::losingSound(sf::SoundBuffer& buffer, sf::Sound& sound)
{
   buffer.loadFromFile("sound/gameover.wav");


   sound.setBuffer(buffer);

   sound.play();

   soundOff = true;
}

2
Hello, I am using my window from Render Window to be the width and height of a file I input for Minesweeper

sf::RenderWindow window(sf::VideoMode(cfgWindowMaker.GetWidth(), cfgWindowMaker.GetHeight()), "Minesweeper!", sf::Style::Close);

and when a button is clicked, the window for Render Window would change to whatever the files dimensions are. This seems to draw the board correctly, but my window does not resize. My code is below


if (event.type == sf::Event::Resized) {
            // resize my view
            view.setSize({
                  static_cast<float>(event.size.width),
                  static_cast<float>(event.size.height)
               });

            sf::RenderWindow window(sf::VideoMode(cfgWindowMaker.GetWidth(), cfgWindowMaker.GetHeight()), "Minesweeper!", sf::Style::Close);
         }


if (test1Btn.contains(mousePosFloat))
               {
                  boardObject.ResetGame(cfgWindowMaker);
                  cfgWindowMaker.ReadingCFGFile("boards/configbeginner.cfg");
                  boardObject.RandomBombMaker(cfgWindowMaker, window);
                  sf::RenderWindow window(sf::VideoMode(cfgWindowMaker.GetWidth(), cfgWindowMaker.GetHeight()), "Minesweeper!", sf::Style::Close);
                  window.setView(view);
                  
               }


Any help is much appreciated. I am trying to have my window actually match the dimensions of my board when the new fie get added

Pages: [1]
anything