Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFGUI (0.4.0 released)  (Read 350311 times)

0 Members and 1 Guest are viewing this topic.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
SFGUI
« Reply #90 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.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

asdatapel

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
SFGUI
« Reply #91 on: November 05, 2011, 08:08:27 pm »
Alright I did that, but the black screens still there

asdatapel

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
SFGUI
« Reply #92 on: November 05, 2011, 09:20:52 pm »
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)

keyforge

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
SFGUI
« Reply #93 on: November 05, 2011, 10:28:10 pm »
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.
Need a place to upload your code, files or screenshots? Use SFML Uploads!

keyforge

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
SFGUI
« Reply #94 on: November 05, 2011, 10:40:02 pm »
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)


Same here, got the exact same error.
Need a place to upload your code, files or screenshots? Use SFML Uploads!

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
SFGUI
« Reply #95 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.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

asdatapel

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
SFGUI
« Reply #96 on: November 06, 2011, 01:11:29 am »
So what about the black screen with a button in debug mode?

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
SFGUI
« Reply #97 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.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
SFGUI
« Reply #98 on: November 06, 2011, 02:32:40 am »
Patches for MSVC problems have been applied to master, thanks to Sven for them.

Guys, please visit http://sfgui.sfml-dev.de/forum/ for SFGUI support/Q&A. It's better to not annoy SFML's userbase with SFGUI-related issues/support/whatever. .)

asdatapel

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
SFGUI
« Reply #99 on: November 06, 2011, 06:50:57 pm »
Quote from: "binary1248"

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?

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.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
SFGUI
« Reply #100 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.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

asdatapel

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
SFGUI
« Reply #101 on: November 06, 2011, 08:20:37 pm »
Quote from: "binary1248"
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.

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

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
SFGUI
« Reply #102 on: November 06, 2011, 10:04:27 pm »
Boost has been removed finally? Yay, I'm hopping on board with this project!
I use the latest build of SFML2

asdatapel

  • Jr. Member
  • **
  • Posts: 76
    • View Profile
SFGUI
« Reply #103 on: November 06, 2011, 10:15:54 pm »
Also, is there a checkbox or a dropdown box widget?

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
SFGUI
« Reply #104 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.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).