giawa / opengl4csharp

OpenGL 4 Bindings (partially based on OpenTK) for C#
Other
232 stars 61 forks source link

Added readonly WindowID and GLContextID variables to Window #35

Closed TheRealNOIG closed 4 years ago

TheRealNOIG commented 4 years ago

Changed permission level on window ID and glContext ID to allow other classes to retrieve this information.

giawa commented 4 years ago

What use case did you have where you need these public? Since these are set by the Window (and should never be modified) I think it would make more sense to add a read-only property. Would that work for you?

TheRealNOIG commented 4 years ago

That would work without issue. My use case is checking if the SDL window has been initiated yet.

TheRealNOIG commented 4 years ago

I now see the Open boolean in the Window class. But there is still times you would need access to the windowID and the original glContext. One example would be using a single context for multiple windows.

giawa commented 4 years ago

Okay, do you mind updating this PR with read-only properties instead of marking the field as public? Then I can merge the PR. Thanks!

TheRealNOIG commented 4 years ago

Code updated