hello mahmoud,
I do not know where the problem is but it does not work. I try since yesterday to create this but it does not work.
the function prototype looks like this:
bool SliderInt(const char * label, int * v, int v_min, int v_max, const char * format = "%d", ImGuiSliderFlags flags = 0)int*v : expects a pointer to int. I also have many that expect float * and bool *.
when you change the slider then the new value should be stored in variable we passed to (int *v).
bool ImGui::SliderInt(const char *label, int *v, int v_min, int v_max, const char *format, ImGuiSliderFlags flags)and
bool ImGui::SliderFloat(const char *label, float *v, float v_min, float v_max, const char *format, ImGuiSliderFlags flags)the idea of these two function just like this small function
void changeValue(int *var)
{
*var = (*var) + 1;
}
how would you write this.
i have done so but does not work
RING_FUNC(ring_changeValue)
{
if (RING_API_PARACOUNT != 1)
{
RING_API_ERROR(RING_API_BADPARACOUNT);
return;
}
// if (!RING_API_ISNUMBER(1))
// {
// RING_API_ERROR(RING_API_BADPARATYPE);
// return;
// }
int *p1 = RING_API_GETINTPOINTER(1);
changeValue(p1);
RING_API_ACCEPTINTVALUE(1);
// int value = (int)RING_API_GETNUMBER(1);
// int *ptr = &value;
// changeValue(ptr);
// RING_API_ACCEPTINTVALUE(1);
}
Translated with
www.DeepL.com/Translator (free version)