📄 defs.cs.svn-base
字号:
using System;
using System.Runtime.InteropServices;
namespace Aspecto.PocketFrog
{
public class Defs
{
//////////////////////////////////////////////////////////////////////////////
// Color masks, shifts and bits
//////////////////////////////////////////////////////////////////////////////
public static ushort RED_MASK = 0x1F << 11;
public const ushort GREEN_MASK = 0x3F << 5;
public const ushort BLUE_MASK = 0x1F;
public const int RED_SHIFT = 11;
public const int GREEN_SHIFT = 5;
public const int BLUE_SHIFT = 0;
public const int RED_BITS = 5;
public const int GREEN_BITS = 6;
public const int BLUE_BITS = 5;
//////////////////////////////////////////////////////////////////////////////
// DrawVGAText alignment constants
//////////////////////////////////////////////////////////////////////////////
public const int DVT_NONE = 0;
public const int DVT_LEFT = 1;
public const int DVT_CENTER = 2;
public const int DVT_RIGHT = 3;
/*
//////////////////////////////////////////////////////////////////////////////
// Using declarations
//////////////////////////////////////////////////////////////////////////////
using PHAL::int8_t;
using PHAL::int16_t;
using PHAL::int32_t;
using PHAL::int64_t;
using PHAL::uint8_t;
using PHAL::ushort_t;
using PHAL::uint32_t;
using PHAL::uint64_t;
using PHAL::swap;
using PHAL::Orientation;
using PHAL::ORIENTATION_NORMAL;
using PHAL::ORIENTATION_ROTATE90CCW;
using PHAL::ORIENTATION_ROTATE180;
using PHAL::ORIENTATION_ROTATE90CW;
using PHAL::ORIENTATION_UNKNOWN;
//////////////////////////////////////////////////////////////////////////////
// Pixel - PocketFrog always work with a 16 bit pixel (565 color format)
//////////////////////////////////////////////////////////////////////////////
//Not Needed in .Net
//typedef ushort_t Pixel;
*/
}
public enum DisplayOrientation
{
ORIENTATION_NORMAL, //!< Normal orientation (no rotation)
ORIENTATION_ROTATE90CCW, //!< Rotated 90 degrees to the left
ORIENTATION_ROTATE180, //!< Rotated 180 degrees (upside-down)
ORIENTATION_ROTATE90CW, //!< Rotated 270 degrees to the right
ORIENTATION_UNKNOWN //!< Unknown orientation (unknown or default one)
};
[StructLayout(LayoutKind.Sequential)]
public struct LockInfo
{
public UInt32 pitch;
public ushort pixels;
};
[StructLayout(LayoutKind.Sequential)]
public struct PixelShader
{
//TODO: figure out if i can do this in a structure, if not what do i do?
//public virtual ushort operator()( ushort src, ushort dest) = 0;
//public ushort operator()(ushort src,ushort dest);
};
public struct m_config
{
public string szWindowName;
public DisplayOrientation orientation;
};
public enum SwapEffect
{
SWAP_NONE, ///< Direct access (no buffering).
SWAP_DISCARD, ///< We don't care about the content of the backbuffer.
SWAP_COPY ///< We want to keep the backbuffer content.
};
[StructLayout(LayoutKind.Sequential)]
public struct DisplayParameters
{
public uint m_width; ///< Width of backbuffer in pixels.
public uint m_height; ///< Height of backbuffer in pixels.
public DisplayOrientation m_orientation; ///< Orientation.
public SwapEffect m_swapEffect; ///< Swap effect.
/// Construction
public DisplayParameters( DisplayOrientation orientation,SwapEffect swapEffect)
{
m_width = 240;
m_height = 320;
m_orientation = orientation;
m_swapEffect = swapEffect;
}
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -