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

Pages: 1 ... 90 91 [92] 93
1366
SFML projects / SFGUI
« on: November 14, 2011, 12:24:20 am »
Quote from: "Groogy"
Alright SFGUI compiled but one of the examples didn't work. At least for MinGW make files. It was unable to compile the desktop example and the output was:

Code: [Select]
Scanning dependencies of target Desktop
mingw32-make: Interrupt/Exception caught (code = 0xc0000005, addr = 0x004132f6)
mingw32-make[1]: *** [examples/CMakeFiles/Desktop.dir/all] Error 255
mingw32-make: *** [all] Error 2


It looks like it is a problem with your MinGW. The CMakeLists.txt shouldn't (not even in the worst case) cause MinGW to cause an access violation. Any errors in CMakeLists.txt is (hopefully) caught before the Makefile is created. I can compile it on my MinGW and CMake just fine.

CMake 2.8.3
mingw32-make (i386-pc-mingw32) 3.82
gcc 4.5.0

1367
SFML projects / SFGUI
« on: November 11, 2011, 04:39:26 pm »
Quote from: "asdatapel"
my app is using an sfgui window, and i want to be able to move it anywhere. Unfortunatly, this means that even when the gui is clicked, my program registers  it as a click, so both the gui is affected, and the thying underneath it. Is there a way to cancel out the Event is sfgui does something with it?


http://www.sfml-dev.org/forum/viewtopic.php?p=41132&highlight=#41132

1368
SFML projects / SFGUI
« on: November 11, 2011, 04:28:42 pm »
Quote from: "Groogy"

Make it work, Make it right, Make it fast is a very good mantra.


Which is how we implement new features in SFGUI too. :)

As Tank said, how it is now I'd say the computation time ratio between HandleEvent() and Expose() is probably <1/99 and both make up almost all the time the library needs. Separating event handling and rendering into 2 different threads won't help much unless you plan on passing many MANY events to the library. In that case I would seek the source of the problem elsewhere ;).

The only way you can make SFGUI less of a bottleneck is therefore by speeding up Expose(). Since I've been optimizing the performance of the library lately, I can tell you that SFGUI isn't even the culprit of the long time spent in Expose(). In fact 1 level down the calltree and you'll only find calls to SFML which is where Expose() lingers for almost all of it's time. Since SFML renders through OpenGL it also wouldn't make sense to try to optimize there. As explained nice and short here: http://www.opengl.org/wiki/OpenGL_and_multithreading if you only have 1 GPU all the calls to GL from multiple threads will end up in 1 queue anyway, thereby wasting any effort to render from different threads.

The #1 bottleneck is therefore SFML and it relies on GL calls which don't make sense to separate into multiple threads. If you want a performance increase with SFGUI I would rather talk to Laurent first than try to parallelise everything you can in SFGUI. If he can reduce the amount of GL calls per shape/text trust me, you won't have performance issues with SFGUI ever again ;).

As always I let numbers speak for themselves. Here is the top 10 list from the flat gprof profile of Test.cpp:
Code: [Select]

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total          
 time   seconds   seconds    calls  ms/call  ms/call  name
  9.08      0.82     0.82 16418394     0.00     0.00  sf::Renderer::ProcessVertex(float, float, float, float, float, float, float, float)
  9.08      1.64     0.82                             tt_cmap4_char_map_binary
  7.25      2.29     0.66   175952     0.00     0.03  sf::Text::Render(sf::RenderTarget&, sf::Renderer&) const
  6.31      2.87     0.57 16418394     0.00     0.00  sf::Matrix3::Transform(sf::Vector2<float> const&) const
  6.09      3.42     0.55                             tt_face_get_kerning
  4.87      3.85     0.44  3419834     0.00     0.00  sf::Texture::GetTexCoords(sf::Rect<int> const&) const
  4.32      4.25     0.39 32168534     0.00     0.00  std::less<unsigned int>::operator()(unsigned int const&, unsigned int const&) const
  3.88      4.59     0.35  3421964     0.00     0.00  std::_Rb_tree(std::_Rb_tree_node<std::pair<unsigned int const, sf::Glyph> >*, std::_Rb_tree_node<std::pair<unsigned int const, sf::Glyph> >*, unsigned int const&)
  3.88      4.95     0.35  3417478     0.00     0.00  sf::Renderer::AddVertex(float, float, sf::Color const&)
  2.77      5.20     0.25 32967353     0.00     0.00  sf::Vector2<float>::Vector2(float, float)


The first SFGUI call ( Expose() ) comes at position 25:
Code: [Select]

0.72      7.03     0.07   374017     0.00     0.02  sfg::Widget::Expose(sf::RenderTarget&)

1369
SFML projects / SFGUI
« on: November 10, 2011, 11:19:09 am »
Quote from: "Laurent"
Quote
binary1248 nearly completed the CSS parser with the help of the Embedded LL library. It's a header-only library that gets shipped with SFGUI

I was wondering what limitations a LGPL header-only library imposes. I found an answer in the FAQ of the Eigen library: basically, in this particular case, the "complicated" conditions of the LGPL don't apply and it's equivalent to the BSD license. They said it was confirmed by the FSF, so the information can be considered reliable.
Just in case someone else would wonder ;)


Would be kind of lame if after all the effort I realize that SFGUI can't make use of ell don't you think? I did my research early enough :P Nice of you to take care of the (possibly) worrying users though ^^.

1370
SFML projects / SFGUI
« on: November 09, 2011, 12:37:30 am »
Quote from: "asdatapel"

but he just said hes using windows in the screenshot...


He meant he was using normal SFGUI windows and not the operating system Windows. Trust me there must be a really really special reason for him to even boot into Windows (OS) to do anything.

1371
SFML projects / SFGUI
« on: November 08, 2011, 08:07:31 pm »
Quote from: "asdatapel"
Quote from: "Tank"

Yes, I am using windows in the screenshot. It's the default theme of BREW (Basic Rendering Engine for Widgets), which utilizes shapes only.
;)

no I meant the Windows window theme


lol no.. he is using Linux in the screenshot.

1372
SFML projects / SFGUI
« on: November 07, 2011, 01:23:30 am »
Quote from: "OniLink10"
I would enjoy seeing a notebook widget and a dropdown choice widget.


This was also planned a while ago.

To see what we have planned for the future you can visit: https://github.com/TankOs/SFGUI/wiki/TODO-List

Be sure to check out the SFGUI forum too.  We'd like to see how you use the library and might just get inspired to add a widget which would fit your requirements better.

1373
SFML projects / SFGUI
« on: November 06, 2011, 10:23:01 pm »
Quote from: "asdatapel"

LOL no I tried rendering it with exposed and even changed the windoe.Clear() color, but id jusst stays black. It works properly in Release however


Can you post a minimal code sample that exhibits this behavior? It would help us greatly in fixing the bug you described (if it is a bug).

Quote from: "asdatapel"
Also, is there a checkbox or a dropdown box widget?


Coming soon.

1374
SFML projects / SFGUI
« on: November 06, 2011, 07:44:06 pm »
Quote from: "asdatapel"

First I tried everything with a window, but i got the black screen so started commenting out lines of code. Even when I have nothing besides the Create() function the screen stays black. I dont even try to render.


If you don't render anything, it is expected that the screen stays black. When you call sf::Window::Clear() it clears the screen to the background color (Black by default). Merely Create()ing a button or any widget for that matter will not result in you seeing it on screen. You have to render it to the screen to see it.

SFML renders everything in immediate mode meaning that if you don't explicitly render an object you have created every frame you won't see it. Because SFGUI builds on SFML it too renders everything in immediate mode meaning that you have to call Expose() yourself every frame to render any widget to the screen.

You may think that SFGUI retains a list of Widgets that you created and renders them automatically every frame, but this is not the case.

If you don't render anything yourself, you also won't see anything.

1375
SFML projects / SFGUI
« on: November 06, 2011, 02:13:27 am »
Quote from: "asdatapel"
So what about the black screen with a button in debug mode?


Could you describe your problem a bit more? You said all you did was Create() a button. How did you render it? Did you try to render it directly to the screen?

You can try to add it to a window after getting a fresh copy of master and making the changes I described in the last post. Remember to always run CMake again and do a complete rebuild of the library every time you get a new version. Try to render the window then and see if that will work. Maybe you could provide a working (as in compilable) minimal code example where you get a black screen. From your description it doesn't seem to be too complex.

1376
SFML projects / SFGUI
« on: November 06, 2011, 12:44:18 am »
Quote from: "asdatapel"
Now adding the button the window works, but the
Code: [Select]

Button->OnClick.Connect(&function)

gives me a
Code: [Select]

undefined reference to `sfg::Signal::Connect(sfg::Delegate)


Yeah this has been reported already and a patch has been submitted for Tank to ratify and pull into master. If you can't wait:

You have to add:

Code: [Select]

...
#include <SFGUI/Config.hpp>
...
class SFGUI_API Signal {
...


... to include/SFGUI/Signal.hpp

Quote from: "keyforge"
Oh, ok! I was using SFML as a static lib but linked the dynamic libs.

I'm so stupid sometimes  :oops:

But when running the examples, they don't work. I get an 'an internal opengl call failed.' error for each of them.


Wow, that is the first time I've seen an OpenGL error being generated when running SFGUI. Unfortunately I can't help any further there. What you could do however is run the examples in debug mode and step through each line of the code. As soon as you see that message on the console make note of the line/function that is currently being executed and report back here. I'll be able to help then.

1377
SFML projects / SFGUI
« on: November 05, 2011, 08:05:47 pm »
Quote from: "asdatapel"
Ive run into a problem. I cant add anything into a window becuase it gives an error
Code: [Select]
undefined reference to `_imp___ZN3sfg9Container3AddEN5boost10shared_ptrINS_6WidgetEEE'|
Also, I tried to do a button by itself but there are problems with that to. When I create a button and run in debug mode, all i get is a black screen, even if all i do is Create() it.


Try compiling the latest master from Git.

Quote from: "keyforge"
I get an error unresolved external symbol public static class sf::Color const sf::Color::Black in Brew.obj


Try checking whether SFML_STATIC is selected in CMake or not. If you compiled SFML as a static library it must be checked. If not then it must not be checked.

1378
SFML projects / SFGUI
« on: November 05, 2011, 02:18:46 am »
Quote from: "Naufr4g0"

Ok with your suggestions I solved build files generation issue! :D
Anyway when I build the solution under VS2010 I get 8 MSB3073 errors in the file:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets
:(

Update: the issue was only examples-related (maybe). Nevertheless I obtained lib files :)


This should be fixed in a patch applied as soon as Tank comes around. Thanks for reporting it.

Quote from: "Naufr4g0"
I have another events handler in my project, executed after sfgui-related handler.
How can I prevent the canvas.HandleEvents() method is called when a sfgui event occurs?


If I understand you correctly, you want to prevent the event from being handled by your canvas if SFGUI made use of it, i.e. it resulted in something happening with the GUI. Because the recommended way of using SFGUI is by containing all widgets within a root widget (mostly a window or box) and sending that widget all SFML events, all you have to do is Connect() the signals you are interested in and set a flag to prevent sending the currently processed event on to your canvas when SFGUI signals that it did something.

Code: [Select]

   bool block_event = false;

   ...

   m_wndmain->OnMouseButtonPress.Connect( &SFGUIConsume );

   ... more Signal types here ...

   while( window.IsOpened() ) {

while( window.PollEvent( event ) ) {
// sfgui events
m_wndmain->HandleEvent( event );
// sfml window events
if( event.Type == sf::Event::Closed ) window.Close();
// canvas events
if( !block_event ) {
canvas.HandleEvents(event);
}
block_event = false;
}

window.Clear( sf::Color::Black );
window.Draw( text );
canvas.Draw(window);
m_wndmain->Expose( window );
window.Display();
   }

   ...

   void SFGUIConsume() {
    block_event = true;
   }


Hope I understood you correctly and was able to help.

1379
SFML projects / SFGUI
« on: November 04, 2011, 10:39:19 pm »
Quote from: "victorlevasseur"
It was just an example, it's useless.

What do you mind by "remove hook" ? Is this linked to the fact that I had to manage manually widgets' focus (in the previous version of SFGUI donwloaded before this update) because I don't use container ?


Hooking was a mechanism used internally to make sure some widgets got high priority access to certain events. It bypassed most of the hierarchical event passing and was therefore removed to clean up the library a bit.

In principle all widgets were designed to be used within some sort of container be it a window or box etc. Adding your widgets to your application one by one without use of a root container isn't recommended because as you mentioned focus changing won't get handled properly, among other things. Please try to use windows as much as you can or if you don't want a window then a box as the root widget.

Quote from: "Naufr4g0"
Wow an update! :D
I can configure e generate build files, but I obtain some annoying warnings, that don't allow me to build the library (with a lot of errors)

Code: [Select]

WARNING: Target "Box" requests linking to directory "C:/sfml/sfml2".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "Button" requests linking to directory "C:/sfml/sfml2".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "Entry" requests linking to directory "C:/sfml/sfml2".  Targets may link only to libraries.  CMake is dropping the item.
...


It seems like you set your SFML library file paths wrong. Instead of "C:/sfml/sfml2" you should set it to something like "C:/sfml/sfml2/lib/libsfml-window-s.a" for example (if you are using GCC). Note that it is a FILE PATH and not a DIRECTORY PATH. You have to give CMake the right path for each of the library files it needs. Hope this helps.

1380
SFML projects / SFGUI
« on: November 04, 2011, 08:03:58 pm »
Quote from: "victorlevasseur"
Cool update. :)
But now, how can we receive the oldstate in the signal stateChanged, or the mouse position in the mouseClick signal ?


Well when you receive an OnClick signal you can query SFML for the mouse coordinates yourself. Or am I misunderstanding something? Using SFGUI doesn't prohibit you from using SFML as usual. And regarding state change.. may I ask why you need the old state?

Quote from: "asdatapel"
so ive been looking at the examples. It looks like everything requires a window. Is it possible to do without?


Just replace your window by the widget you want to use and send it the events and and draw it every frame. You have to do that with every widget and you won't have to use a window.

Pages: 1 ... 90 91 [92] 93
anything