Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there an example of InputText? #25

Open
PrimeraTech opened this issue Mar 20, 2024 · 1 comment
Open

Is there an example of InputText? #25

PrimeraTech opened this issue Mar 20, 2024 · 1 comment

Comments

@PrimeraTech
Copy link

I have been trying by trial and error to get C# to be happy with my syntax for ImGui.InputText ().

Can anyone provide a single example that will compile and work?

The function prototype is:
public static bool InputText(string label, char* buf, UIntPtr buf_size, ImGuiInputTextFlags flags = (ImGuiInputTextFlags)(0), ImGuiInputTextCallback callback = null, IntPtr user_data = default)

How is a char * variable defined in c# to be compatible with the second parameter?

@PrimeraTech
Copy link
Author

The following code compiles but does not work:

string foo = "this is a test";
unsafe
{
ImGui.InputText("xx", (char*)&foo, new UIntPtr(10));
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant