Jump to content
Xtreme .Net Talk

sho

Members
  • Posts

    6
  • Joined

  • Last visited

sho's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. download-> Timer It's from first Managed DirectX release.
  2. DLL is written in C. Im use dumpbin and function names are NewtonCreate and NewtonUpdate.
  3. I'am trying call functions from unmanaged dll. NewtonWorld* NewtonCreate( NewtonAllocMemory mallocFnt, NewtonFreeMemory mfreeFnt); void NewtonUpdate( const NewtonWorld* newtonWorld, float timestep); NewtonWorld it's a struct typedef struct NewtonWorld{} NewtonWorld; NewtonAllocMemory and NewtonFreeMemory typedef void* (_cdecl *NewtonAllocMemory) (int sizeInBytes); typedef void (_cdecl *NewtonFreeMemory) (void *ptr, int sizeInBytes); My wrapper: public delegate byte[] NewtonAllocMemory( int sizeInBytes ); public delegate void NewtonFreeMemory ( byte[] ptr, int sizeInBytes ); public class World { internal IntPtr newtonWorld; [DllImport("Newton.dll", CallingConvention=CallingConvention.Cdecl, ExactSpelling = true)] private static extern IntPtr NewtonCreate( NewtonAllocMemory mallocFnt, NewtonFreeMemory mfreeFnt); [DllImport("Newton.dll", CallingConvention=CallingConvention.Cdecl, ExactSpelling = true)] private static extern void NewtonUpdate( IntPtr ptr, float timestep ); public World() { this.newtonWorld = NewtonCreate( null, null ); } public void Update( float timestep ) { NewtonUpdate( this.newtonWorld, timestep ); } When I try create new object i get EntryNotFoundException. Any sugesstions, help. Thx. .Net 1.1 vs2003
  4. for(int i = this.fileList.SelectedItems.Count - 1; i >= 0; i--) this.fileList.Items.Remove(this.fileList.SelectedItems[0]);
  5. I think that simplest way is use Font object from Microsoft.Directx.Direct3D namespace. When you have Font object you can simply draw text calls DrawText method. Sorry for my english :)
  6. This is simple example i hope thats helps you: //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System; using System.Drawing; using System.Windows.Forms; //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- class Fullscreen : Form { private Device device = null; public Fullscreen() { this.FormBorderStyle = FormBorderStyle.None; } public void InitDirect3D() { PresentParameters presentParams = new PresentParameters(); presentParams.BackBufferCount = 1; presentParams.BackBufferFormat = Manager.Adapters[0].CurrentDisplayMode.Format; presentParams.BackBufferHeight = 768; presentParams.BackBufferWidth = 1024; presentParams.FullScreenRefreshRateInHz = Manager.Adapters[0].CurrentDisplayMode.RefreshRate; presentParams.SwapEffect = SwapEffect.Discard; presentParams.Windowed = false; device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams); } public void Render() { device.Clear(ClearFlags.Target, Color.Black, 1.0f, 0); device.BeginScene(); device.EndScene(); device.Present(); } public static void Main() { using(Fullscreen frm = new Fullscreen()) { frm.InitDirect3D(); frm.Show(); while(frm.Created) { frm.Render(); Application.DoEvents(); } } } }
×
×
  • Create New...