1 module Dgame.Window.GLContextSettings; 2 3 /** 4 * The GLContextSettings structure defines a way to tell OpenGL important user settings, 5 * like the desired major / minor version or the anti aliasing level. 6 * 7 * Note: if anti aliasing is activated you will notice a drastic reduction of your framerate. 8 * 9 * Author: Randy Schuett (rswhite4@googlemail.com) 10 */ 11 struct GLContextSettings { 12 /** 13 * The profile of the OpenGL Context 14 */ 15 enum Profile : ubyte { 16 Default, /// profile depends on platform 17 Compatibility, /// OpenGL compatibility profile - deprecated functions are allowed (default) 18 Core, /// OpenGL core profile - deprecated functions are disabled 19 ES, /// OpenGL ES profile - only a subset of the base OpenGL functionality is available 20 } 21 22 /** 23 * The supported OpenGL Versions 24 */ 25 enum Version : ubyte { 26 Default = 0, /// 27 GL21 = 21, /// 28 GL30 = 30, /// 29 GL31 = 31, /// 30 GL32 = 32, /// 31 GL33 = 33, /// 32 GL40 = 40, /// 33 GL41 = 41, /// 34 GL42 = 42, /// 35 GL43 = 43, /// 36 GL44 = 44, /// 37 GL45 = 45, /// 38 } 39 40 enum AntiAlias : ubyte { 41 None = 0, 42 X2 = 2, 43 X4 = 4, 44 X8 = 8, 45 X16 = 16 46 } 47 48 /** 49 * Anti aliasing level. Default is AntiAlias.None 50 * 51 * Note: A too high value may crash your application at the beginning 52 * because your driver does not support it. 53 */ 54 AntiAlias antiAlias = AntiAlias.None; 55 /** 56 * The OpenGL Version. Default is Version.Default 57 */ 58 Version vers = Version.Default; 59 /** 60 * The OpenGL Context profile. Default is Profile.Compatibility 61 */ 62 Profile profile = Profile.Compatibility; 63 64 /** 65 * CTor 66 */ 67 @nogc 68 this(AntiAlias antiAlias, Version vers = Version.Default, Profile profile = Profile.Compatibility) pure nothrow { 69 this.antiAlias = antiAlias; 70 this.vers = vers; 71 this.profile = profile; 72 } 73 }