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

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

0 Members and 6 Guests are viewing this topic.

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFGUI (0.1.0 released)
« Reply #435 on: April 24, 2013, 02:00:54 am »
The question is: do you really need to draw to a RenderTexture? I assume you draw the minimap based on data that is available to you already in the game state somewhere. Why don't you just draw to an sf::Image directly instead of streaming to the GPU and reading the data back, only to send it back to the GPU again? As long as you manipulate the minimap data in your main memory and transfer once per frame it should stay relatively fast. If you want to do some sort of compositing, this can also be done in RAM. Maybe I underestimate what your minimap looks like ::).

But... if you are brave enough, you can use the super brand new undocumented feature of SFGUI called GLCanvas. It basically gives you a drawing surface encapsulated in a Widget where you can do all sorts of SFML or even raw OpenGL drawing, at 0 overhead. Like I said, it is undocumented (a.k.a there is no example yet :P) but with the help of the doxygen pages and the code in Test.cpp you should figure it out in no time.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Kojay

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: SFGUI (0.1.0 released)
« Reply #436 on: April 24, 2013, 09:00:09 pm »
Hi, I downloaded the 0.1.0 release for VS2010 and SFML system.lib files seem to be missing - not a huge issue but detracts from the convenience of the package a bit.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI (0.1.0 released)
« Reply #437 on: April 24, 2013, 09:06:34 pm »
Back to C++ gamedev with SFML in May 2023

Kojay

  • Full Member
  • ***
  • Posts: 104
    • View Profile
Re: SFGUI (0.1.0 released)
« Reply #438 on: April 24, 2013, 11:04:15 pm »
Ah my bad. Anyhow, I wanted to try GLCanvas to draw with SFML on it but I must admit I 'm not sure how (test.cpp uses GL commands to draw on it). Is it possible to use it in similar fashion to an sf::RenderTarget?

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFGUI (0.1.0 released)
« Reply #439 on: April 25, 2013, 01:29:13 am »
You can do everything with GLCanvas that you would do in a "normal" SFML application. Just pretend you have a normal sf::RenderWindow that is confined within the space of that widget. If you want to draw something with SFML you can do it normally. Note however that you will have to define a custom sf::View or OpenGL Viewport if you want things to be the same size as in the normal window because the projection matrix is also set to project to only that small area.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

kamui

  • Sr. Member
  • ****
  • Posts: 291
    • View Profile
Re: SFGUI (0.1.0 released)
« Reply #440 on: April 25, 2013, 10:32:10 am »
I've a big problem and I didn't find anything, but I hope it's a known issue. I have a game using sfgui and i've make a popup to  let user enter an IP address. On my computer all works fine.

When i copy the exe on the computer of my wife, I try to enter my IP address and every character i write appears twice ! And the entry also contains the two characters so it's not a display problem !

I had to recompile all my dlls and I use them (sfml + sfgui) dynamically, and i think the problem is there. I would prefer not have to make different build for my game..

Tell me it's a known issue ;D

configuration : Intel Core i3-2310M CPU @ 2.10GHz 2.10GHz
RAM : 4Go
Seven SP1 64 bit
NVIDIA GeForce GT 520M


I can send you (by MP) a client, ask me if you need and tell me when you wanna try, i will activate the web services.

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: SFGUI (0.1.0 released)
« Reply #441 on: April 25, 2013, 12:00:51 pm »
It's not a known problem, and we have never heard of it before. Can you reduce your code to a minimal example that we can compile ourselves? By minimal I mean one main() function with only the things needed to  reproduce the problem you encounter.

kamui

  • Sr. Member
  • ****
  • Posts: 291
    • View Profile
Re: SFGUI (0.1.0 released)
« Reply #442 on: April 25, 2013, 12:29:47 pm »
I have not enough time today but tonight I'll make some tests and if I'm not able to make a simple example I'll try to make a minimal code that reproduce the problem. The fact that the problem does'nt appear on every computer make the debug very difficult even for you if my minimal code doesn't reproduce the error on your computer. Sorry to not do it now I'm at work this afternoon.

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI (0.1.0 released)
« Reply #443 on: May 15, 2013, 04:10:38 pm »
How would one go about adding and rendering own new, custom widget? Engine has pure virtuals for all kind of widgets, do I just add my function there and in my widget do a dynamic_cast to see if it's my engine or not?

And I assume these things are horribly outdated:
http://redmine.boxbox.org/projects/sfgui/wiki/Widget_Interface_Design
http://redmine.boxbox.org/projects/sfgui/wiki/TODO_List

There is no expose or issensitive anymore, multi line labels and spin buttons were added already etc.
Back to C++ gamedev with SFML in May 2023

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFGUI (0.1.0 released)
« Reply #444 on: May 15, 2013, 04:38:59 pm »
The simplest way to add rendering for a widget that only YOU will use in your own project would be to hardcode it into the widget's InvalidateImpl(). The only reason why the standard widgets use engines is for modularity reasons and not everybody might be content with the looks of default BREW ;). So unless you intend on making public your widget you don't need to go through the trouble of messing with engines. In the case you do make it public, you would want to modify BREW anyway so that the widget would have a standard rendering implementation.

And yes.... that documentation is horribly outdated :P dates back to sometime last summer I think lol...
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI (0.1.0 released)
« Reply #445 on: May 15, 2013, 04:57:00 pm »
I mean without recompiling SFG(or did you mean modifying BREW without recompile, if yes, then how), I would inherit BREW and add my own method which would use renderers Create methods like BREW now does and then dynamic_cast in my widget and throw curses exceptions if the running engine wasn't mine or inherited from it.
Back to C++ gamedev with SFML in May 2023

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFGUI (0.1.0 released)
« Reply #446 on: May 15, 2013, 05:16:50 pm »
Like I said, if you implemented your own widget, write the rendering code directly into it's InvalidateImpl(). You would compile that code with the rest of your application and wouldn't have to rebuild SFGUI. You only need to modify the SFGUI source and hence rebuild it if you intend on making changes that you want to share with others (assuming of course that you want to make your widget themeable/engine customizable in the first place).
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Oliveira

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: SFGUI (0.1.0 released)
« Reply #447 on: May 19, 2013, 02:35:59 pm »
Hi,
Just a little question about the LoadThemeFromFile method in SFGUI...
How can we create our own theme ?

Oliveira

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: SFGUI (0.1.0 released)
« Reply #448 on: May 19, 2013, 09:11:36 pm »
Check the example theme file in the example/data directory.

This could also be helpful:
http://redmine.boxbox.org/projects/sfgui/wiki/Widget_Style_Properties
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: SFGUI (0.1.0 released)
« Reply #449 on: May 19, 2013, 09:16:40 pm »
Back to C++ gamedev with SFML in May 2023