Kaynağa Gözat

* Updated .Net bindings

tags/v0.99.beta14
Jean-Yves Lamoureux jylam 18 yıl önce
ebeveyn
işleme
99778cee0a
2 değiştirilmiş dosya ile 9 ekleme ve 9 silme
  1. +6
    -6
      DotNet/Caca.cs
  2. +3
    -3
      DotNet/test.cs

+ 6
- 6
DotNet/Caca.cs Dosyayı Görüntüle

@@ -93,9 +93,9 @@ namespace libCaca
[DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
public static extern void caca_refresh_display(IntPtr kk);
[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]
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]
public static extern Int32 caca_get_display_width(IntPtr kk);
[DllImport("libCaca.dll", CallingConvention=CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity]
@@ -132,13 +132,13 @@ namespace libCaca
{
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()
{


+ 3
- 3
DotNet/test.cs Dosyayı Görüntüle

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

/* We have a proper canvas, let's display it using Caca */
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");

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




Yükleniyor…
İptal
Kaydet