opengl4
This commit is contained in:
+6
-3
@@ -35,13 +35,16 @@ public sealed unsafe class SDL3Window : IDisposable
|
||||
|
||||
public SDL3Window(string name, int posX, int posY, int width, int height, SDL.WindowFlags flags = SDL.WindowFlags.Resizable | SDL.WindowFlags.HighPixelDensity)
|
||||
{
|
||||
if (OperatingSystem.IsLinux())
|
||||
SDL.SetHint(SDL.Hints.VideoDriver, "x11");
|
||||
|
||||
if (!SDL.Init(SDL.InitFlags.Events | SDL.InitFlags.Video | SDL.InitFlags.Gamepad))
|
||||
throw new Exception($"SDL_Init failed: {SDL.GetError()}");
|
||||
|
||||
SDL.GLSetAttribute(SDL.GLAttr.ContextFlags, (int)SDL.GLContextFlag.ForwardCompatible);
|
||||
SDL.GLSetAttribute(SDL.GLAttr.ContextProfileMask, (int)SDL.GLProfile.Core);
|
||||
SDL.GLSetAttribute(SDL.GLAttr.ContextMajorVersion, 3);
|
||||
SDL.GLSetAttribute(SDL.GLAttr.ContextMinorVersion, 3);
|
||||
SDL.GLSetAttribute(SDL.GLAttr.ContextMajorVersion, 4);
|
||||
SDL.GLSetAttribute(SDL.GLAttr.ContextMinorVersion, 6);
|
||||
|
||||
SDL.SetHint(SDL.Hints.IMEImplementedUI, "1");
|
||||
|
||||
@@ -116,7 +119,7 @@ public sealed unsafe class SDL3Window : IDisposable
|
||||
_gl = new GL(new BindingsContext(Window, glContext));
|
||||
|
||||
// Init platform and renderer
|
||||
ImGuiSDL3Platform.Init(_gl, glContext, Window, this);
|
||||
ImGuiSDL3Platform.Init(_gl, Window, glContext);
|
||||
ImGuiSDL3Renderer.Init(_gl, "#version 330");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user