diff --git a/src/SFML.Window/Context.cs b/src/SFML.Window/Context.cs index 0b6c4c5f..5d8ef5b5 100644 --- a/src/SFML.Window/Context.cs +++ b/src/SFML.Window/Context.cs @@ -33,18 +33,42 @@ public Context() sfContext_destroy(myThis); } + //////////////////////////////////////////////////////////// + /// + /// Check whether a given OpenGL extension is available. + /// + /// Name of the extension to check for + /// True if available, false if unavailable + //////////////////////////////////////////////////////////// + public bool IsExtensionAvailable(string name) + { + return sfContext_isExtensionAvailable(myThis, name); + } + //////////////////////////////////////////////////////////// /// /// Activate or deactivate the context /// /// True to activate, false to deactivate - /// true on success, false on failure + /// True on success, false on failure //////////////////////////////////////////////////////////// public bool SetActive(bool active) { return sfContext_setActive(myThis, active); } + //////////////////////////////////////////////////////////// + /// + /// Get the address of an OpenGL function. + /// + /// Name of the function to get the address of + /// Address of the OpenGL function, on failure + //////////////////////////////////////////////////////////// + public IntPtr GetFunction(string name) + { + return sfContext_getFunction(myThis, name); + } + //////////////////////////////////////////////////////////// /// /// Get the settings of the context. @@ -95,9 +119,15 @@ public override string ToString() [DllImport(CSFML.window, CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] private static extern void sfContext_destroy(IntPtr View); + [DllImport(CSFML.window, CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] + private static extern bool sfContext_isExtensionAvailable(IntPtr View, string name); + [DllImport(CSFML.window, CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] private static extern bool sfContext_setActive(IntPtr View, bool Active); + [DllImport(CSFML.window, CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] + private static extern IntPtr sfContext_getFunction(IntPtr View, string name); + [DllImport(CSFML.window, CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] private static extern ContextSettings sfContext_getSettings(IntPtr View); #endregion