Jump to content
Xtreme .Net Talk

LDV

Avatar/Signature
  • Posts

    31
  • Joined

  • Last visited

Everything posted by LDV

  1. Hi Andre, That's exactly the funny thing ! - I'm using DirectX3D in a loop, but when i override the PAINT event, the Direct3D draws nothing ! How come? The problem i'm also having is that the PAINT even draws the screen just after i draws it with direct3D, and that's the reason i wanted to cancel it. Thankd, LDV
  2. I don't know if it will help you, but you can try overriding the WM_PAINT message: C#: protected override void WndProc(ref Message m) { switch(m.Msg) { case WM_PAINT: //base.WndProc(ref m); break; default: base.WndProc(ref m); break; } } LDV
  3. Hi, The problem is, that after i draw my stuff on the device using Direct3D, the painting even in Window Mode, repaint the Form on my Drawings....I found a few solutions, each one have it's own disadvantages: 1. overriding the paint event: protected override void WndProc(ref Message m) (if anyone interested i can show how it's done) but then when i try some Surface StrechRectangle things, it dosen;t draw them for me on the screen. 2. I tried to use: this.SetStyle(ControlStyles.UserPaint, true); or this.SetStyle(ControlStyles.AllPaitningInWmPaint, true); or both of them together. but then i get the screen to flicker much, or the problem is not solved. Any ideas? I don't want to have a loop the redraws again the whole buffer all the time. Thanks, Leonardo
  4. Hello, How can i detrmine the amout of available video memory left and used? I'm trying to DiretX3d.CreateOffPlainSurface(...Poo.Default) and i get NotAvailableVideoMemory exception. When i use the Pool.SystemMemory - i have no problem. BTW, to do BitBlt then, i need to use device.UpdateSurface instead of StretchRectangle - is there another way to do it? Thank you all....
  5. Hi, First - thanks for your answer. The exception thrown is general: "Error in the application". It is thrown in the .StretchRectangle line. But i found the error, i tried blitting from diffrent PixelFormat surfaces. The best thing is to use .CreateOffPlainSurface method and use the same PixelFormat. A few more questions: 1. How do i convert the Images i use from diffrent pixel-formats? 2. You suggested using Sprite class - which is better than surfaces, i agree. The problem is that i need to create a picture off screen and then show the full thing on screen, Sprite class draws directly on the device. Is there another way i can use it? Thanks - LDV
  6. Hi Guys, I'm trying to use the StretchRectangle of DirectX3D in window mode, and it throws and exception. Any ideas? Here is the relevant code parts: d3dpp.Windowed = true; m_localDevice = new Microsoft.DirectX.Direct3D.Device(0, Microsoft.DirectX.Direct3D.DeviceType.Hardware, m_owner, CreateFlags.SoftwareVertexProcessing, d3dpp); --------------------------- m_deviceSurface = m_localDevice.GetBackBuffer(0, 0, BackBufferType.Mono); Bitmap bmpLayout = new Bitmap("layout.png"); // make sure we have the background viewed m_srfcLayout = new Surface(m_localDevice, bmpLayout, Pool.Default); ---------------------------------------------------- m_localDevice.BeginScene(); //viewBmp(ref m_srfcLayout, 0, 0); m_localDevice.Clear(ClearFlags.Target, Color.Blue, 0, 0); //m_localDevice.StretchRectangle(m_srfcLayout, new Rectangle(1, 1, 100, 100), m_deviceSurface, new Rectangle(m_owner.Left + 100, m_owner.Top + 20, 100, 100), TextureFilter.None); m_localDevice.StretchRectangle(m_srfcLayout, new Rectangle(1, 1, 100, 100), m_deviceSurface, new Rectangle(100, 20, 100, 100), TextureFilter.None); m_localDevice.EndScene(); m_localDevice.Present();
×
×
  • Create New...