-
Notifications
You must be signed in to change notification settings - Fork 61
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
Adding Windows code to Gl class #59
Comments
I'll let @TheAIBot check in as well, but I'll talk a bit about a mistake I think I made with this code, and my thoughts on what could/should be done in the future regarding it. I think it was a mistake for me to include the OpenGL.Platform code in the same repo as OpenGL. I think each namespace should have had its own repo, allowing someone to only bring in the parts of OpenGL they wanted. I'm curious if other people would agree with me on this. Is it common to have multiple dlls generated by the same repo? Perhaps it isn't an issue at all. I see this repo as being a way to have simple to use (and safe) bindings to modern OpenGL 4+, and the Platform code was only there to help someone get up and running easily with SDL. Adding more WGL/etc code will further move the codebase towards something other than a simple OpenGL library. So my knee jerk reaction is to suggest that we create a new repo for this type of code, and then link to it from the README of opengl4csharp. However, this is very much an open dialogue. I'm not 100% sure what the right answer is. I've seen some OpenGL libraries contain everything and the kitchen sink (which I sort of don't want to do, but maybe we need to swing that way). Let me know what you think. |
Since OS-specific code like that is so commonly used, I don't think it would move the codebase towards something other than a simple OpenGL library, and I think it would be better to integrate it into the same repository, even though it would not hurt to make another repository for it. |
Honestly i don't know much about these and why one would use them over something like SDL. Window handling stuff is really not my forte.
I really agree with this. The main reason that i am using this project is because it's easy to setup and use. The fact that you only have to write(taken from the readme) using OpenGL;
using OpenGL.Platform;
using System;
namespace OpenGLTest
{
class Program
{
static void Main(string[] args)
{
OpenGL.Platform.Window.CreateWindow("OpenGL", 1280, 720);
while (OpenGL.Platform.Window.Open)
{
OpenGL.Platform.Window.HandleEvents();
OnRenderFrame();
}
}
static void OnRenderFrame()
{
// do OpenGL draw stuff here
}
}
} before you can write OpenGL code is a really awesome thing. Personally i don't want to chose which window manager i use, i just want it to be easy to use. I am not saying that there shouldn't be other options but if we do it then we should preserve the simple, easy, crossplatform option that the project currently has. |
I am adding three symbols: ISWINDOWS, ISMACOS, and ISLINUX. |
Well, if you think it should be in a different repository, create a new repository so I can push my code to it. |
I think what would make sense is for you to create your own public repository and host the code there. Once the library has been built up and you are happy with it (and if there is particular integration with this OpenGL library) you could submit a PR to include a link to it from the README. That way people can find libraries that are compatible with (and can extend) the opengl4csharp library. What do you both think of something like this? |
That'll work, i'll go work on it. |
I want to add WGL/GDI/User32 code to the Gl class, separated by a conditional symbol, ISWINDOWS, so that you can create an OpenGL window without having to use someone else's context.
Inside of OpenGL.Platform or the OpenGL.Constructs folder, we could add a default Win32 context window.
Other people would have to add GLX/CGL for Mac/Linux support, as I don't have a Mac or Linux system to test it on.
What do you think of me adding it and making a pull request? I want to see what you guy's think of it before I take the effort to write it.
The text was updated successfully, but these errors were encountered: