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

Pages: [1]
1
General / sfeMovie installation and general building questions
« on: November 29, 2011, 05:19:46 am »
Being new to C++, I'm having trouble understanding how to compile, build and link to libraries. I was able to get SFML working more out of luck than actually understanding the core concepts. Now that I'm trying to install sfeMovie, I'm hitting a wall. I've been at this for a few hours, so I'll go over the steps I took, and would love any pointers in the right direction.

Step 1: dynamic linking

I grabbed the download here under binaries. Then, I added the libsfe-movie.dylib to Xcode under Target -> Summary -> Linked Frameworks and Libraries. I added the header file to the project as well. The project was built successfully, but threw a warning that the file format was not correct for the architecture being linked (x86_64). Changing my project to 32-bit got rid of the warning, but caused a fatal error when running.

Question 1: My assumption at this point is that my options are to compile SFML as 32-bit, or to compile sfeMovie as 64-bit. Is that correct, or are there other factors at play?

Step 2: Using build.sh

I took the approach of trying to compile sfeMovie on my own. I tried both the beta file and the current Git repo. In terminal, I placed:

Code: [Select]
sudo bash build.sh macosx -arch x86_64

For both attempts, a ton of errors were thrown. Sample of errors:

Code: [Select]
ormat/avformat.h:1374: error: expected declaration specifiers or ‘...’ before ‘int64_t’
./libavformat/avformat.h:1384: error: expected declaration specifiers or ‘...’ before ‘int64_t’
./libavformat/avformat.h:1393: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘av_gen_search’
./libavformat/avformat.h:1552: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parse_date’
./libavformat/avformat.h:1558: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘av_gettime’
make: *** [libavdevice/alldevices.o] Error 1
*** an error occured, aborting.


Question 2: The only thing I could think of here is that I'm not using GCC. Is it used by default if I have it installed, or do I have to specify it? Or, is that a false lead, and is something else causing the errors?

Step 3: using CMake

I basically tried the same approach I used to install SFML. opened CMake, set the Git folder to the source path, tried both Debug and Release, and set the architecture to both Default and x86_64. Hit Configure again, and then generate. Went to the directory in terminal, ran a make clean and then a sudo make install. Sample errors are:

Code: [Select]
/Users/veeneck/GameDev/sfeMovieGit/src/Movie.cpp:402: error: ‘av_malloc’ cannot be used as a function
/Users/veeneck/GameDev/sfeMovieGit/src/Movie.cpp:421: error: ‘cerr’ is not a member of ‘std’
/Users/veeneck/GameDev/sfeMovieGit/src/Movie.cpp:421: error: ‘endl’ is not a member of ‘std’
/Users/veeneck/GameDev/sfeMovieGit/src/Movie.cpp: In member function ‘bool sfe::Movie::SaveFrame(AVPacket*)’:
/Users/veeneck/GameDev/sfeMovieGit/src/Movie.cpp:450: error: ‘cerr’ is not a member of ‘std’
make[2]: *** [CMakeFiles/sfe-movie.dir/src/Movie.cpp.o] Error 1
make[1]: *** [CMakeFiles/sfe-movie.dir/all] Error 2
make: *** [all] Error 2


Question 3: At this point, I'm just copy/pasting from the SFML install tutorial. Can someone explain the different concepts going on between step 2 and step 3?

And lastly, 2 more follow up questions.

Question 4: Any tips on other approaches I should try?

Question 5: Does anyone have a favorite article, tutorial or book on building, compiling, static linking, dynamic linking and frameworks?

Thanks a ton.

2
Window / Beginner question about RenderWindow::Display()
« on: November 26, 2011, 08:26:30 pm »
I'm having trouble understanding the core concept of a game loop, and when the display actually happens. Could someone explain why this code (using SFML 2.0) successfully pops up a blank window:

Code: [Select]
void Game::Start(void) {    
    _mainWindow.Create(sf::VideoMode(1024, 768), "Otto");
    _mainWindow.SetFramerateLimit(60);

   
    while (!IsExiting()) {
        sf::Event currentEvent;
        while (_mainWindow.PollEvent(currentEvent)) {        
           
        }
        _mainWindow.Clear(sf::Color(0,0,0));
        _mainWindow.Display();
    }
   
    _mainWindow.Close();
}


But this code does not:

Code: [Select]
void Game::Start(void) {    
    _mainWindow.Create(sf::VideoMode(1024, 768), "Otto");
    _mainWindow.SetFramerateLimit(60);

   
    while (!IsExiting()) {
        _mainWindow.Clear(sf::Color(0,0,0));
        _mainWindow.Display();
    }
   
    _mainWindow.Close();
}


All that I removed is the event handling. Is there some tie in at the SFML level that actually triggers the display, or does the display happen immediately when .Display() is called?

Thanks for any help!

Pages: [1]
anything