デバイスとは、コンピューターシステムに接続され、コンピューターの構成要素のひとつと位置づけられる、かつ一個の構成要素として半ば独立して扱うことの可能な、機器・装置・部品などを総称する言い方である。
デバイス(device)は、英語では「装置」程度の意味合いであり、必ずしもコンピュータや電子機器の構成部品に限らず、広範に用いられる単語である。たとえば「捕獲器」(魚・虫・害獣などを捕獲する器具)を catching device と表現することがある。
日本語では「デバイス」はもっぱら電子機器とりわけコンピューター関連の部品や周辺機器を指す意味で用いられる。具体的に何を指してデバイスと呼んでいるかは文脈によって異なる。スマートフォンやモバイルノートPCを「デバイス」と呼ぶこともあれば、ディスプレイ(モニター)、キーボード、マウス、プリンターなどの入出力装置を指してデバイスと称することもある。コンピューターに外部接続する機器・装置はもとより、HDDやSSD、光学ドライブ、CPU、メインメモリ、グラフィックカードといったコンピューター内部における基本構成要素もデバイスに該当する。
Windowsでは「コントロールパネル」から「デバイスマネージャー」にアクセスできる。このデバイスマネージャーに一覧表示される項目が、Windowsマシンの構成要素としてのデバイスの一覧であると捉えることもできよう。
パブリック イベント| 名前 | 説明 | |
|---|---|---|
| DeviceLost | デバイスが消失する時点 (リセットの直前など) に発生します。 |
| DeviceReset | デバイスのリセット後に発生します。 |
| DeviceResizing | デバイスのサイズ変更時に発生し、アプリケーションがサイズ変更の既定の処理をキャンセルできるようにします。 |
| Disposing | Dispose メソッドが呼び出されたか、またはデバイス オブジェクトが終了してガベージ コレクタによって収集されたときに発生します。 |
参照
構文Public Class Device Implements IDisposable
public class Device : IDisposable
public ref class Device : IDisposable
public class Device implements IDisposable
public class Device implements IDisposable
解説
使用例Public Class Form1 Inherits Form ' Global variables for this project. Private device As Device = Nothing ' Rendering device. Public Sub New() ' Set the initial size and caption of the form. Me.ClientSize = New System.Drawing.Size(400, 300) Me.Text = "D3D Tutorial 01: CreateDevice" End Sub 'New Public Function InitializeGraphics() As Boolean Try ' Setup Direct3D. Dim presentParams As New PresentParameters() presentParams.Windowed = True presentParams.SwapEffect = SwapEffect.Discard device = New Device(0, DeviceType.Default, Me, CreateFlags.None, presentParams) Return True Catch Return False End Try End Function Private Sub Render() If device Is Nothing Then Return End If 'Clear the backbuffer to a blue color. device.Clear(ClearFlags.Target, System.Drawing.Color.Blue, 1.0F, 0) 'Begin the scene device.BeginScene() 'Rendering of scene objects can happen here. 'End the scene device.EndScene() device.Present() End Sub Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) Me.Render() ' Render on painting. End Sub Protected Overrides Sub OnKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs) If Fix(System.Convert.ToByte(e.KeyChar)) = Fix(System.Windows.Forms.Keys.Escape) Then Me.Close() ' Esc was pressed End If End Sub Shared Sub Main() Dim DeviceForm As New Form1() Try If Not DeviceForm.InitializeGraphics() Then ' Initialize Direct3D MsgBox("Could not initialize Direct3D. This tutorial will exit.") Return End If DeviceForm.Show() 'While the form is still valid, render and process messages 'While DeviceForm.Created ' DeviceForm.Render() ' Application.DoEvents() 'End While Finally DeviceForm.Dispose() End Try End Sub End Class
public class CreateDevice : Form { // Our global variables for this project Device device = null; // Our rendering device public CreateDevice() { // Set the initial size of our form this.ClientSize = new System.Drawing.Size(400, 300); // And it's caption this.Text = "D3D Tutorial 01: CreateDevice"; } public bool InitializeGraphics() { try { // Now let's setup our D3D stuff PresentParameters presentParams = new PresentParameters(); presentParams.Windowed = true; presentParams.SwapEffect = SwapEffect.Discard; device = new Device(0, DeviceType.Default, this, CreateFlags.None, presentParams); return true; } catch (DirectXException) { return false; } } private void Render() { if (device == null) return; //Clear the backbuffer to a blue color device.Clear(ClearFlags.Target, System.Drawing.Color.Blue, 1.0f, 0); //Begin the scene device.BeginScene(); // Rendering of scene objects can happen here //End the scene device.EndScene(); device.Present(); } protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { this.Render(); // Render on painting } protected override void OnKeyPress(System.Windows.Forms.KeyPressEventArgs e) { if ((int)(byte)e.KeyChar == (int)System.Windows.Forms.Keys.Escape) this.Close(); // Esc was pressed } /// <summary> /// The main entry point for the application. /// </summary> static void Main() { using (CreateDevice DeviceForm = new CreateDevice()) { if (!DeviceForm.InitializeGraphics()) // Initialize Direct3D { MessageBox.Show("Could not initialize Direct3D. This tutorial will exit."); return; } DeviceForm.Show(); // While the form is still valid, render and process messages //while (DeviceForm.Created) //{ DeviceForm.Render(); Application.DoEvents(); //} } } }
継承階層
スレッド セーフ
プラットフォームWindows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照
オーバーロードの一覧| 名前 | 説明 |
|---|---|
| Device (Int32, DeviceType, Control, CreateFlags, PresentParameters) | Device 構造体の新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
| Device (Int32, DeviceType, IntPtr, CreateFlags, PresentParameters) | Device 構造体の新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
参照
構文Public Sub New ( _ adapter As Integer, _ deviceType As DeviceType, _ renderWindow As Control, _ behaviorFlags As CreateFlags, _ presentationParameters As PresentParameters _ )
Dim adapter As Integer Dim deviceType As DeviceType Dim renderWindow As Control Dim behaviorFlags As CreateFlags Dim presentationParameters As PresentParameters Dim instance As New Device(adapter, deviceType, renderWindow, behaviorFlags, presentationParameters)
public Device ( int adapter, DeviceType deviceType, Control renderWindow, CreateFlags behaviorFlags, PresentParameters presentationParameters )
public: Device ( int adapter, DeviceType deviceType, Control^ renderWindow, CreateFlags behaviorFlags, PresentParameters^ presentationParameters )
public Device ( int adapter, DeviceType deviceType, Control renderWindow, CreateFlags behaviorFlags, PresentParameters presentationParameters )
public function Device ( adapter : int, deviceType : DeviceType, renderWindow : Control, behaviorFlags : CreateFlags, presentationParameters : PresentParameters )
解説このコンストラクタは、必要な表示モード (またはウィンドウ モード) に設定され、適切なバック バッファを割り当てられた、すべての機能を持つデバイス オブジェクトを作成します。アプリケーションは深度バッファを作成し、設定するだけで、レンダリングを開始できます。
デバイスの一部として作成されたバック バッファは、PresentParameters で LockableBackBuffer が指定されている場合にのみロックできます。マルチサンプル バック バッファと深度サーフェイスはロックできません。
Reset メソッドと TestCooperativeLevel メソッドは、このメソッドを使用してデバイスを作成したスレッドから呼び出される必要があります。
ウィンドウ モードの場合、Device、Reset、および SwapChain を呼び出すと (新しいスワップ チェーンを作成するためにコンストラクタをオーバーライドすると)、バック バッファ形式に Unknown を指定できます。つまり、ウィンドウ モードの場合は、アプリケーションがデバイスを呼び出す前に現在のデスクトップ形式を照会する必要はありません。全画面表示モードの場合は、バック バッファ形式を指定する必要があります。
.NET Framework のセキュリティ
プラットフォームWindows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照
構文Public Sub New ( _ adapter As Integer, _ deviceType As DeviceType, _ renderWindowHandle As IntPtr, _ behaviorFlags As CreateFlags, _ presentationParameters As PresentParameters _ )
Dim adapter As Integer Dim deviceType As DeviceType Dim renderWindowHandle As IntPtr Dim behaviorFlags As CreateFlags Dim presentationParameters As PresentParameters Dim instance As New Device(adapter, deviceType, renderWindowHandle, behaviorFlags, presentationParameters)
public Device ( int adapter, DeviceType deviceType, IntPtr renderWindowHandle, CreateFlags behaviorFlags, PresentParameters presentationParameters )
public: Device ( int adapter, DeviceType deviceType, IntPtr renderWindowHandle, CreateFlags behaviorFlags, PresentParameters^ presentationParameters )
public Device ( int adapter, DeviceType deviceType, IntPtr renderWindowHandle, CreateFlags behaviorFlags, PresentParameters presentationParameters )
public function Device ( adapter : int, deviceType : DeviceType, renderWindowHandle : IntPtr, behaviorFlags : CreateFlags, presentationParameters : PresentParameters )
解説このコンストラクタは、必要な表示モード (またはウィンドウ モード) に設定され、適切なバック バッファを割り当てられた、すべての機能を持つデバイス オブジェクトを作成します。アプリケーションは深度バッファを作成し、設定するだけで、レンダリングを開始できます。
デバイスの一部として作成されたバック バッファは、PresentParameters で LockableBackBuffer が指定されている場合にのみロックできます。マルチサンプル バック バッファと深度サーフェイスはロックできません。
Reset メソッドと TestCooperativeLevel メソッドは、このメソッドを使用してデバイスを作成したスレッドから呼び出される必要があります。
ウィンドウ モードの場合、Device、Reset、および SwapChain を呼び出すと (新しいスワップ チェーンを作成するためにコンストラクタをオーバーライドすると)、バック バッファ形式に Unknown を指定できます。つまり、ウィンドウ モードの場合は、アプリケーションがデバイスを呼び出す前に現在のデスクトップ形式を照会する必要はありません。全画面表示モードの場合は、バック バッファ形式を指定する必要があります。
.NET Framework のセキュリティ
プラットフォームWindows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
参照
パブリック メソッド
プロテクト メソッド| 名前 | 説明 | |
|---|---|---|
| Finalize | オーバーライドされます。 Device 構造体がガベージ コレクタによって破棄される前に、構造体がリソースを解放できるようにします。 |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
参照シーン内のすべてのグラフィカル オブジェクトの親オブジェクト。
Device データ型で公開されるメンバを以下の表に示します。
パブリック コンストラクタ
パブリック プロパティ
パブリック メソッド
プロテクト メソッド| 名前 | 説明 | |
|---|---|---|
| Finalize | オーバーライドされます。 Device 構造体がガベージ コレクタによって破棄される前に、構造体がリソースを解放できるようにします。 |
| MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
パブリック イベント| 名前 | 説明 | |
|---|---|---|
| DeviceLost | デバイスが消失する時点 (リセットの直前など) に発生します。 |
| DeviceReset | デバイスのリセット後に発生します。 |
| DeviceResizing | デバイスのサイズ変更時に発生し、アプリケーションがサイズ変更の既定の処理をキャンセルできるようにします。 |
| Disposing | Dispose メソッドが呼び出されたか、またはデバイス オブジェクトが終了してガベージ コレクタによって収集されたときに発生します。 |
参照一般的には機械の部品や装置のこと。電子部品のように、特殊な変換機能を含む部品または装置もデバイスという。例えば、トランジスター、ダイオード、ホールデバイス、およびメモリーデバイスのような半導体から構成される電子部品で、コンピューターのCPU(中央演算処理装置)に接続される周辺装置のことをいう場合もある。
出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2021/08/16 13:57 UTC 版)
IOT命令のビット3からビット8でI/Oデバイスを指定する。一部は利便性のために標準化されていた。
※この「Device」の解説は、「PDP-8」の解説の一部です。
「Device」を含む「PDP-8」の記事については、「PDP-8」の概要を参照ください。