NeonDxLibApi 1.2.0

dotnet add package NeonDxLibApi --version 1.2.0
                    
NuGet\Install-Package NeonDxLibApi -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NeonDxLibApi" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NeonDxLibApi" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="NeonDxLibApi" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NeonDxLibApi --version 1.2.0
                    
#r "nuget: NeonDxLibApi, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NeonDxLibApi@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NeonDxLibApi&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=NeonDxLibApi&version=1.2.0
                    
Install as a Cake Tool

用途

Dxライブラリ をラップしてクラスにまとめたC#ライブラリです。

NDX_API_Base

Dxライブラリが返す結果コードを検証します。Dxライブラリは呼び出しません。

NDX_API_Graphics2D

2Dグラフィックスに関連するDxライブラリの関数を呼び出します。

NDX_API_Graphics3D

3Dグラフィックスに関連するDxライブラリの関数を呼び出します。

NDX_API_Input

入力に関連するDxライブラリの関数を呼び出します。

NDX_API_Movie

動画に関連するDxライブラリの関数を呼び出します。

NDX_API_System

アプリケーションやDxライブラリの初期化コードなどに関連するDxライブラリの関数を呼び出します。

使用方法

ウィンドウモードの場合

// DXライブラリの初期化
NDX_API_System.DxLib_Init();

// ウィンドウモード
NDX_API_Window.ChangeWindowMode(true);

while(true)
{
    // 裏画面をクリア
    NDX_API_Graphics2D.ClearDrawScreen();

    // ESCキーが押されていたら終了
    if (NDX_API_Input.CheckHitKey(NDX_API_Input.KEY_INPUT_ESCAPE))
    {
        break;
    }

    // 描画をここに書きます

    // 裏画面に反映
    NDX_API_Graphics2D.ScreenFlip();
}

// DXライブラリの終了
NDX_API_System.DxLib_End();

また、Neon_DxLibApi_SampleにNeonDxLibApiを使用したサンプルプログラムを公開しています。

デバッグモードとコールスタック

NeonDxLibApiはDXライブラリのコール履歴を保持するスタックを持っています。このスタックはグローバルなbool型変数(NeonDxLibApi.IsDebug)をtrueに設定することで機能します。

// デバッグモードをONにする
NeonDxLibApi.IsDebug = true;

デバッグモード有効時、すべてのDXライブラリのAPI呼び出しは引数情報や実行結果コードとともにコールスタックに記録されます。API呼び出しが失敗した場合はcatchハンドラでこのコールスタックをダンプすることができます。 DXライブラリの呼び出しが階層的に行われている場合を除き、DXライブラリの呼び出しが成功するとコールスタックの呼び出し情報はスタックから自動的に削除されます。 つまり、例外発生時にNeonDxCallStack.Dumpによって表示されたコールスタックは最後の行で失敗したことを表します。

// デバッグモードをONにする
NeonDxLibApi.IsDebug = true;

// try~catchでDXライブラリの呼び出し失敗を捕捉する
try{
    // DXライブラリの呼び出し処理
}
catch(NeonDxDxLibApiException ex)
{
    // DXライブラリの呼び出し履歴(失敗に至るまで呼び出されたAPI)を表示
    NeonDxCallStack.Dump((string str) =>
    {
        Debug.WriteLine(str);
    });
}

<<出力ウィンドウのログ例>>

[Graphics2D_LoadGraph:-1]FileName=C:\\Tmp\\sample.mp4

<<ログフォーマット>>

[API名:結果コード]引数1=引数1の値, 引数2=引数2の値, ...

実行環境

.Net 6 .Net 7

インストール方法

Nuget経由

「ソリューションのNuGetパッケージの管理」から"NeonDxLibApi"で検索、インストール

https://www.nuget.org/packages/NeonDxLibApi

依存ライブラリ

Neon_DxLibApiの実行にはDXライブラリのモジュール(DxLib.dll/DxLib_x64.dll)が必要です。下記のパッケージ(DxLib.NETDLL)に含まれているので実行モジュール(Exe)作成時に参照を追加してください。

DxLib.NETDLL

ライセンス(License)

MITライセンス (詳細はLICENSEを参照)

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NeonDxLibApi:

Package Downloads
Neon_GameLib

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 200 8/19/2024
1.1.0 150 2/25/2024
1.0.9.3 153 2/25/2024
1.0.9.2 271 10/18/2023
1.0.9.1 154 10/18/2023
1.0.9 159 10/18/2023
1.0.8 145 10/18/2023
1.0.7.1 156 10/18/2023
1.0.7 147 10/18/2023
1.0.6.3 144 10/17/2023
1.0.6.2 142 10/17/2023
1.0.6.1 149 10/17/2023
1.0.6 153 10/17/2023
1.0.5 162 10/4/2023
1.0.4 159 9/24/2023
1.0.3 155 9/24/2023
1.0.2 150 9/23/2023
1.0.1 146 9/23/2023
1.0.0 161 9/23/2023