C++ How to put gif in Imgui?

Начинающий
Статус
Оффлайн
Регистрация
20 Фев 2019
Сообщения
26
Реакции[?]
3
Поинты[?]
0
could someone give me an example in code of how to implement .gif in Imgui, I was embarrassed to ask for help because I had already posted this before because I tried and I couldn't, I'm new with Imgui, I would like to ask for help from you on the forum, I tried to do it with the examples of "ocornut" but I couldn't understand it, I confess that my brain freezes when doing this LOL
 
Последнее редактирование модератором:
Легенда форума
Статус
Оффлайн
Регистрация
10 Дек 2018
Сообщения
4,219
Реакции[?]
2,184
Поинты[?]
84K
Are you joking or maybe you've been banned in Google?
1660299484175.png

upd. sorry, didn't see the last sentence
 
Последнее редактирование:
ЧВК EB_LAN
Забаненный
Статус
Оффлайн
Регистрация
26 Янв 2021
Сообщения
1,476
Реакции[?]
487
Поинты[?]
157K
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Начинающий
Статус
Оффлайн
Регистрация
20 Фев 2019
Сообщения
26
Реакции[?]
3
Поинты[?]
0
I would like an example in code because that way I won't be able to learn it's hard to know because no one is born knowing
 
Начинающий
Статус
Оффлайн
Регистрация
26 Июл 2022
Сообщения
75
Реакции[?]
24
Поинты[?]
4K
The simplest: you can try uploading several images in turn
 
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
20 Фев 2019
Сообщения
26
Реакции[?]
3
Поинты[?]
0
Well, in the cherax-menu-gtav menu there is an imgui menu with a gif that would be the animated logo of chearax137024f7fcebb1a1295adcd82d21e884.jpg
good as you can see this imgui menu with gif
and the way I want to do it
 
артём
Участник
Статус
Оффлайн
Регистрация
10 Окт 2020
Сообщения
442
Реакции[?]
417
Поинты[?]
0
Well, in the cherax-menu-gtav menu there is an imgui menu with a gif that would be the animated logo of chearax
good as you can see this imgui menu with gif
and the way I want to do it
ocornut has not yet added such a function to ImGui , and with the help of C ++ + ImGui you can’t render a gif file, you can go your own way and render a lot of pictures in a row, so that 1 frame would come out of them

this method has one fat minus - memory (RAM), it takes a lot of it for 1 good gif (depends on the size of your picture). (Around 300mb for me)

- here is showcase how i did this long time ago
 
Эксперт
Статус
Оффлайн
Регистрация
13 Сен 2020
Сообщения
1,416
Реакции[?]
716
Поинты[?]
7K
could someone give me an example in code of how to implement .gif in Imgui, I was embarrassed to ask for help because I had already posted this before because I tried and I couldn't, I'm new with Imgui, I would like to ask for help from you on the forum, I tried to do it with the examples of "ocornut" but I couldn't understand it, I confess that my brain freezes when doing this LOL
разбей гиф на кадры и рисуй хех
 
Начинающий
Статус
Оффлайн
Регистрация
20 Фев 2019
Сообщения
26
Реакции[?]
3
Поинты[?]
0
разбей гиф на кадры и рисуй хех
Sorry Buddy !
i dont know how to do it
ocornut ainda não adicionou tal função ao ImGui , e com a ajuda de C++ + ImGui você não pode renderizar um arquivo gif, você pode seguir seu próprio caminho e renderizar muitas fotos seguidas, para que 1 quadro sairia deles

este método tem uma gordura menos - memória (RAM), é preciso muito dela para 1 bom gif (depende do tamanho da sua foto). (Cerca de 300mb para mim)

- aqui está uma demonstração de como eu fiz isso há muito tempo
[/CITAR]
Very good this loader that you showed me....



I'm amazed how they make Loader's with Imgui I want to learn more about ImGui I wanted to make a Loader like this one, I wanted to know how to make a progress bar like this, right next to the Login button, does anyone have a code explained


 
Последнее редактирование:
артём
Участник
Статус
Оффлайн
Регистрация
10 Окт 2020
Сообщения
442
Реакции[?]
417
Поинты[?]
0
Sorry Buddy !
i dont know how to do it


Very good this loader that you showed me....



I'm amazed how they make Loader's with Imgui I want to learn more about ImGui I wanted to make a Loader like this one, I wanted to know how to make a progress bar like this, right next to the Login button, does anyone have a code explained



It's pretty good, but it also has a lot of bad moments. Perhaps soon I will post the source of some menu for easy study of design ImGui for beginners (maybe)
 
Пользователь
Статус
Оффлайн
Регистрация
24 Июл 2019
Сообщения
131
Реакции[?]
81
Поинты[?]
0
could someone give me an example in code of how to implement .gif in Imgui, I was embarrassed to ask for help because I had already posted this before because I tried and I couldn't, I'm new with Imgui, I would like to ask for help from you on the forum, I tried to do it with the examples of "ocornut" but I couldn't understand it, I confess that my brain freezes when doing this LOL
Probably the best way to do it is to use a single texture with all animation frames.

In my example, it looks like this:

T_Avatar_AnimatedMasterySavannah_Large.png

It's 2048 x 2048 texture, so each frame will be 512 x 512, which is not bad.

ImGui and many other rendering libraries or game engines have the ability to draw a part of an image.
The part is defined by UV. You can think of it as a normalized 2D Vector(ImVec2 in your case) values of which
vary from 0 to 1 and basically mean size of current texture in percents.

Thus, by using UV as an argument in your DrawImage call you need only 1 texture
to draw your animation, that's a hundred times better than importing every single frame.

In code, it looks very compact.
Пожалуйста, авторизуйтесь для просмотра ссылки.
, but I'm not using ImGui, I hope you're clever enough to adapt it to ImGui on your own.
(You can use
Пожалуйста, авторизуйтесь для просмотра ссылки.
to have a clue how this works in ImGui. Almost no differences)

1660605986806.png

The final result looks like this:

 
Последнее редактирование:
Начинающий
Статус
Оффлайн
Регистрация
20 Фев 2019
Сообщения
26
Реакции[?]
3
Поинты[?]
0
Probably the best way to do it is to use a single texture with all animation frames.

In my example, it looks like this:

Посмотреть вложение 217092

It's 2048 x 2048 texture, so each frame will be 512 x 512, which is not bad.

ImGui and many other rendering libraries or game engines have the ability to draw a part of an image.
The part is defined by UV. You can think of it as a normalized 2D Vector(ImVec2 in your case) values of witch
vary from 0 to 1 which basically means size of current texture in percents.

Thus, by using UV as an argument in your DrawImage call you need only 1 texture
to draw your animation, that's a hundred times better than importing every single frame.

In code, it looks very compact.
Пожалуйста, авторизуйтесь для просмотра ссылки.
, but I'm not using ImGui, I hope you're clever enough to adapt it to ImGui on your own.
(You can use
Пожалуйста, авторизуйтесь для просмотра ссылки.
to have a clue how this works in ImGui. Almost no differences)

Посмотреть вложение 217093

The final result looks like this:

Thanks,
for taking some of your time to explain to me how this works, thank you so much!
 
Похожие темы
Сверху Снизу