Browse Source

* Updated .Net bindings

tags/v0.99.beta14
Jean-Yves Lamoureux jylam 18 years ago
parent
commit
99778cee0a
2 changed files with 9 additions and 9 deletions
  1. +6
    -6
      DotNet/Caca.cs
  2. +3
    -3
      DotNet/test.cs

+ 6
- 6
DotNet/Caca.cs View File

@@ -93,9 +93,9 @@ namespace libCaca
[DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern void caca_refresh_display(IntPtr kk); public static extern void caca_refresh_display(IntPtr kk);
[DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern void caca_set_delay(IntPtr kk, Int32 d);
public static extern void caca_set_display_time(IntPtr kk, Int32 d);
[DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 caca_get_rendertime(IntPtr kk);
public static extern Int32 caca_get_display_time(IntPtr kk);
[DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern Int32 caca_get_display_width(IntPtr kk); public static extern Int32 caca_get_display_width(IntPtr kk);
[DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] [DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
@@ -132,13 +132,13 @@ namespace libCaca
{ {
caca_refresh_display(kk); caca_refresh_display(kk);
} }
public void setDelay(Int32 d)
public void setDisplayTime(Int32 d)
{ {
caca_set_delay(kk, d);
caca_set_display_time(kk, d);
} }
public Int32 getRendertime()
public Int32 getDisplayTime()
{ {
return caca_get_rendertime(kk);
return caca_get_display_time(kk);
} }
public Int32 getDisplayWidth() public Int32 getDisplayWidth()
{ {


+ 3
- 3
DotNet/test.cs View File

@@ -45,16 +45,16 @@ class Test {


/* We have a proper canvas, let's display it using Caca */ /* We have a proper canvas, let's display it using Caca */
Caca kk = new Caca(qq); Caca kk = new Caca(qq);
kk.setDelay(2000000); // Refresh every 2 seconds
kk.setDisplayTime(2000000); // Refresh every 2 seconds


kk.setDisplayTitle("libcaca .NET Bindings test suite"); kk.setDisplayTitle("libcaca .NET Bindings test suite");


Event e = new Event(); Event e = new Event();
int startTime = kk.getRendertime();
int startTime = kk.getDisplayTime();
while(kk.getEvent(Event.type.KEY_RELEASE, e, 10) == 0) while(kk.getEvent(Event.type.KEY_RELEASE, e, 10) == 0)
{ {
kk.Refresh(); kk.Refresh();
Console.WriteLine("Render time : {0}", kk.getRendertime()-startTime);
Console.WriteLine("Render time : {0}", kk.getDisplayTime()-startTime);
} }






Loading…
Cancel
Save