Example #1
0
 public static void MakeInstance()
 {
     if (Instance == null)
     {
         Instance = new TextureShader();
     }
 }
Example #2
0
        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);
        }
Example #3
0
        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();
        }