📄 display.cs.svn-base
字号:
using System;
namespace Aspecto.PocketFrog
{
/// <summary>
/// Summary description for Display.
/// </summary>
public class Display : Rasterizer, IDisposable
{
/*
private IntPtr uobj;
public override IntPtr uObject()
{
return uobj;
}
*/
public Display(IntPtr iuobj):base(iuobj)
{
//uobj = iuobj;
}
public static Display Create(IntPtr hWnd,DisplayParameters dp )
{
IntPtr d = PF.display_create(hWnd,ref dp);
if (d.ToInt32()==0)
return null;
else
return new Display(d);
}
public static Display Create(IntPtr hWnd )
{
IntPtr d = PF.display_createdefault(hWnd);
if (d.ToInt32()==0)
return null;
else
return new Display(d);
}
public static Display Create(IntPtr hWnd,int width, int height )
{
IntPtr d = PF.display_createwidthheight(hWnd,width, height);
if (d.ToInt32()==0)
return null;
else
return new Display(d);
}
#region Create with ctrl
public static Display Create( System.Windows.Forms.Control ctrl )
{
IntPtr d = PF.display_createdefault(ctrl.Handle);
if (d.ToInt32()==0)
return null;
else
return new Display(d);
}
public static Display Create( System.Windows.Forms.Control ctrl ,DisplayParameters dp )
{
IntPtr d = PF.display_create(ctrl.Handle, ref dp );
if (d.ToInt32()==0)
return null;
else
return new Display(d);
}
public static Display Create( System.Windows.Forms.Control ctrl, int width, int height )
{
IntPtr d = PF.display_createwidthheight(ctrl.Handle, width, height );
if (d.ToInt32()==0)
return null;
else
return new Display(d);
}
#endregion
/// <summary>
/// Allows menu hard keys to work again
/// </summary>
public void Dispose()
{
PF.display_destroy(uobj);
}
public Surface GetBackBuffer()
{
IntPtr s = PF.display_getbackbuffer(uobj);
if (s.ToInt32() == 0)
return null;
else
return new Surface(s);
}
//TODO: look into marshelling return values of structure types.
/*public Orientation GetOrientation()
{
return PF.display_getorientation(uobj);
}*/
public int GetWidth()
{
return PF.display_getwidth(uobj);
}
public int GetHeight()
{
return PF.display_getheight(uobj);
}
public new Surface SetRenderTarget(Surface target)
{
IntPtr s = PF.display_setrendertarget(uobj,target.uObject());
if (s.ToInt32() == 0)
return null;
else
return new Surface(s);
}
public void Update(Rect rect)
{
PF.display_update(uobj,rect.uObject());
}
public void Update()
{
Rect r = new Rect(0,0,this.GetWidth()-1,this.GetHeight()-1);
Update(r);
}
}
}
/*
POCKETFROGCWRAPPER_API Display* __stdcall display_create(HWND hWnd,PHAL::DisplayParameters& params);
POCKETFROGCWRAPPER_API void __stdcall display_destroy(Display* display);
POCKETFROGCWRAPPER_API Surface* __stdcall display_getbackbuffer(Display* display);
POCKETFROGCWRAPPER_API Orientation __stdcall display_getorientation(Display* display);
POCKETFROGCWRAPPER_API int __stdcall display_getwidth(Display* display);
POCKETFROGCWRAPPER_API int __stdcall display_getheight(Display* display);
POCKETFROGCWRAPPER_API Surface* __stdcall display_setrendertarget(Display* display, Surface* target);
POCKETFROGCWRAPPER_API void __stdcall display_update(Display* display, const Rect* rect = 0);
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -