Gamestudio Links
Zorro Links
Newest Posts
Script Test gives error 055 - No History
by AndrewAMD. 03/31/20 16:19
IB CASH FX commission
by fab. 03/31/20 15:23
Performance report - external trades
by hast29. 03/31/20 13:42
Random Functions?
by Emre. 03/31/20 12:32
downloading data from Quandl
by gtell. 03/31/20 10:45
textureLod into HLSL
by 3run. 03/31/20 10:21
Alice1a look back
by hola123. 03/31/20 06:20
Loging off automatically ?
by old_bill. 03/30/20 22:07
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
10 registered members (alibaba, Quad, MatPed, 3run, AndrewAMD, txesmi, buttcorgi, Leohermoso, 2 invisible), 674 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
gonzalez21, Cobus, HF_Psy, jj02520024, heitorfr
18409 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
Imgui Lite-c Development #478265
09/26/19 19:43
09/26/19 19:43
Joined: Feb 2013
Posts: 105
Maysville, Ga
Evo Offline OP
Member
Evo  Offline OP
Member

Joined: Feb 2013
Posts: 105
Maysville, Ga
I had some free time this week to casually go through the imgui integration that was contributed.
Special thanks to Patrick Jendral (JenGs) for releasing his work.
Thanks to Emre for the List Box and Combo Box Code (Included in the template)

The original imgui/lite-c contribution can be found at https://github.com/pjen/imgui-Lite-C-integration
Txesmi's File Browser Expansion : https://github.com/txesmi/imgui-Lite-C-integration

-----------------------

Over the last couple of days, I put together a full template that includes all the current imgui methods. (Except for around 7 that I couldn't get working correctly.)
All primary features have been added. The custom template can be downloaded from the link below.
Custom Imgui Template : https://evoeon.one/freeDownloads/imgui_litec_template.zip

Custom Template Includes :
* Template source code
* 4 Plug and Play Icon Kits for images and buttons. (Includes Font Awesome PNG Image Collection and 3 Magicon PNG Icon Kits)
* Custom Imgui Window "Style Script" to customize and create your own theme. (style.h)
* Also includes some custom examples (Text Editor Example, Multi-Feature Data Menu Window, Secure HTTPS/FTPS Connections, Imgui Draw Examples)

When JenGs updates his imgui integration again, I'll update the template with any new features that may be added.

Feel free to point out anything that needs to be changed or if something needs to be defined in a certain way.
For anyone that may want to help with the few missing features I couldn't add, then look below for the list of methods that I'm unsure about.
Code
//Set Groups
void imgui_begin_group();
void imgui_end_group();

//Mouse Dragging
var imgui_is_mouse_dragging(int btn, var lock_threshold);
VECTOR* imgui_get_io_mouse_delta();

//Drawlist Channels
void imgui_drawlist_channel_split(void *draw_list, int channels_count);
void imgui_drawlist_channel_set_current(void *draw_list, int channel_index);
void imgui_Drawlist_channel_merge(void *draw_list);


Another feature I can't get working is the actual menu bar that will appear at the top of a window when the flag "ImGuiWindowFlags_MenuBar" is applied. But I believe it needs menu bar BEGIN/END commands and hasn't been integrated yet.

If you have any questions or have a working solution for the method list above, post them here at this thread.
Here are some screenshots. I hope the template can help others that may be wanting to use imgui in their projects.

[Linked Image]

[Linked Image]

[Linked Image]


Last edited by Evo; 03/25/20 16:51.
Re: Imgui Lite-c Development [Re: Evo] #478267
09/26/19 21:44
09/26/19 21:44
Joined: Jul 2007
Posts: 550
Turkey, izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 550
Turkey, izmir
Good work! Your style script is wonderful!

i'm also add some features to dll; like fonts, tabs, digits, built in stylecolor. i'll send it to JenGs, when all functions are ready. So you guys update it from github.
[Linked Image]

btw: i discovered that we can use "imgui_slider_var" for engine variables directly. e.g:

Code
imgui_slider_var("##Rotation", &mdl_example->pan, set_ent_pan_min, set_ent_pan_max);

Re: Imgui Lite-c Development [Re: Evo] #478269
09/26/19 22:09
09/26/19 22:09
Joined: Jun 2007
Posts: 1,305
Hiporope and its pain
txesmi Online
Serious User
txesmi  Online
Serious User

Joined: Jun 2007
Posts: 1,305
Hiporope and its pain
Thank you very much to all!

Re: Imgui Lite-c Development [Re: Emre] #478270
09/26/19 22:22
09/26/19 22:22
Joined: Feb 2013
Posts: 105
Maysville, Ga
Evo Offline OP
Member
Evo  Offline OP
Member

Joined: Feb 2013
Posts: 105
Maysville, Ga
Thanks Emre. Once I know the dll has been updated with some new features, I'll update the template.

Re: Imgui Lite-c Development [Re: Evo] #478272
09/27/19 07:27
09/27/19 07:27
Joined: Jul 2010
Posts: 281
Germany
J
jenGs Offline
Member
jenGs  Offline
Member
J

Joined: Jul 2010
Posts: 281
Germany
I went through most of the demo (official imgui demo) and converted a lot of the code to lite_c. I made a lot of improvements to my DLL (structure) and added a lot of features. If you wait until this weekend, I will update the DLL.

Re: Imgui Lite-c Development [Re: jenGs] #478273
09/27/19 07:29
09/27/19 07:29
Joined: Jul 2010
Posts: 281
Germany
J
jenGs Offline
Member
jenGs  Offline
Member
J

Joined: Jul 2010
Posts: 281
Germany
@Emre I welcome the tabs and font addition, because they are indeed still missing

Re: Imgui Lite-c Development [Re: jenGs] #478274
09/27/19 08:24
09/27/19 08:24
Joined: Jul 2007
Posts: 550
Turkey, izmir
Emre Offline
User
Emre  Offline
User

Joined: Jul 2007
Posts: 550
Turkey, izmir
Originally Posted by jenGs
I went through most of the demo (official imgui demo) and converted a lot of the code to lite_c. I made a lot of improvements to my DLL (structure) and added a lot of features. If you wait until this weekend, I will update the DLL.

Great news!

Originally Posted by jenGs
@Emre I welcome the tabs and font addition, because they are indeed still missing


Tabs are here:

SDK
Code
DLLFUNC var  imgui_begintabbar(char* str_id, long flags)
{
	bool res = ImGui::BeginTabBar(str_id, flags);
	return res ? _VAR(1) : _VAR(0);

}

DLLFUNC void imgui_endtabbar()
{
	ImGui::EndTabBar();
}
DLLFUNC var imgui_begintabitem(char* label,void* state,long flags)
{
	bool* dirty = (bool*)state;
	bool res = ImGui::BeginTabItem(label, dirty,flags);
	return res ? _VAR(1) : _VAR(0);
	
}

DLLFUNC void imgui_endtabitem()
{
	
	ImGui::EndTabItem(); 
}

Lite-c

Code
var  imgui_begintabbar(char* str_id, long flags);
void imgui_endtabbar();
var imgui_begintabitem(char* label,void* state,long flags);
void imgui_endtabitem();


Example:

Code
void window_func()
{
	
	imgui_set_next_window_pos(1, 50, ImGuiCond_Once);
	imgui_set_next_window_size(400, 400, ImGuiCond_Once);


	if(imgui_begin("Window1", NULL, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove ))
	{
		if(imgui_begintabbar("Tabs",ImGuiTabBarFlags_None))
		{
			if(imgui_begintabitem("Tab 1",0,0))
			{
				imgui_text("Tab 1 Text");
				imgui_endtabitem();
			}
				
			if(imgui_begintabitem("TAB 2",0,0))
			{
				
				imgui_text("Tab 2 Text");
				imgui_endtabitem();
			}
			
			imgui_endtabbar();
			
		}
		
		imgui_end();
	}
	
}



There is an issue about my font method. I'm storing the imgui fonts(ImFont*) in the acknex font(FONT*). i don't know if it may be cause a problem. (Right now it works without problem.) I sent a message to Superku for help/guide. I'm waiting for response. After that, i'll sharet it too.

Re: Imgui Lite-c Development [Re: Evo] #478276
09/27/19 10:40
09/27/19 10:40
Joined: Feb 2003
Posts: 134
RP China
2
20BN Offline
Member
20BN  Offline
Member
2

Joined: Feb 2003
Posts: 134
RP China
@jenGs @Emre @EVO

THANKS ALL!

Can't support Asian languages at present, can you update dll?

Re: Imgui Lite-c Development [Re: 20BN] #478277
09/27/19 11:13
09/27/19 11:13
Joined: Jul 2010
Posts: 281
Germany
J
jenGs Offline
Member
jenGs  Offline
Member
J

Joined: Jul 2010
Posts: 281
Germany
@20BN Imgui can display unicode, but the problem is Lite-C. I don't know what _chr(STRING) gives back with an unicode STRING. Can't promise anything, but I will look into it. I think I have to decode the characters, because ImGui uses normal char* not wchars to display unicode (If i am not mistaken)

Re: Imgui Lite-c Development [Re: Evo] #478281
09/27/19 14:55
09/27/19 14:55
Joined: Feb 2013
Posts: 105
Maysville, Ga
Evo Offline OP
Member
Evo  Offline OP
Member

Joined: Feb 2013
Posts: 105
Maysville, Ga
@jenGs : Thank you for taking the time to update your dll. I look forward to adding some new features and custom ideas to the imgui template.

@Emre : Thanks for helping get some of these features integrated.

* I was curious about custom window background styling. Windows are separate from lite-c layers and panels can't be layered between windows. The old lbgui had structs set up and BMAP images were used for window BG creation/styling.

Q. Is there a draw_list method for images? (imgui_drawlist_add_image(x,y,size,bmap,etc)). Drawlist commands can render into windows and that would allow me to create a custom feature for adding image backgrounds that are layered behind elements within a transparent window BG (Using the get methods to obtain window xy,size, custom bgs can be drawn for any window). This would let developers match the style of their in-game gui and to use imgui for actual in-game menus. Seamlessly integrating its visual with gui thats already been created for their projects. A drawlist method for images should be all that's needed for me to create the feature.

Page 1 of 4 1 2 3 4

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1