소스 검색

* Updated .Net bindings

tags/v0.99.beta14
Jean-Yves Lamoureux jylam 18 년 전
부모
커밋
99778cee0a
2개의 변경된 파일9개의 추가작업 그리고 9개의 파일을 삭제
  1. +6
    -6
      DotNet/Caca.cs
  2. +3
    -3
      DotNet/test.cs

+ 6
- 6
DotNet/Caca.cs 파일 보기

@@ -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 파일 보기

@@ -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);
}




불러오는 중...
취소
저장