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

Unsafe code #23

Closed
dmitsuki opened this issue Jun 15, 2017 · 3 comments
Closed

Unsafe code #23

dmitsuki opened this issue Jun 15, 2017 · 3 comments

Comments

@dmitsuki
Copy link

I just did a quick once over and is there any particular reason there is so much unsafe code in here?

Most of the functions just look like a raw pointer needs to be changed to a reference. It says there is an effort underway to change the exposed messages to safe code, but is that still planned? Is contribution welcomed?

@dpethes
Copy link
Contributor

dpethes commented Jun 15, 2017

Sure, if you find methods that don't need to be unsafe, contributions are welcomed.
Although as (c)imgui uses plenty of pointers, my rough guess is that at least 1/3 of the methods will have to use unsafe.

@mellinoe
Copy link
Collaborator

mellinoe commented Jun 16, 2017

The intention is that there are two "layers" in ImGui.NET:

  • ImGuiNative and related native structures: There are direct imports of the native functions, and are unsafe as such. You have to be careful when using this raw layer.
  • ImGui and related safe structures. These are the "friendly", "safe" versions of the functions, intended to be directly used by application code. Underneath, they call the unsafe functions.

Contributions are certainly welcome. Please open an issue before you submit a PR so we can discuss anything before you spend time on a solution.

@xposure xposure mentioned this issue Mar 1, 2018
@mellinoe
Copy link
Collaborator

mellinoe commented Jul 6, 2018

I'm going to close this, but feel free to submit new safe wrapper methods if you find yourself writing too much unsafe code.

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

3 participants