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

Author Topic: cpGUI - A new object oriented GUI toolkit based on SFML 1.5  (Read 54662 times)

0 Members and 1 Guest are viewing this topic.

forrestcupp

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #45 on: September 29, 2009, 09:55:07 pm »
**Another Update**

I'm sorry for updating so soon, but I think this one will be worth it.  I found out about a few things that needed to be addressed after I had already released the new version the other day.

cpGUI version 1.5.6 includes a tweak to the CheckState() function.  This tweak was pointed out by Meltra Bour.  Since CheckState is called every frame, this could hopefully give some considerable speed boosts.

I've also included a few minor bug fixes.

But one of the most exciting additions is that cpGUI now has a static library.  The download now includes structured directories for the includes, libs, source (the cpp files), and samples.  You can unzip the folder wherever you want and set up your IDE to statically link to cpGUI's libs.  This is done the same way as described in SFML's "Getting Started" tutorials.  You should use the -d.lib files for debug mode.

The cpp files are still included in the "source" directory if you would like to just do things the old way and include the files in your project.

phear-

  • Jr. Member
  • **
  • Posts: 64
    • MSN Messenger - LOApokalypse@hotmail.com
    • View Profile
    • http://gtproductions.org
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #46 on: September 29, 2009, 10:34:00 pm »
Mirror again:
http://gtproductions.org/sfml/cpGUI_15_6.zip

Thanks for having a static library this time around.
Eugene Alfonso
GTP | Twitter

forrestcupp

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #47 on: September 30, 2009, 03:05:32 am »
Thanks for the mirror.  I'll try to get it on the wiki tomorrow.

I actually just now changed my own link to a direct download, so there should be less complaints now.

madmark

  • Newbie
  • *
  • Posts: 3
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #48 on: October 03, 2009, 02:16:34 am »
Love this and I already have it in my current project.

2 suggestions:

I added the Draw() method to the cpObject class (empty function, virtual) so that I could put all my controls in a std::list and draw then in a loop.

I need an image button that has 4 states (normal, mouseover,pressed, disabled). I have this already done, but outside the cpGUI system. If there is interest I will move it into the namespace and hook it up.

forrestcupp

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #49 on: October 06, 2009, 09:12:13 pm »
Quote from: "madmark"
Love this and I already have it in my current project.

2 suggestions:

I added the Draw() method to the cpObject class (empty function, virtual) so that I could put all my controls in a std::list and draw then in a loop.

I need an image button that has 4 states (normal, mouseover,pressed, disabled). I have this already done, but outside the cpGUI system. If there is interest I will move it into the namespace and hook it up.

I'm glad it's working out for you.

Those are pretty good and interesting suggestions.  It might be good to have a disabled option for all types of controls where they are still shown, but grayed out and not usable.  I'll keep these things in mind, but I'm not sure when I'll be ready to have another release.

coolhome

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #50 on: October 07, 2009, 04:35:48 am »
Very nice. I was making a GUI class for my own little collection of tools for my games. Although im reworking the core of my own little engine. Keep up the good work.
CoderZilla - Everything Programming

BobTheFish

  • Newbie
  • *
  • Posts: 17
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #51 on: November 26, 2009, 02:11:23 pm »
I like this GUI class and I can compile and run the example (cpGUI-example).

When the program closes (for example when I click the close box or one of the buttons) it throws an unhandled access read violation.
I've tried the 1.5 release and the latest snapshot with the same result.

Debug takes me to line 769 of Image.cpp, which says:
Code: [Select]
GLCheck(glDeleteTextures(1, &Texture));

I'm surprised I couldn't find this problem mentioned anywhere else since I'm running the unmodified example...

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #52 on: November 26, 2009, 07:41:51 pm »
I appreaciate your work, but don't you find that one lib per gui component is too much? It would be better and faster just to have one lib for all!

BobTheFish

  • Newbie
  • *
  • Posts: 17
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #53 on: November 26, 2009, 11:39:27 pm »
I forgot to say that I'm using WinXP, Visual-C++ 2008 Express, and the dynamic SFML.

Another question about cpGUI: is there a built in file select dialog? If not, read on.

I'm thinking I could implement a simple one using a listbox, but I don't know how to do file operations in a cross-platform way. For example I could use system("dir") to get the contents of a directory, but this approach is valid only for Windows systems.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #54 on: November 27, 2009, 02:37:50 pm »
Quote from: "BobTheFish"
but I don't know how to do file operations in a cross-platform way.
I recommend Boost.Filesystem. But you need the Boost C++ Libraries (which isn't a bad choice, anyway).
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

BobTheFish

  • Newbie
  • *
  • Posts: 17
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #55 on: November 27, 2009, 04:29:51 pm »
Ok, thanks.

More important at the moment is that access violation; I can't really have a program that crashes every time it exits. And I'd really like to use cpGUI, so I need to figure out how to fix it.

Any suggestions?

caro1302

  • Newbie
  • *
  • Posts: 2
    • View Profile
Question
« Reply #56 on: November 28, 2009, 04:19:34 am »
Hi,

I have a question about your project.

I'm trying to use your project with a SFML project I am creating.
I am using Visual Studio 2008.

I am a beginner and I'm not pretty sure where and which informations I am supposed to put for links. I tried to put in Linker/Input with SFML libs

in Release mode: cpGUI.lib
in Debug mode: cpGUI-d.lib

I also put in Options/Project and Solutions/VC++ Directories in Include Files the path to the cpGUI\include folder.

And include "#include <cpGUI.h>" in main file.

I'm not sure where I am supposed to put the cpGUI folder. Is it in the same directory as my solution, is it in the folder where I have my .cpp and .h files or is it somewhere in the SFML-1.5 folder?

I got the following errors in Debug mode that looks like this:
Error   61   error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::String & __thiscall sf::String::operator=(class sf::String const &)" (__imp_??4String@sf@@QAEAAV01@ABV01@@Z) referenced in function "public: virtual void __thiscall cp::cpObject::SetFontSize(unsigned int)" (?SetFontSize@cpObject@cp@@UAEXI@Z)   cpGUI-d.lib


There is somebody to help me with this basic problems?
Thanks!

Sorry for my english! :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #57 on: November 28, 2009, 10:09:09 am »
Please don't duplicate questions, as it duplicates answers too.

For those who want to answer, please do it there:
http://www.sfml-dev.org/forum/viewtopic.php?p=12248#12248
Laurent Gomila - SFML developer

BobTheFish

  • Newbie
  • *
  • Posts: 17
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #58 on: November 29, 2009, 11:21:03 am »
In case anyone else has the same problem as me:

I suspect it was being caused by the notorious default font bug. Since there's no way to avoid the default font being loaded by cpGUI I'd assumed the author(s) would have accounted for it.

The only other way to avoid the crash as far as I know is to use static linking, so I did that.[/i]

forrestcupp

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
cpGUI - A new object oriented GUI toolkit based on SFML 1.5
« Reply #59 on: December 04, 2009, 12:05:49 am »
Quote from: "BobTheFish"
In case anyone else has the same problem as me:

I suspect it was being caused by the notorious default font bug. Since there's no way to avoid the default font being loaded by cpGUI I'd assumed the author(s) would have accounted for it.

The only other way to avoid the crash as far as I know is to use static linking, so I did that.[/i]
Sorry for taking so long to answer.  I haven't been able to reproduce your problem.

I can tell you that cpGUI is not made for dynamic linking.  It's only made for either static linking or actually integrating the code into your project.  You can static link to cpGUI at the same time you're dynamically linking to SFML.

I'm glad it worked when you did that.


Quote from: "panithadrum"
I appreaciate your work, but don't you find that one lib per gui component is too much? It would be better and faster just to have one lib for all!
Reread the wiki.  If you only link to cpGUI.lib and include cpGUI.h, it includes everything in one file.  

I also made each control available in their own lib as an alternative because people who wanted to pick and choose controls asked me to do that to cut down on bloat.  So you can have it either way; you don't have to use all those libs.