rifter1818 Posted August 25, 2004 Posted August 25, 2004 (edited) Proof of problem with sprites DX9.0C? The following program is just a simple WindowsApplication with the following adjustments //Add Refrecnce to Directx,Direct3d,Direct3dx ... using Microsoft.Directx; using Microsoft.Direct3D; ... Device dev; Sprite s; Texture t; public Form1() { InitializeComponent(); PresentParameters pp = new PresentParameters(); pp.Windowed = true; pp.SwapEffect = SwapEffect.Discard; pp.BackBufferHeight = 768; pp.BackBufferWidth = 1024; this.Show(); dev = new Device(0,DeviceType.Hardware,this,CreateFlags.SoftwareVertexProcessing,pp); dev.RenderState.Lighting = false; s = new Sprite(dev); t = TextureLoader.FromFile(dev,"C:\\Test.bmp"); Render(); } void Render() { for(int i = 0;i<600;i++) { dev.Clear(ClearFlags.Target,Color.Black,0,0); dev.BeginScene(); s.Begin(SpriteFlags.None); s.Draw2D(t,new Point(32,32),0,new Point(32,32),Color.White); s.Draw2D(t,Rectangle.Empty,Rectangle.Empty,new Point(512,384),Color.White); s.End(); dev.EndScene(); dev.Present(); Application.DoEvents(); } } Note The Form is set to start Maximized. The above code does indeed render both sprites fine, however if I comment out the first s.draw2d neither render! Problem is that i want to draw my sprites using the second type of rendering but it doesnt seem to draw without the other being called first! Edited August 26, 2004 by rifter1818 Quote
ThePentiumGuy Posted August 26, 2004 Posted August 26, 2004 hmm, why don't you try transforming and/or scaling the world (if they're different sizes) rather than than drawing 2.. btw, could you please explain what these arguments are: s.Draw2D(t,new Point(32,32),0,new Point(32,32),Color.White); s.Draw2D(t,Rectangle.Empty,Rectangle.Empty,new Point(512,384),Color.White); Im confused as to which is Width/Height and which is x,y,z pent Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.