PDA

View Full Version : Looking for simple GUI library/framework



Cybermonkey
13-07-2014, 10:36 AM
Has anyone of you made a simple GUI library or can direct to one? It should be made up of graphics primitives like lines, circles, filled circles, filled rectangles etc. so I could adapt it easily.

dj_sharp
13-07-2014, 12:31 PM
AggPas is basically a 2D software render which can draw primitives and textures
https://github.com/graemeg/fpGUI/tree/master/src/corelib/render/software

Cybermonkey
13-07-2014, 02:12 PM
Sorry, I think I wasn't clear: I need a GUI library. I have the possibilities to draw primitives. I am looking for something like this: http://members.chello.nl/w.boeke/SDL-widgets/ but of course in Object Pascal (for SDL2) and not in C/C++. (But it needn't to be for SDL2; something "old" for unit graph will also do.)

dj_sharp
13-07-2014, 02:28 PM
I think I understand what u desire
http://zengl.org/forum/index.php/topic,358.0.html : the description is in Russian, but it shouldn't get in the way, just download and unpack the thing
This is a very basic-simple-primitive GUI for ZenGL graphics engine, and you should be able to port it to your graphics engine easily

Actually take a look at this: http://zengl-gui.googlecode.com/svn/trunk/src/zglGui.pas

Cybermonkey
13-07-2014, 05:10 PM
Yes, thanks. But it also uses textures/images for the GUI part. I am still looking for something simpler. Something I started but it will take too long to finish (see attached screenhot).
1307

Carver413
13-07-2014, 06:33 PM
Yes, thanks. But it also uses textures/images for the GUI part. I am still looking for something simpler. Something I started but it will take too long to finish (see attached screenhot). 1307 I can't see where that will look good in a game. with the explore I draw to textures and display them with opengl. the actual drawing is handled with scripts so the look can be changed easily to fit the game

Cybermonkey
14-07-2014, 04:06 PM
That's probably true but it's fair enough for a retro style game.

SilverWarior
15-07-2014, 06:58 AM
Yes, thanks. But it also uses textures/images for the GUI part. I am still looking for something simpler. Something I started but it will take too long to finish (see attached screenhot).

Care to share what you have so far? The code I mean.
If you have started working on this in the right way I think there shouldn't be much problems in finishing your work. Writing the core part is the most difficlut part.
Now I'm willing to offer you a helping hand in this since I have played a bit in this area with designing of my Silver GUI library.
Unfortunately the current state of my Silver GUI library is not usable due to funfinished design and several bugs that can make it pretty unstable in certain scenarios. I have to do another rewrite of the core to avoid most of the current problems and also add ability to exted it with some new fetures that I want to add.

Cybermonkey
15-07-2014, 06:33 PM
Hm, it's a real ugly hack I did and not object oriented at all. Something I have so far is a type for a button like this:

type TButton= record
x,y,width,height:integer;
caption:string;
id:integer;
clicked:boolean;
end;

I create a button the following way:

button :=createbutton (500,400,'QUIT');

Then I have to take care of the event loop (in a REPEAT...UNTIL loop):

if mouseonbutton (button) then begin
drawbuttonpressed (button);
button.clicked:=true;
end else begin
drawbutton (button);
end;

if button.clicked=true then begin
buttononlick();
button.clicked:=false;
end;


I know it's a rather ancient way to do so but for that kind of retro GUI sufficient enough (IMHO). The function mouseonbutton means that the mouse cursor is on the button and the left mouse button is pressed ...
New version with text input:
1309

paul_nicholls
16-07-2014, 01:06 AM
Not sure if it is of help:
http://opensoft.homeip.net/fpgui/
http://www.sulaco.co.za/opengl_project_glWindows.htm

cheers,
Paul

Ñuño Martínez
04-08-2014, 08:19 PM
I'm rewriting the GUI system for Allegro.pas. It will be much like you're asking for, but still in an early stage. :(

Cybermonkey
09-08-2014, 10:36 AM
I'm rewriting the GUI system for Allegro.pas. It will be much like you're asking for, but still in an early stage. :(

So, I have to wait ... is it part of the SVN branch?

Mirage
09-08-2014, 10:10 PM
Has anyone of you made a simple GUI library or can direct to one? It should be made up of graphics primitives like lines, circles, filled circles, filled rectangles etc. so I could adapt it easily.

I made such library for my engine, but it's not depend on the engine:
https://github.com/casteng/base/tree/dev/ACS
It works through an implementation of TScreen abstract class declared in BaseGraph unit.
The implementation should be able to draw graphic primitives and render text.

It also uses object-oriented (class based) message system instead of windows-like events.
The message system is mostly in this unit:
https://github.com/casteng/base/blob/dev/BaseMsg.pas

Ñuño Martínez
27-08-2014, 05:16 PM
So, I have to wait ... is it part of the SVN branch? No, it isn't. To be part of the SVN branch should force me to use very low-level stuff from Allegro that I'm not sure I can use from Pascal. Actually some Allegro stuff doesn't work 100% in Pascal.

This GUI will be Allegro only. Now I'm working on version 4, but I'll port to version 5 later.