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

Pages: 1 2 [3] 4 5 ... 16
31
General / Re: boost and SFML
« on: August 28, 2012, 12:42:18 pm »
Yeah, so maybe the BoostPro installer is just broken. Or maybe it's designed that way to get more customers for their support service? No, that's too evil..

How bad was the build process? I'm a bit scared of it... Do you know of a good, detailed, well structured step-by-step guide for the whole process?

32
General / Re: boost and SFML
« on: August 28, 2012, 11:51:07 am »
What do you include then?

These are my include directives:
#include <iostream>
#include <boost/filesystem.hpp>

If you setup an empty project and include only the header files needed for the library then there should not be any pragma comment calls or similar. And you'll have to add things on your own to the project settings to get everything working...
It's essentially the same as with SFML with the only difference in the library itself. ;)
I don't think I understand what you mean exactly, but what I am doing here is pretty much similar to what I do when including SFML into a project. Except with SFML I don't add anything to the Path.

Also, SFML works out of the box, has a nice build system, plus a forum with actual support, and a responsible developer. I guess those are the main differences to boost. ;)

33
General / Re: boost and SFML
« on: August 28, 2012, 11:18:51 am »
Well, the thing is that I hadn't entered anything in Additional Dependencies, fully expecting that other familiar linker error with the symbols.

I tried entering the lib file, as with other libraries, but that has no effect at all, so I am guessing the linker is being told to look for "libboost_..." with some fancy preprocessor command somewhere.

So now I have:
  • ...\boost_1_51 as an include directory
  • ...\boost_1_51\lib as a library directory
  • boost_filesystem-vc100-mt-gd-1_51.lib as an additional dependency in the linker settings
  • ...\boost_1_51 in the Path environment variable
I checked and double checked, and should be all set and ready to go, right?

All I get when I try to compile the code in the very first boost::filesystem tutorial is this:
Quote
1>------ Rebuild All started: Project: boost test, Configuration: Debug Win32 ------
1>Build started 8/28/2012 11:08:54 AM.
1>InitializeBuildStatus:
1>  Touching "Debug\boost test.unsuccessfulbuild".
1>ClCompile:
1>  main.cpp
1>LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc100-mt-gd-1_51.lib'
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:03.12
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

34
General / Re: boost and SFML
« on: August 28, 2012, 04:06:38 am »
Yes, I tried that too, but without success. But I think I see what the problem is now:

The linker is looking for 'libboost_filesystem-vc100-mt-gd-1_51.lib', but the file in \boost_1_51\lib is named 'boost_filesystem-vc100-mt-gd-1_51.lib'.

Changing the name gives a new error that the linker can't find 'libboost_system-vc100-mt-gd-1_51.lib'. Does that mean I have to change all the file names to the correct format, or is there a better way?

Thank you for helping me, by the way!

35
General / Re: boost and SFML
« on: August 28, 2012, 02:13:03 am »
I installed boost, but I can't get filesystem going. I get this error:
Quote
LINK : fatal error LNK1104: cannot open file 'libboost_filesystem-vc100-mt-gd-1_51.lib'
I looked at the documentation and searched the net, and there was some mention of setting the Path environment variable. I did tick the box in the installer to do so automatically, though.

Anyway, I tried adding the \boost_1_51 directory with no luck. Then \boost_1_51\lib, and then the directory containing \boost_1_51. Still no cigar.

Then I read somewhere that I would have to build bjam and then the libraries. I don't believe that makes sense, since libboost_filesystem-vc100-mt-gd-1_51.lib is already built and located in the \boost_1_51\lib directory, along with the .lib and .dll files for all the other libraries. Besides, isn't the whole point of the installer not having to build boost yourself?

So where do I go from here? I am at a loss.

36
General / Re: boost and SFML
« on: August 28, 2012, 12:34:59 am »
...when you know exactly what you do.
Which I don't, so Multithreaded DLL it is. ;) Thanks Laurent!

37
General / boost and SFML
« on: August 28, 2012, 12:10:53 am »
I am finally going to install boost and play with it.

I am using the BoostPro 1.51.0 Installer (32-bit) on a Windows 7 system with Visual studio 2010, and the installer gives several options for versions to install:
  • Multithreaded DLL
  • Multithreaded
  • Multithreaded, static runtime
  • Single threaded, static runtime
Is there a preferred version to use with SFML?

I am installing it now because I need a portable way of handling files, and boost::filesystem looks nice.
Are there other boost libraries you would recommend I install?
I only do small games and graphical applications, so nothing too complicated or sciencey  :D

38
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 09:25:27 pm »
To disable the tab usage, just do this:
tgui::tabKeyUsageEnabled = false;
That gives me a linker error:
Quote
error LNK2001: unresolved external symbol "bool tgui::tabKeyUsageEnabled" (?tabKeyUsageEnabled@tgui@@3_NA)

39
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 08:45:50 pm »
The behaviour with the edit boxes is as expected. Unfocusing is similar to using the tab key.
I didn't know you were trying to unfocus all of the objects. But I have just added an unfocusAllObjects function, so you can now just use window.unfocusAllObjects().
How about changing the name of unfocus() to focusNext(), then? It is always good to avoid side effects.

Also, is it possible to disable the tab key functionality entirely?

40
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 07:34:15 pm »
I tried the fix, and it works some of the time.

I have 3 EditBoxes.
1 of them is added directly to the Form, and that works as it should.
The other 2 are both added to the same Panel, and when I call unfocus() on one of them, while it is focussed, the other one gets focussed.

I have tried calling unfocus() on the panel, but that gives an error that the call is ambiguous.

Also, Building worked fine, but I did get an error when building the INSTALL target in release mode. I am having no problems after copying the appropriate files, though.
Building in Debug mode gave no error.

41
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 04:40:16 pm »
Don't be so hard on yourself.

I once spent an hour debugging a condition in an if statement that would seemingly always evaluate to 'true'. I tried everything I could think of, but the code in the pointy brackets would always execute, no matter what I did.

Then I noticed the semicolon after the close parenthesis.

Programming is a humbling experience. :)

42
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 04:09:27 pm »
... you will have to ask the parent object to unfocus the object for now.
window.unfocus(myEditbox);
I tried that, but I can't make it work. Here is a minimal example of what I am trying to do:
#include <SFML/Graphics.hpp>
#include <TGUI/TGUI.hpp>

int main()
{
        sf::RenderWindow window( sf::VideoMode( 1024, 768 ), "TGUI" );
       
        sf::Font myFont;
        myFont.loadFromFile( "resource/TGUI/DejaVuSans.ttf" );
       
        tgui::Form gui( window );
        gui.globalFont = myFont;
       
        tgui::EditBox *myEditBox = gui.add<tgui::EditBox>( "" );
        myEditBox->load( "resource/TGUI/objects/EditBox/Black" );
        myEditBox->callbackID = 1;

        while( window.isOpen() )
        {
                sf::Event event;
                while( window.pollEvent( event ) )
                {

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

                        else if( event.type == sf::Event::KeyPressed &&
                                 event.key.code == sf::Keyboard::Return )
                                gui.unfocus( myEditBox );
                       
                        gui.handleEvent( event );
                }

                tgui::Callback callback;
                while( gui.getCallback( callback ) )
                {
                        std::cout << "There was a callback event" << std::endl;
                }

                window.clear();
                gui.draw();
                window.display();
        }
       
    return EXIT_SUCCESS;
}

43
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 05:46:53 am »
Sounds good, texus.

Now I have another problem, though. Well, actually 2, also with EditBox:

First of all, it would be nice with a "lost focus" event. I can simulate that by checking if an sf::Event::MouseButtonPressed happened outside a focussed EditBox, before passing the event to TGUI.
It would be more practical if it could happen automatically, though.

Second, I would like to unfocus an EditBox when the return key is pressed, but I can't figure out how to do so. I tried objectUnfocused(), but that seems to do nothing.

44
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 26, 2012, 04:13:23 am »
I did try that, but the text didn't event display. I guessed it was because the scaling was still applied, and now the text was simply much smaller to begin with.

45
SFML projects / Re: TGUI: a c++ GUI for SFML (with Form Builder)
« on: August 25, 2012, 08:47:27 pm »
Hi texus,

I seem to have run into a problem with the text scaling now.. Is there currently any way to re-size an EditBox in TGUI without scaling the text? I wanted to make a small EditBox, but the text became so blurry that it was hardly readable.

Pages: 1 2 [3] 4 5 ... 16