// The shader sources provided with this project use hardcoded layout(location)-s. If you want to do it dynamically, // you can omit the layout(location=X) lines in the vertex shader, and use this in VertexAttribPointer instead of the hardcoded values. public int GetAttribLocation(string attribName) { Bind(); var attrHandle = GL.GetAttribLocation(Handle, attribName); if (attrHandle < 0) { Log.Warn($"GetAttribLocation({attribName}): attrib not found"); } return(attrHandle); }
public RenderWindow(ApplicationConfig config) : base(new GameWindowSettings { IsMultiThreaded = config.IsMultiThreaded, UpdateFrequency = config.UpdateFrequency, RenderFrequency = config.RenderFrequency }, new NativeWindowSettings { Size = config.WindowSize }) { Log.Verbose("Created window"); Config = config; Title = Config.WindowTitle; if (Config.WindowLocation != null) { Location = (Vector2i)Config.WindowLocation; } var vsync = Config.VSync; if (Environment.OSVersion.Platform == PlatformID.Win32NT && IsMultiThreaded && Config.VSync == VSyncMode.Adaptive) { Log.Warn("BUG: OSVersion=mswin, IsMultiThreaded=true Config.VSync=VSyncMode.Adaptive: Force VSyncMode.On"); vsync = VSyncMode.On; } VSync = vsync; if (Config.HideTitleBar && Environment.OSVersion.Platform == PlatformID.Win32NT) { Win32Native.HideTitleBar(); } Size = Config.WindowSize; var diff = Size - Config.WindowSize; if (diff != Vector2i.Zero) { Size = Config.WindowSize - diff; } }