public Sprite(Texture tex) : base() { texture = tex; VertCount = 4; IndiceCount = 6; TextureCoordsCount = 4; IsTextured = true; Renderer.meshes.Add(this); }
protected override void OnLoad(EventArgs e) { base.WindowBorder = WindowBorder.Hidden; base.OnLoad(e); Title = "SageCS - BFME II"; Renderer.shaders.Add("textured", new Shader(Resource.GetShader("tex.vert"), Resource.GetShader("tex.frag"))); Renderer.activeShader = "textured"; try { Texture t = new Texture(); t.Load(File.Open("GermanSplash.jpg", FileMode.Open)); Renderer.textures.Add("splash", t); } catch { Texture t = new Texture(); t.Load(File.Open("EnglishSplash.jpg", FileMode.Open)); Renderer.textures.Add("splash", t); } Sprite background = new Sprite("splash"); Renderer.initProgram(Width, Height); Renderer.render(); base.SwapBuffers(); FileSystem.Init(); AudioSystem.Init(); Stopwatch stopwatch = Stopwatch.StartNew(); Texture tex = new Texture(); var texS = FileSystem.Open("art\\compiledtextures\\al\\all_faction_banners.dds"); tex.Load(texS); // W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_skn.w3d")); //W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_runa.w3d")); //W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_skl.w3d")); //INIManager.ParseINIs(); new MapLoader(FileSystem.Open("maps\\map mp fords of isen ii\\map mp fords of isen ii.map")); //FileSystem.OpenAllW3D(); var buffer = WavLoader.Load(FileSystem.Open("data\\audio\\speech\\ucheer.wav")); Audio.Sound testSound = new Audio.Sound(buffer); testSound.Play(); stopwatch.Stop(); Console.WriteLine("total loading time: " + stopwatch.ElapsedMilliseconds + "ms"); }
public Sprite(OpenTK.Vector2 pos, OpenTK.Vector2 size,Texture t) { vertBuf = new Buffer(); Vector2[] vertices = new Vector2[6]; vertices[0] = pos; vertices[1] = new Vector2(pos.X+size.X, pos.Y); vertices[2] = new Vector2(pos.X, pos.Y+ size.Y); vertices[3] = new Vector2(pos.X + size.X, pos.Y); vertices[4] = new Vector2(pos.X, pos.Y+size.Y); vertices[5] = pos + size; vertBuf.BufferData(BufferTarget.ArrayBuffer, BufferUsageHint.StaticDraw, vertices); modelMat = Matrix4.Identity; tex = t; }
protected override void OnLoad(EventArgs e) { base.WindowBorder = WindowBorder.Hidden; base.OnLoad(e); GraphicsSystem.Init(); Title = "SageCS - BFME II"; try { Texture t = new Texture(); t.Load(File.Open("GermanSplash.jpg", FileMode.Open)); Sprite sp = new Sprite(Vector2.Zero, new Vector2(800,600),t ); sp.Draw(GraphicsSystem.GetScreen()); } catch { Texture t = new Texture(); t.Load(File.Open("EnglishSplash.jpg", FileMode.Open)); } base.SwapBuffers(); FileSystem.Init(); AudioSystem.Init(); Stopwatch stopwatch = Stopwatch.StartNew(); Texture tex = new Texture(); var texS = FileSystem.Open("art\\compiledtextures\\al\\all_faction_banners.dds"); tex.Load(texS); //W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_skn.w3d")); //W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_runa.w3d")); //W3DLoader.Load(FileSystem.Open("art\\w3d\\gu\\gumaarms_skl.w3d")); INIManager.ParseINIs(); var buffer = WavLoader.Load(FileSystem.Open("data\\audio\\speech\\ucheer.wav")); Sound testSound = new Sound(buffer); testSound.Play(); stopwatch.Stop(); Console.WriteLine("total loading time: " + stopwatch.ElapsedMilliseconds + "ms"); }