約 3,642,710 件
https://w.atwiki.jp/sampleisbest/pages/588.html
開発環境 Microsoft Visual Studio Community 2019 実行環境 Microsoft Windows 10 Home (64bit) プロジェクト テンプレート C++ 空のプロジェクト プロジェクト名 dx9sample1 参考 座標変換済み頂点で2D板ポリゴンを描画:サンプルプログラム プロジェクト構成プロパティ リンカ―/システム/サブシステム Windows (/SUBSYSTEM WINDOWS) dx9sample1.cpp #pragma comment(lib, "d3d9") #include Windows.h #include d3d9.h #define SAFE_RELEASE(p) if(p){p- Release();p=NULL;} struct CUSTOM_VTX { float x, y, z, w; DWORD color; }; #define CUSTOM_FVF (D3DFVF_XYZRHW | D3DFVF_DIFFUSE) // 外部変数 LPDIRECT3D9 pD3D; LPDIRECT3DDEVICE9 pD3DDev; // 関数プロトタイプ宣言 LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); HWND InitWindow(HINSTANCE hInstance, int nCmdShow); HRESULT InitD3D(HWND hWnd); void Cleanup(); int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int nCmdShow) { HWND hWnd = InitWindow(hInstance, nCmdShow); if (!hWnd) return -1; HRESULT hr = InitD3D(hWnd); if (FAILED(hr)) { Cleanup(); return -1; } ShowWindow(hWnd, nCmdShow); CUSTOM_VTX vtx[] = { { 200, 200, 0, 1, 0xff0000ff }, { 200, 0, 0, 1, 0xff00ff00 }, { 400, 200, 0, 1, 0xffff0000 }, }; MSG msg = { 0 }; while (msg.message != WM_QUIT) { if (PeekMessage( msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage( msg); DispatchMessage( msg); } else { pD3DDev- Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1, 0); pD3DDev- BeginScene(); pD3DDev- SetFVF(CUSTOM_FVF); pD3DDev- DrawPrimitiveUP(D3DPT_TRIANGLELIST, 1, vtx, sizeof CUSTOM_VTX); pD3DDev- EndScene(); pD3DDev- Present(NULL, NULL, NULL, NULL); } } Cleanup(); return msg.wParam; } LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_DESTROY PostQuitMessage(0); return 0; } return DefWindowProc(hWnd, msg, wParam, lParam); } HWND InitWindow(HINSTANCE hInstance, int nCmdShow) { WNDCLASSEX wc = { sizeof WNDCLASSEX }; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WndProc; wc.hInstance = hInstance; wc.hbrBackground = HBRUSH(COLOR_WINDOW + 1); wc.lpszClassName = L"dx9sample1"; if (!RegisterClassEx( wc)) return NULL; DWORD deStyle = WS_OVERLAPPEDWINDOW ^ WS_MAXIMIZEBOX ^ WS_THICKFRAME; RECT rc = { 0, 0, 400, 400 }; AdjustWindowRect( rc, deStyle, FALSE); HWND hWnd = CreateWindow( wc.lpszClassName, L"dx9sample1", deStyle, CW_USEDEFAULT, 0, rc.right - rc.left, rc.bottom - rc.top, NULL, NULL, hInstance, NULL); return hWnd; } HRESULT InitD3D(HWND hWnd) { HRESULT hr; pD3D = Direct3DCreate9(D3D_SDK_VERSION); if (!pD3D) return E_FAIL; D3DPRESENT_PARAMETERS d3dpp = { 0 }; d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.Windowed = TRUE; d3dpp.AutoDepthStencilFormat = D3DFMT_UNKNOWN; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; hr = pD3D- CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, d3dpp, pD3DDev); if (FAILED(hr)) return hr; return S_OK; } void Cleanup() { SAFE_RELEASE(pD3DDev); SAFE_RELEASE(pD3D); }
https://w.atwiki.jp/sampleisbest/pages/590.html
開発環境 Microsoft Visual Studio Community 2019 実行環境 Microsoft Windows 10 Home (64bit) プロジェクト テンプレート C++ 空のプロジェクト プロジェクト名 dx11sample2 dx11sample2.cpp #pragma comment(lib, "d3d11") #pragma comment(lib, "d3dcompiler") #include Windows.h #include wrl.h #include d3d11.h #include d3dcompiler.h #include DirectXMath.h #define HLSL_FILE L"dx11sample2.fx" using namespace Microsoft WRL; using namespace DirectX; struct ConstantBuffer { float frame; float f1, f2, f3;// filler }; // 外部変数 ComPtr ID3D11Device g_pDevice; ComPtr ID3D11DeviceContext g_pContext; ComPtr IDXGISwapChain g_pSwapChain; ComPtr ID3D11RenderTargetView g_pRenderTargetView; ComPtr ID3D11VertexShader g_pVertexShader; ComPtr ID3D11PixelShader g_pPixelShader; ComPtr ID3D11Buffer g_pConstantBuffer; float g_frame = 0; // 関数宣言 HWND InitWindow(HINSTANCE hInst); HRESULT InitDevice(HWND hWnd); void CleanupDevice(); LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); void Render(); int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int nCmdShow) { HWND hWnd = InitWindow(hInstance); if (!hWnd) return -1; if (FAILED(InitDevice(hWnd))) { CleanupDevice(); return -1; } ShowWindow(hWnd, nCmdShow); MSG msg = { 0 }; while (msg.message != WM_QUIT) { if (PeekMessage( msg, nullptr, 0, 0, PM_REMOVE)) { TranslateMessage( msg); DispatchMessage( msg); } else { Render(); } } CleanupDevice(); return int(msg.wParam); } HWND InitWindow(HINSTANCE hInst) { WNDCLASSEX wc = { sizeof WNDCLASSEX }; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WndProc; wc.hInstance = hInst; wc.hCursor = LoadCursor(nullptr, IDC_ARROW); wc.hbrBackground = HBRUSH(COLOR_WINDOW + 1); wc.lpszClassName = L"dx11sample2"; if (!RegisterClassEx( wc)) return nullptr; DWORD dwStyle = WS_OVERLAPPEDWINDOW; RECT rc = { 0, 0, 400, 400 }; AdjustWindowRect( rc, dwStyle, FALSE); HWND hWnd = CreateWindow( wc.lpszClassName, L"dx11sample2", dwStyle, CW_USEDEFAULT, 0, rc.right - rc.left, rc.bottom - rc.top, nullptr, nullptr, hInst, nullptr); return hWnd; } HRESULT CompileShaderFromFile( LPCWSTR szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut) { DWORD dwShaderFlags = D3DCOMPILE_ENABLE_STRICTNESS; ComPtr ID3DBlob pErrorBlob; HRESULT hr = D3DCompileFromFile(szFileName, nullptr, nullptr, szEntryPoint, szShaderModel, dwShaderFlags, 0, ppBlobOut, pErrorBlob); if (FAILED(hr)) { if (pErrorBlob) { OutputDebugStringA((LPCSTR)pErrorBlob- GetBufferPointer()); } return hr; } return S_OK; } HRESULT InitDevice(HWND hWnd) { HRESULT hr; RECT rc; GetClientRect(hWnd, rc); UINT width = rc.right - rc.left; UINT height = rc.bottom - rc.top; DXGI_SWAP_CHAIN_DESC sd = { 0 }; sd.BufferDesc.Width = width; sd.BufferDesc.Height = height; sd.BufferDesc.RefreshRate.Numerator = 60; sd.BufferDesc.RefreshRate.Denominator = 1; sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;// 符号なし正規化整数 sd.SampleDesc.Count = 1; sd.SampleDesc.Quality = 0; sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; sd.BufferCount = 1; sd.OutputWindow = hWnd; sd.Windowed = TRUE; sd.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; D3D_FEATURE_LEVEL featureLevel; hr = D3D11CreateDeviceAndSwapChain( nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, nullptr, 0, D3D11_SDK_VERSION, sd, g_pSwapChain, g_pDevice, featureLevel, g_pContext); if (FAILED(hr)) return hr; // レンダーターゲットビュー ComPtr ID3D11Texture2D pBackBuffer; hr = g_pSwapChain- GetBuffer(0, IID_PPV_ARGS( pBackBuffer)); if (FAILED(hr)) return hr; hr = g_pDevice- CreateRenderTargetView(pBackBuffer.Get(), nullptr, g_pRenderTargetView); if (FAILED(hr)) return hr; g_pContext- OMSetRenderTargets(1, g_pRenderTargetView.GetAddressOf(), nullptr); // ビューポート D3D11_VIEWPORT vp = { 0 }; vp.Width = (FLOAT)width; vp.Height = (FLOAT)height; vp.MinDepth = 0; vp.MaxDepth = 1; g_pContext- RSSetViewports(1, vp); // 頂点シェーダ ComPtr ID3DBlob pVSBlob; hr = CompileShaderFromFile(HLSL_FILE, "VS", "vs_5_0", pVSBlob); if (FAILED(hr)) { return hr; } hr = g_pDevice- CreateVertexShader( pVSBlob- GetBufferPointer(), pVSBlob- GetBufferSize(), nullptr, g_pVertexShader); if (FAILED(hr)) return hr; // ピクセルシェーダ ComPtr ID3DBlob pPSBlob; hr = CompileShaderFromFile(HLSL_FILE, "PS", "ps_5_0", pPSBlob); if (FAILED(hr)) { return hr; } hr = g_pDevice- CreatePixelShader( pPSBlob- GetBufferPointer(), pPSBlob- GetBufferSize(), nullptr, g_pPixelShader); if (FAILED(hr)) return hr; // 定数バッファ D3D11_BUFFER_DESC cb = { 0 }; cb.ByteWidth = sizeof ConstantBuffer; cb.Usage = D3D11_USAGE_DEFAULT; cb.BindFlags = D3D11_BIND_CONSTANT_BUFFER; hr = g_pDevice- CreateBuffer( cb, nullptr, g_pConstantBuffer); if (FAILED(hr)) return hr; return S_OK; } void CleanupDevice() { if (g_pContext) { g_pContext- ClearState(); } } LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; HDC hdc; switch (uMsg) { case WM_PAINT hdc = BeginPaint(hWnd, ps); EndPaint(hWnd, ps); break; case WM_DESTROY PostQuitMessage(0); break; default return DefWindowProc(hWnd, uMsg, wParam, lParam); } return 0; } void Render() { float ClearColor[4] = { 0, 0, 0, 1 }; g_pContext- ClearRenderTargetView(g_pRenderTargetView.Get(), ClearColor); ConstantBuffer cb; cb.frame = g_frame; g_pContext- UpdateSubresource(g_pConstantBuffer.Get(), 0, nullptr, cb, 0, 0); g_pContext- VSSetShader(g_pVertexShader.Get(), nullptr, 0); g_pContext- VSSetConstantBuffers(0, 1, g_pConstantBuffer.GetAddressOf()); g_pContext- PSSetShader(g_pPixelShader.Get(), nullptr, 0); // dx11sample2.fx g_pContext- IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); g_pContext- Draw(3, 0); // dx11sample2b.fx //g_pContext- IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); //g_pContext- Draw(18, 0); g_pSwapChain- Present(1, 0); // g_frame++; } dx11sample2.fx cbuffer ConstantBuffer register(b0) { float frame; }; struct VS_INPUT { uint vid SV_VertexID; }; struct PS_INPUT { float4 Pos SV_Position; float4 Color COLOR; }; // Vertex Shader PS_INPUT VS(VS_INPUT input) { PS_INPUT output = (PS_INPUT)0; float2 coord = float2((input.vid 1) 1, input.vid 1); float2 pos = coord - 0.5; float rad = radians(frame); float c = cos(rad); float s = sin(rad); pos = float2(pos.x * c - pos.y * s, pos.x * s + pos.y * c); output.Pos = float4(pos, 0, 1); output.Color = float4(coord, 1, 1); return output; } // Pixel Shader float4 PS(PS_INPUT input) SV_Target { return input.Color; } dx11sample2b.fx +... cbuffer ConstantBuffer register(b0) { float frame; }; struct VS_INPUT { uint vid SV_VertexID; }; struct PS_INPUT { float4 Pos SV_Position; float4 Coord TEXCOORD; }; matrix rotationX(float angle) { float c = cos(angle); float s = sin(angle); return matrix( 1, 0, 0, 0, 0, c, -s, 0, 0, s, c, 0, 0, 0, 0, 1); } matrix rotationY(float angle) { float c = cos(angle); float s = sin(angle); return matrix( c, 0, s, 0, 0, 1, 0, 0, -s, 0, c, 0, 0, 0, 0, 1); } matrix rotationZ(float angle) { float c = cos(angle); float s = sin(angle); return matrix( c, -s, 0, 0, s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); } static uint vertices[] = { 3,1,2,0, 0,4,2,6,3,7,1,5,0,4, 4,5,6,7 }; // Vertex Shader PS_INPUT VS(VS_INPUT input) { PS_INPUT output = (PS_INPUT)0; uint vtx = vertices[input.vid]; float3 coord = float3(vtx 1, (vtx 1) 1, (vtx 2) 1); float4 pos = float4((coord - 0.5) * float3(0.4, 0.8, 0.2), 1); matrix mWorld = mul(rotationY(radians(frame)), rotationX(radians(70.0))); output.Pos = mul(mWorld, pos); output.Pos.z += 0.5; output.Coord = float4(coord, 1); return output; } // Pixel Shader float4 PS(PS_INPUT input) SV_Target { float3 edge = step(0.48, abs(input.Coord.xyz - 0.5)); if (length(edge) 1.0) { return float4(0.5, 0.5, 0.5, 1); } return input.Coord; }
https://w.atwiki.jp/sampleisbest/pages/591.html
開発環境 Microsoft Visual Studio Community 2019 実行環境 Microsoft Windows 10 Home (64bit) プロジェクト テンプレート C++ 空のプロジェクト プロジェクト名 dx11sample1 dx11sample1.cpp #pragma comment(lib, "d3d11") #pragma comment(lib, "d3dcompiler") #include Windows.h #include wrl.h #include d3d11.h #include d3dcompiler.h #include DirectXMath.h using namespace Microsoft WRL; using namespace DirectX; struct SimpleVertex { XMFLOAT3 Pos; XMFLOAT3 Color; }; struct ConstantBuffer { XMMATRIX mWorld; }; ComPtr ID3D11Device g_pDevice; ComPtr ID3D11DeviceContext g_pContext; ComPtr IDXGISwapChain g_pSwapChain; ComPtr ID3D11RenderTargetView g_pRenderTargetView; ComPtr ID3D11VertexShader g_pVertexShader; ComPtr ID3D11PixelShader g_pPixelShader; ComPtr ID3D11InputLayout g_pVertexLayout; ComPtr ID3D11Buffer g_pVertexBuffer; ComPtr ID3D11Buffer g_pConstantBuffer; float g_theta = 0; // 関数宣言 HWND InitWindow(HINSTANCE hInst); HRESULT InitDevice(HWND hWnd); void CleanupDevice(); LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); void Render(); int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int nCmdShow) { HWND hWnd = InitWindow(hInstance); if (!hWnd) return -1; if (FAILED(InitDevice(hWnd))) { CleanupDevice(); return -1; } ShowWindow(hWnd, nCmdShow); MSG msg = { 0 }; while (msg.message != WM_QUIT) { if (PeekMessage( msg, nullptr, 0, 0, PM_REMOVE)) { TranslateMessage( msg); DispatchMessage( msg); } else { Render(); } } CleanupDevice(); return msg.wParam; } HWND InitWindow(HINSTANCE hInst) { WNDCLASSEX wc = { sizeof WNDCLASSEX }; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WndProc; wc.hInstance = hInst; wc.hCursor = LoadCursor(nullptr, IDC_ARROW); wc.hbrBackground = HBRUSH(COLOR_WINDOW + 1); wc.lpszClassName = L"dx11sample1"; if (!RegisterClassEx( wc)) return nullptr; DWORD dwStyle = WS_OVERLAPPEDWINDOW; RECT rc = { 0, 0, 400, 400 }; AdjustWindowRect( rc, dwStyle, FALSE); HWND hWnd = CreateWindow( wc.lpszClassName, L"dx11sample1", dwStyle, CW_USEDEFAULT, 0, rc.right - rc.left, rc.bottom - rc.top, nullptr, nullptr, hInst, nullptr); return hWnd; } HRESULT CompileShaderFromFile( LPCWSTR szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut) { DWORD dwShaderFlags = D3DCOMPILE_ENABLE_STRICTNESS; ComPtr ID3DBlob pErrorBlob; HRESULT hr = D3DCompileFromFile(szFileName, nullptr, nullptr, szEntryPoint, szShaderModel, dwShaderFlags, 0, ppBlobOut, pErrorBlob); if (FAILED(hr)) { if (pErrorBlob) { OutputDebugStringA((LPCSTR)pErrorBlob- GetBufferPointer()); } return hr; } return S_OK; } HRESULT InitDevice(HWND hWnd) { HRESULT hr; UINT width = 400; UINT height = 400; DXGI_SWAP_CHAIN_DESC sd = { 0 }; sd.BufferDesc.Width = width; sd.BufferDesc.Height = height; sd.BufferDesc.RefreshRate.Numerator = 60; sd.BufferDesc.RefreshRate.Denominator = 1; sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;// 符号なし正規化整数 sd.SampleDesc.Count = 1; sd.SampleDesc.Quality = 0; sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; sd.BufferCount = 1; sd.OutputWindow = hWnd; sd.Windowed = TRUE; sd.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; D3D_FEATURE_LEVEL featureLevel; hr = D3D11CreateDeviceAndSwapChain( nullptr, D3D_DRIVER_TYPE_HARDWARE, nullptr, 0, nullptr, 0, D3D11_SDK_VERSION, sd, g_pSwapChain, g_pDevice, featureLevel, g_pContext); // レンダーターゲットビュー ComPtr ID3D11Texture2D pBackBuffer; hr = g_pSwapChain- GetBuffer(0, IID_PPV_ARGS( pBackBuffer)); if (FAILED(hr)) return hr; hr = g_pDevice- CreateRenderTargetView(pBackBuffer.Get(), nullptr, g_pRenderTargetView); if (FAILED(hr)) return hr; g_pContext- OMSetRenderTargets(1, g_pRenderTargetView.GetAddressOf(), nullptr); // ビューポート D3D11_VIEWPORT vp = { 0 }; vp.Width = (FLOAT)width; vp.Height = (FLOAT)height; vp.MinDepth = 0; vp.MaxDepth = 1; g_pContext- RSSetViewports(1, vp); // 頂点シェーダ ComPtr ID3DBlob pVSBlob; hr = CompileShaderFromFile(L"dx11sample1.fx", "VS", "vs_5_0", pVSBlob); if (FAILED(hr)) { return hr; } hr = g_pDevice- CreateVertexShader( pVSBlob- GetBufferPointer(), pVSBlob- GetBufferSize(), nullptr, g_pVertexShader); if (FAILED(hr)) return hr; // ピクセルシェーダ ComPtr ID3DBlob pPSBlob; hr = CompileShaderFromFile(L"dx11sample1.fx", "PS", "ps_5_0", pPSBlob); if (FAILED(hr)) { return hr; } hr = g_pDevice- CreatePixelShader( pPSBlob- GetBufferPointer(), pPSBlob- GetBufferSize(), nullptr, g_pPixelShader); if (FAILED(hr)) return hr; // g_pContext- IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); // 入力レイアウト D3D11_INPUT_ELEMENT_DESC layout[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "COLOR", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0 }, }; hr = g_pDevice- CreateInputLayout(layout, ARRAYSIZE(layout), pVSBlob- GetBufferPointer(), pVSBlob- GetBufferSize(), g_pVertexLayout); if (FAILED(hr)) return hr; g_pContext- IASetInputLayout(g_pVertexLayout.Get()); // 頂点バッファ SimpleVertex vertices[] = { { XMFLOAT3(0, 0, 1), XMFLOAT3(0, 0, 1) }, { XMFLOAT3(0, 1, 0), XMFLOAT3(0, 1, 0) }, { XMFLOAT3(1, 0, 0), XMFLOAT3(1, 0, 0) }, }; D3D11_BUFFER_DESC vb = { 0 }; vb.ByteWidth = sizeof vertices; vb.Usage = D3D11_USAGE_DEFAULT; vb.BindFlags = D3D11_BIND_VERTEX_BUFFER; D3D11_SUBRESOURCE_DATA InitData = { 0 }; InitData.pSysMem = vertices; hr = g_pDevice- CreateBuffer( vb, InitData, g_pVertexBuffer); if (FAILED(hr)) return hr; UINT stride = sizeof SimpleVertex; UINT offset = 0; g_pContext- IASetVertexBuffers(0, 1, g_pVertexBuffer.GetAddressOf(), stride, offset); // 定数バッファ D3D11_BUFFER_DESC cb = { 0 }; cb.ByteWidth = sizeof ConstantBuffer; cb.Usage = D3D11_USAGE_DEFAULT; cb.BindFlags = D3D11_BIND_CONSTANT_BUFFER; hr = g_pDevice- CreateBuffer( cb, nullptr, g_pConstantBuffer); if (FAILED(hr)) return hr; return S_OK; } void CleanupDevice() { if (g_pContext) { g_pContext- ClearState(); } } LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { PAINTSTRUCT ps; HDC hdc; switch (uMsg) { case WM_PAINT hdc = BeginPaint(hWnd, ps); EndPaint(hWnd, ps); break; case WM_DESTROY PostQuitMessage(0); break; default return DefWindowProc(hWnd, uMsg, wParam, lParam); } return 0; } void Render() { XMMATRIX world = XMMatrixRotationZ(g_theta); // float ClearColor[4] = { 0, 0, 0, 1 }; g_pContext- ClearRenderTargetView(g_pRenderTargetView.Get(), ClearColor); ConstantBuffer cb; //cb.mWorld = XMMatrixTranspose(world); cb.mWorld = world; g_pContext- UpdateSubresource(g_pConstantBuffer.Get(), 0, nullptr, cb, 0, 0); g_pContext- VSSetShader(g_pVertexShader.Get(), nullptr, 0); g_pContext- VSSetConstantBuffers(0, 1, g_pConstantBuffer.GetAddressOf()); g_pContext- PSSetShader(g_pPixelShader.Get(), nullptr, 0); g_pContext- Draw(3, 0); g_pSwapChain- Present(1, 0); // g_theta += 0.01f; } dx11sample1.fx cbuffer ConstantBuffer register(b0) { matrix World; }; struct VS_INPUT { float4 Pos POSITION; float4 Color COLOR; }; struct PS_INPUT { float4 Pos SV_Position; float4 Color COLOR; }; // Vertex Shader PS_INPUT VS(VS_INPUT input) { PS_INPUT output = (PS_INPUT)0; output.Pos = mul(World, input.Pos); output.Color = input.Color; return output; } // Pixel Shader float4 PS(PS_INPUT input) SV_Target { return input.Color; }
https://w.atwiki.jp/sampleisbest/pages/589.html
開発環境 Microsoft Visual Studio Community 2019 実行環境 Microsoft Windows 10 Home (64bit) プロジェクト テンプレート C++ 空のプロジェクト プロジェクト名 dx9sample2 参考 HLSLによる極短レンダリング:サンプルプログラム DirectX Software Development Kit (DXSDK_Jun10)をインストールする。 Download DirectX Software Development Kit from Official Microsoft Download Center プロジェクト構成プロパティ VC++ ディレクトリに以下のパスを追加する。 インクルード ディレクトリ C \Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include ライブラリディレクトリ C \Program Files (x86)\Microsoft DirectX SDK (June 2010)\Lib\x86 dx9sample2.cpp #pragma comment(lib, "d3d9") #pragma comment(lib, "d3dx9") #include Windows.h #include d3d9.h #include d3dx9.h #define SAFE_RELEASE(p) if(p){p- Release();p=NULL;} struct CUSTOM_VTX { float x, y, z; DWORD color; }; #define CUSTOM_FVF (D3DFVF_XYZ | D3DFVF_DIFFUSE) // 外部変数 LPDIRECT3D9 pD3D; LPDIRECT3DDEVICE9 pD3DDev; LPD3DXEFFECT pEffect; IDirect3DVertexBuffer9* pVertex; IDirect3DVertexDeclaration9* pDecl; float t = 0; // 関数プロトタイプ宣言 LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); HWND InitWindow(HINSTANCE hInstance, int nCmdShow); HRESULT InitD3D(HWND hWnd); void Cleanup(); void Render(); int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int nCmdShow) { HWND hWnd = InitWindow(hInstance, nCmdShow); if (!hWnd) return -1; HRESULT hr = InitD3D(hWnd); if (FAILED(hr)) { Cleanup(); return -1; } ShowWindow(hWnd, nCmdShow); MSG msg = { 0 }; while (msg.message != WM_QUIT) { if (PeekMessage( msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage( msg); DispatchMessage( msg); } else { Render(); } } Cleanup(); return msg.wParam; } LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_DESTROY PostQuitMessage(0); return 0; } return DefWindowProc(hWnd, msg, wParam, lParam); } HWND InitWindow(HINSTANCE hInstance, int nCmdShow) { WNDCLASSEX wc = { sizeof WNDCLASSEX }; wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WndProc; wc.hInstance = hInstance; wc.hbrBackground = HBRUSH(COLOR_WINDOW + 1); wc.lpszClassName = L"dx9sample2"; if (!RegisterClassEx( wc)) return NULL; DWORD deStyle = WS_OVERLAPPEDWINDOW ^ WS_MAXIMIZEBOX ^ WS_THICKFRAME; RECT rc = { 0, 0, 400, 400 }; AdjustWindowRect( rc, deStyle, FALSE); HWND hWnd = CreateWindow( wc.lpszClassName, L"dx9sample2", deStyle, CW_USEDEFAULT, 0, rc.right - rc.left, rc.bottom - rc.top, NULL, NULL, hInstance, NULL); return hWnd; } HRESULT InitD3D(HWND hWnd) { HRESULT hr; pD3D = Direct3DCreate9(D3D_SDK_VERSION); if (!pD3D) return E_FAIL; D3DPRESENT_PARAMETERS d3dpp = { 0 }; d3dpp.BackBufferFormat = D3DFMT_UNKNOWN; d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.Windowed = TRUE; d3dpp.AutoDepthStencilFormat = D3DFMT_UNKNOWN; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; hr = pD3D- CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, d3dpp, pD3DDev); if (FAILED(hr)) return hr; // ファイルからシェーダを作成 LPD3DXBUFFER pError; hr = D3DXCreateEffectFromFile( pD3DDev, L"effect.fx", NULL, NULL, D3DXSHADER_DEBUG, 0, pEffect, pError); if (FAILED(hr)) { if (pError) { OutputDebugStringA((LPCSTR)pError- GetBufferPointer()); } SAFE_RELEASE(pError); return hr; } SAFE_RELEASE(pError); // x, y, z, ARGB CUSTOM_VTX vtx[] = { { 0, 0, 1, 0xff0000ff }, { 0, 1, 0, 0xff00ff00 }, { 1, 0, 0, 0xffff0000 }, }; // 頂点バッファの作成 hr = pD3DDev- CreateVertexBuffer( sizeof vtx, D3DUSAGE_WRITEONLY, CUSTOM_FVF, D3DPOOL_MANAGED, pVertex, NULL); void* pData; hr = pVertex- Lock(0, 0, pData, 0); memcpy(pData, vtx, sizeof vtx); hr = pVertex- Unlock(); // 頂点宣言の作成 D3DVERTEXELEMENT9 ve[] = { { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, { 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, D3DDECL_END() }; hr = pD3DDev- CreateVertexDeclaration(ve, pDecl); return S_OK; } void Cleanup() { SAFE_RELEASE(pDecl); SAFE_RELEASE(pVertex); SAFE_RELEASE(pEffect); SAFE_RELEASE(pD3DDev); SAFE_RELEASE(pD3D); } void Render() { pD3DDev- Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1, 0); pD3DDev- BeginScene(); D3DXMATRIX mat; D3DXMatrixRotationZ( mat, t); pEffect- SetMatrix("mat", mat); t += 0.01f; pEffect- SetTechnique("T0"); UINT pass; pEffect- Begin( pass, 0); pEffect- BeginPass(0); pD3DDev- SetStreamSource(0, pVertex, 0, sizeof CUSTOM_VTX); pD3DDev- SetVertexDeclaration(pDecl); pD3DDev- DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1); pEffect- EndPass(); pD3DDev- EndScene(); pD3DDev- Present(NULL, NULL, NULL, NULL); } effect.fx struct VS_INPUT { float4 pos POSITION; float4 color COLOR; }; struct VS_OUTPUT { float4 pos POSITION; float4 color COLOR; }; // constant float4x4 mat; VS_OUTPUT VS(VS_INPUT input) { VS_OUTPUT output; //output.pos = input.pos; output.pos = mul(input.pos, mat); output.color = input.color; return output; } float4 PS(float4 color COLOR) COLOR { return color; } technique T0 { pass P0 { VertexShader = compile vs_2_0 VS(); PixelShader = compile ps_2_0 PS(); } }
https://w.atwiki.jp/sampleisbest/pages/555.html
開発環境 Microsoft Visual Studio Community 2017 実行環境 Microsoft Windows 10 Home (64bit) プロジェクトの種類 Visual C++/空のプロジェクト プロジェクト名 FontSample FontSample.cpp // Unicode文字セット #include Windows.h #include windowsx.h #include set #include string #include "Resource.h" using namespace std; typedef set wstring STRLIST; // 関数プロトタイプ宣言 INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); void OnInitDialog(HWND hDlg); void OnDrawItem(LPARAM lParam); int CALLBACK EnumFontFamExProc(const LOGFONT *lpelfe, const TEXTMETRIC *lpntme, DWORD FontType, LPARAM lParam); void Redraw(); // 外部変数 STRLIST facenames; HWND hMainDlg; int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAINDLG), NULL, DlgProc); return 0; } INT_PTR CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { INT_PTR ret = TRUE; switch (uMsg) { case WM_DRAWITEM OnDrawItem(lParam); break; case WM_COMMAND WORD cid; cid = LOWORD(wParam); switch (cid) { case IDC_FACENAME switch (HIWORD(wParam)) { case LBN_SELCHANGE Redraw(); break; } break; case IDOK Redraw(); break; case IDCANCEL EndDialog(hDlg, LOWORD(wParam)); break; default ret = FALSE; } break; case WM_INITDIALOG hMainDlg = hDlg; OnInitDialog(hDlg); return FALSE; default ret = FALSE; } return ret; } void OnInitDialog(HWND hDlg) { SetDlgItemText(hDlg, IDC_SAMPLE, L"東京都千代○区\r\n永○町1丁目10ー1\r\n\r\n図書 館太郎様\r\n 花子様\r\n1ー1-1―-"); SetDlgItemText(hDlg, IDC_HEIGHT, L"50"); HDC hdc = GetDC(NULL); LOGFONT lf = { 0 }; lf.lfCharSet = DEFAULT_CHARSET; EnumFontFamiliesEx(hdc, lf, EnumFontFamExProc, 0, 0); ReleaseDC(NULL, hdc); HWND hList = GetDlgItem(hDlg, IDC_FACENAME); for (auto e facenames) { ListBox_AddString(hList, e.c_str()); } ListBox_SetCurSel(hList, 0); } void OnDrawItem(LPARAM lParam) { LPDRAWITEMSTRUCT pdi = (LPDRAWITEMSTRUCT)lParam; HDC hdc = pdi- hDC; RECT rcView; GetClientRect(pdi- hwndItem, rcView); FillRect(hdc, rcView, GetSysColorBrush(COLOR_WINDOW)); // 書体名 wchar_t facename[256]; HWND hList = GetDlgItem(hMainDlg, IDC_FACENAME); int index = ListBox_GetCurSel(hList); ListBox_GetText(hList, index, facename); bool vert = (facename[0] == L @ ); // 例文 wchar_t buf[256]; GetDlgItemText(hMainDlg, IDC_SAMPLE, buf, _countof(buf)); // フォントの高さ BOOL trans; int height = GetDlgItemInt(hMainDlg, IDC_HEIGHT, trans, TRUE); if (trans == FALSE) { trans = 10; } // フォント作成 LOGFONT lf = { 0 }; lf.lfCharSet = DEFAULT_CHARSET; lf.lfEscapement = (vert ? 2700 0); //lf.lfOrientation = 2700; lf.lfHeight = height; wcscpy_s(lf.lfFaceName, facename); HFONT hFont = CreateFontIndirect( lf); HGDIOBJ hFontOld = SelectObject(hdc, hFont); if (vert) { LPTSTR p = buf; for (int x = rcView.right; ; x -= abs(height)) { LPTSTR n = wcsstr(p, L"\r\n"); if (n) { *n = 0; TextOut(hdc, x, 0, p, wcslen(p)); p = n + 2; } else { TextOut(hdc, x, 0, p, wcslen(p)); break; } } } else { DrawText(hdc, buf, -1, rcView, 0); } SelectObject(hdc, hFontOld); DeleteObject(hFont); } int CALLBACK EnumFontFamExProc(const LOGFONT *lpelfe, const TEXTMETRIC *lpntme, DWORD FontType, LPARAM lParam) { if (facenames.find(lpelfe- lfFaceName) == facenames.end()) { facenames.insert(lpelfe- lfFaceName); } return TRUE; } void Redraw() { RedrawWindow(GetDlgItem(hMainDlg, IDC_PREVIEW), NULL, NULL, RDW_INVALIDATE); } Resource.h #define IDD_MAINDLG100 #define IDC_FACENAME101 #define IDC_SAMPLE102 #define IDC_HEIGHT103 #define IDC_PREVIEW104 #define IDC_STATIC-1 FontSample.rc #include windows.h #include "resource.h" IDD_MAINDLG DIALOGEX 100, 100, 480, 500 //STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_CENTER | WS_SYSMENU | WS_MINIMIZEBOX CAPTION "Font Sample" FONT 9, "MS UI Gothic" BEGIN LISTBOXIDC_FACENAME,10,10,150,400,WS_TABSTOP | WS_VSCROLL EDITTEXTIDC_SAMPLE,10,420,150,45,ES_MULTILINE | WS_VSCROLL LTEXT"Font Height ",IDC_STATIC,10,475,50,14 EDITTEXTIDC_HEIGHT,50,475,50,14, DEFPUSHBUTTON"OK",IDOK,110,475,50,14,WS_GROUP LTEXT"",IDC_PREVIEW,170,10,300,400,WS_BORDER | SS_OWNERDRAW END
https://w.atwiki.jp/sampleisbest/pages/242.html
開発環境 Microsoft Visual C# 2010 Express (SP1) 実行環境 Microsoft Windows XP Home Edition (SP3) プロジェクトの種類 空のプロジェクト プロジェクト名 MdxSample プロジェクト プロジェクトの保存 [ソリューションのディレクトリを作成]はチェックを付けなくてもいい。 プロジェクトのプロパティ [アプリケーション]タブ 出力の種類:Windows アプリケーション プロジェクトにクラスを追加。 テンプレート:クラス 名前:Program.cs 名前:Form1.cs 名前:MdxSample.cs プロジェクトに新しい項目を追加。 テンプレート:アプリケーション構成ファイル 名前:App.config プロジェクトの参照設定に追加。(.NETタブ) ※Ctrlキーで複数選択可 System System.Drawing System.Windows.Forms プロジェクトの参照設定に追加。(参照タブ) ※Ctrlキーで複数選択可 C \WINDOWS\Microsoft.NET\DirectX for Managed Code\1.0.2902.0 Microsoft.DirectX.dll Microsoft.DirectX.Direct3D.dll Microsoft.DirectX.Direct3DX.dll Microsoft.DirectX.DirectInput.dll 注意 MdxSample.exeと同じディレクトリにMdxSample.exe.configがないと動作が不安定になる。 参考 Managed DirectX - ソーサリーフォース LoaderLockエラーの対処 メニューから[ツール]-[設定]-[上級者設定]を選択する。 メニューから[デバッグ]-[例外]を選択する。 Managed Debugging Assistants/LoaderLockの[スローされるとき]のチェックを外す。 App.config ?xml version="1.0" encoding="utf-8" ? configuration startup useLegacyV2RuntimeActivationPolicy="true" supportedRuntime version="v4.0"/ /startup /configuration Program.cs using System; using System.Threading; using System.Windows.Forms; namespace MdxSample { static class Program { [STAThread] static void Main() { using (Form1 form = new Form1()) using (MdxSample main = new MdxSample()) { if (!main.DXInitialize(form)) { MessageBox.Show("Direct3Dの初期化に失敗しました。", "MdxSample"); return; } form.Show(); while (form.Created) { main.Render(); Thread.Sleep(1); Application.DoEvents(); } } } } } Form1.cs using System.Drawing; using System.Windows.Forms; namespace MdxSample { class Form1 Form { public Form1() { Text = "MdxSample"; ClientSize = new Size(1280, 720); MaximizeBox = false; FormBorderStyle = FormBorderStyle.FixedSingle; } } } MdxSample.cs using System; using System.Drawing; using System.Threading; using Microsoft.DirectX; using Microsoft.DirectX.Direct3D; using Microsoft.DirectX.DirectInput; namespace MdxSample { class MdxSample IDisposable { Form1 form; PresentParameters pp; Microsoft.DirectX.Direct3D.Device dev; Microsoft.DirectX.Direct3D.Font font; Microsoft.DirectX.DirectInput.Device keyboard; VertexBuffer vertexBuffer; // fps int fpsSec; int fpsDraw = 0; int fpsCount = 0; // カメラ float camDist = 3; int camLat = 0; int camLon = 180; public bool DXInitialize(Form1 topLevelForm) { try { form = topLevelForm; // キーボードデバイスの初期化 keyboard = new Microsoft.DirectX.DirectInput.Device(SystemGuid.Keyboard); keyboard.SetCooperativeLevel(form, CooperativeLevelFlags.NonExclusive | CooperativeLevelFlags.Background); keyboard.Acquire(); // Direct3Dデバイス作成 pp = new PresentParameters(); pp.Windowed = true; pp.SwapEffect = SwapEffect.Discard; pp.EnableAutoDepthStencil = true; pp.AutoDepthStencilFormat = DepthFormat.D16; dev = new Microsoft.DirectX.Direct3D.Device(0, Microsoft.DirectX.Direct3D.DeviceType.Hardware, form.Handle, CreateFlags.HardwareVertexProcessing, pp); // フォントの作成 FontDescription fd = new FontDescription(); fd.Height = 24; fd.FaceName = "MS ゴシック"; font = new Microsoft.DirectX.Direct3D.Font(dev, fd); // 頂点バッファ CustomVertex.PositionColored[] vertices = new CustomVertex.PositionColored[3]; vertices[0] = new CustomVertex.PositionColored(0, 1, 0, Color.Red.ToArgb()); vertices[1] = new CustomVertex.PositionColored(1, -1, 0, Color.Green.ToArgb()); vertices[2] = new CustomVertex.PositionColored(-1, -1, 0, Color.Blue.ToArgb()); vertexBuffer = new VertexBuffer(typeof(CustomVertex.PositionColored), 3, dev, Usage.WriteOnly, CustomVertex.PositionColored.Format, Pool.Managed); using (GraphicsStream data = vertexBuffer.Lock(0, 0, LockFlags.None)) { data.Write(vertices); vertexBuffer.Unlock(); } dev.Transform.Projection = Matrix.PerspectiveFovLH(Geometry.DegreeToRadian(45), (float)dev.Viewport.Width / (float)dev.Viewport.Height, 1, 100); dev.RenderState.Lighting = false; return true; } catch { return false; } } public void Render() { KeyboardState state; state = keyboard.GetCurrentKeyboardState(); if (state[Key.Escape]) { form.Close(); return; } if (state[Key.Up]) camLat = Math.Min(camLat + 1, 89); if (state[Key.Down]) camLat = Math.Max(camLat - 1, -89); if (state[Key.Left]) camLon = (camLon + 1) % 360; if (state[Key.Right]) camLon = (camLon + 359) % 360; if (state[Key.PageUp]) camDist -= 0.1f; if (state[Key.PageDown]) camDist += 0.1f; // fps fpsDraw++; int sec = DateTime.Now.Second; if (fpsSec != sec) { fpsCount = fpsDraw; fpsDraw = 0; fpsSec = sec; } // カメラ位置 Vector3 pos; float rad = Geometry.DegreeToRadian(camLat); pos.Y = (float)Math.Sin(rad) * camDist; float r = (float)Math.Cos(rad) * camDist; rad = Geometry.DegreeToRadian(camLon); pos.X = (float)Math.Sin(rad) * r; pos.Z = (float)Math.Cos(rad) * r; dev.Transform.View = Matrix.LookAtLH(pos, new Vector3(), new Vector3(0, 1, 0)); // バックバッファのクリア dev.Clear(ClearFlags.Target | ClearFlags.ZBuffer, Color.CornflowerBlue, 1.0f, 0); dev.BeginScene(); dev.SetStreamSource(0, vertexBuffer, 0); dev.VertexFormat = CustomVertex.PositionColored.Format; dev.DrawPrimitives(PrimitiveType.TriangleList, 0, 1); string text = string.Format("fps={0} lat={1} lon={2} dist={3 f1}", fpsCount, camLat, camLon, camDist); font.DrawText(null, text, 0, 0, Color.White); // バックバッファを表画面に反映 dev.EndScene(); try { dev.Present(); } catch (DeviceLostException) { ResetDevice(); } } void ResetDevice() { int result; if (!dev.CheckCooperativeLevel(out result)) { switch ((ResultCode)result) { case ResultCode.DeviceLost Thread.Sleep(10); break; case ResultCode.DeviceNotReset dev.Reset(pp); break; default form.Close(); break; } } } public void Dispose() { if (font != null) { font.Dispose(); } } } }
https://w.atwiki.jp/arcadegames/pages/15.html
== SYSTEM C == SYSTEM Cはセガが開発したアーケードゲーム用システム基板。同社製メガドライブのシステムと一部互換性を持つ。SYSTEM CとSYSTEM C2がある。 メガドライブとの違いは、音源制御用のZ80が搭載されていないこと、またADPCM音源が追加されていることなど。 == SYSTEM C == マザー シルク形番 パターン形番 == SYSTEM C2 仕様および主要チップ == マザー シルク形番 パターン形番 SYSTEM C2には基板を2枚接続し情報通信することができる専用コネクタが装着されているものもある。(ぷよぷよ通など) 音源 FM音源 YM3438 (OPN2C) (YAMAHA) 24ピンDIP ADPCM音源 uPD7759C (NEC) 40ピンDIP 315-5242 32ピンハイブリッドIC。画像用D/Aコンバータモジュール 315-5313 VDP (YAMAHA) 128ピンQFP 315-5296 I/O LSI (NEC) 100ピンQFP SYSTEMC2に実装されている315-5296
https://w.atwiki.jp/echizenidresssystem4/pages/18.html
黒霧さんの 『Idress4 覚書 』だいたいここ読めばいい。 ダムレイさんの アイドレスシステム4ルールまとめ(ダムレイ版) https //www65.atwiki.jp/damrey0715/pages/23.html アイドレスSystem4 威信点ルール明確化 (修正2):http //blog.tendice.jp/201708/article_2.html 威信点と設置・指定できるものについて。 アイドレスSystem4 移動と輸送のルール(修正2):http //blog.tendice.jp/201710/article_1.html アイドレスSystem4 登録枠ルール:http //blog.tendice.jp/201710/article_2.html アイドレスSystem4 評価計算式(ルール)の明確化(修正1):http //blog.tendice.jp/201710/article_3.html 覚書:再立国のための部品登録に関して
https://w.atwiki.jp/sample112/pages/11.html
aaaaaaaaaaaaa 名前 コメント aaaaaaaa -- satoshi (2007-05-15 18 07 12)
https://w.atwiki.jp/system_ce/pages/20.html
ここでは、TRPGルール「system_ce」の説明をしています。 システム_クリアエディション(system_ce)は、TRPGというゲームです。 TRPGは、複数の人間で楽しむゲームです。 1人が進行役であるGMとなり、残りの参加やプレイヤーとなり、GMなどが用意したシナリオ(あらすじ)をもとに、プレイヤーがキャラになりきってロール(演技)をしながら、シナリオをクリアしていく遊びです。 TRPGは様々なゲームがありますが、ゲームごとにルールや世界設定があり、それをもとに遊んで行くことになります。 しかし、このsystem_ce(以下「CE版」)では、通常のTRPGを一風変わった遊び方をします。 プレイヤーも半GMのような立ち位置で自由にシナリオや世界設定に介入できるのです。