public static void MakeInstance() { if (Instance == null) { Instance = new TextureShader(); } }
public void Init() { Console.WriteLine("GL version: " + GL.GetString(StringName.Version)); TextureCollection.Load(); MeshCollection.Load(); BasicShader.MakeInstance(); ForAmbientShader.MakeInstance(); ForDirectionalShader.MakeInstance(); ForShadowDirShader.MakeInstance(); ForPointShader.MakeInstance(); ShadowGenShader.MakeInstance(); ColorShader.MakeInstance(); TextureShader.MakeInstance(); LiquidShader.MakeInstance(new Texture(Util.PATH + "res/textures/liquid.png")); BladeShader.MakeInstance(); OrthoRenderEngine.Init(); TooltipHelper = new TooltipHelper(); ErrortipHelper = new ErrorTooltipHelper(); Localization.LoadFromFile(Util.PATH + "res/localization/no_NO.txt"); MainMenu = new MainMenuView(this); PauseMenu = new PauseMenuView(this); CurrentScene = MakeMenuScene(); CurrentView = MainMenu; CurrentView.OnViewUsed(null); }
public override void PostRender(Scene s, Matrix4 VP) { TextureShader Instance = TextureShader.Instance; Instance.Bind(); Instance.SetTexture(texture); Instance.SetMVP(Modelspace * VP); Instance.ResetColor(); Instance.SetSampleUV(0, 0); Instance.SetSampleSize(sampleUSize, sampleVSize); OrthoRenderEngine.Flat.Draw(); }