Показать сообщение отдельно

  #6778  
Старый 03.03.2023, 02:50
Digger Man52
Познавший АНТИЧАТ
Регистрация: 14.07.2019
Сообщений: 1,097
С нами: 3596877

Репутация: 183


По умолчанию

Цитата:
Сообщение от !Sam#0235  

I need some function to take the color from the .INI itself that does not cause me problems, is for ImGui::ColorEdit, since the function that I use takes them like this:
use this function to get color from ini and pass it to ImGui::ColorEdit

C++:





Код:
ImVec4
getColorFromINI
(
const
char
*
key
,
const
char
*
fileName
)
{
ImVec4 color
;
char
buffer
[
256
]
=
{
}
;
GetPrivateProfileString
(
"color"
,
key
,
""
,
buffer
,
sizeof
(
buffer
)
,
fileName
)
;
sscanf
(
buffer
,
"R %f G %f B %f"
,
&
color
.
x
,
&
color
.
y
,
&
color
.
z
)
;
color
.
w
=
1.0f
;
// Alpha
return
color
;
}
 
Ответить с цитированием