Win32 API 日本語リファレンス
ホームGraphics.Direct2D › D2D1_RENDERING_CONTROLS

D2D1_RENDERING_CONTROLS

構造体
サイズx64: 12 バイト / x86: 12 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
bufferPrecisionD2D1_BUFFER_PRECISION4+0+0中間バッファの既定精度。
tileSizeD2D_SIZE_U8+4+4レンダリングに用いるタイルの最大サイズ。

各言語での定義

#include <windows.h>

// D2D_SIZE_U  (x64 8 / x86 8 バイト)
typedef struct D2D_SIZE_U {
    DWORD width;
    DWORD height;
} D2D_SIZE_U;

// D2D1_RENDERING_CONTROLS  (x64 12 / x86 12 バイト)
typedef struct D2D1_RENDERING_CONTROLS {
    D2D1_BUFFER_PRECISION bufferPrecision;
    D2D_SIZE_U tileSize;
} D2D1_RENDERING_CONTROLS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D2D_SIZE_U
{
    public uint width;
    public uint height;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct D2D1_RENDERING_CONTROLS
{
    public int bufferPrecision;
    public D2D_SIZE_U tileSize;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D2D_SIZE_U
    Public width As UInteger
    Public height As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure D2D1_RENDERING_CONTROLS
    Public bufferPrecision As Integer
    Public tileSize As D2D_SIZE_U
End Structure
import ctypes
from ctypes import wintypes

class D2D_SIZE_U(ctypes.Structure):
    _fields_ = [
        ("width", wintypes.DWORD),
        ("height", wintypes.DWORD),
    ]

class D2D1_RENDERING_CONTROLS(ctypes.Structure):
    _fields_ = [
        ("bufferPrecision", ctypes.c_int),
        ("tileSize", D2D_SIZE_U),
    ]
#[repr(C)]
pub struct D2D_SIZE_U {
    pub width: u32,
    pub height: u32,
}

#[repr(C)]
pub struct D2D1_RENDERING_CONTROLS {
    pub bufferPrecision: i32,
    pub tileSize: D2D_SIZE_U,
}
import "golang.org/x/sys/windows"

type D2D_SIZE_U struct {
	width uint32
	height uint32
}

type D2D1_RENDERING_CONTROLS struct {
	bufferPrecision int32
	tileSize D2D_SIZE_U
}
type
  D2D_SIZE_U = record
    width: DWORD;
    height: DWORD;
  end;

  D2D1_RENDERING_CONTROLS = record
    bufferPrecision: Integer;
    tileSize: D2D_SIZE_U;
  end;
const D2D_SIZE_U = extern struct {
    width: u32,
    height: u32,
};

const D2D1_RENDERING_CONTROLS = extern struct {
    bufferPrecision: i32,
    tileSize: D2D_SIZE_U,
};
type
  D2D_SIZE_U {.bycopy.} = object
    width: uint32
    height: uint32

  D2D1_RENDERING_CONTROLS {.bycopy.} = object
    bufferPrecision: int32
    tileSize: D2D_SIZE_U
struct D2D_SIZE_U
{
    uint width;
    uint height;
}

struct D2D1_RENDERING_CONTROLS
{
    int bufferPrecision;
    D2D_SIZE_U tileSize;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D2D1_RENDERING_CONTROLS サイズ: 12 バイト(x64)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; bufferPrecision : D2D1_BUFFER_PRECISION (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; tileSize : D2D_SIZE_U (+4, 8byte)  varptr(st)+4 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global D2D_SIZE_U
    #field int width
    #field int height
#endstruct

#defstruct global D2D1_RENDERING_CONTROLS
    #field int bufferPrecision
    #field D2D_SIZE_U tileSize
#endstruct

stdim st, D2D1_RENDERING_CONTROLS        ; NSTRUCT 変数を確保
st->bufferPrecision = 100
mes "bufferPrecision=" + st->bufferPrecision